https://wiki.uniformserver.com/index.php?title=Old:4.0-Mona:_Security_%26_passwords&feed=atom&action=historyOld:4.0-Mona: Security & passwords - Revision history2024-03-28T19:04:32ZRevision history for this page on the wikiMediaWiki 1.41.0https://wiki.uniformserver.com/index.php?title=Old:4.0-Mona:_Security_%26_passwords&diff=6505&oldid=prevBobS: BobS moved page 4.0-Mona: Security & passwords to Old:4.0-Mona: Security & passwords without leaving a redirect2013-06-21T12:45:23Z<p>BobS moved page <a href="/index.php?title=4.0-Mona:_Security_%26_passwords&action=edit&redlink=1" class="new" title="4.0-Mona: Security & passwords (page does not exist)">4.0-Mona: Security & passwords</a> to <a href="/Old:4.0-Mona:_Security_%26_passwords" title="Old:4.0-Mona: Security & passwords">Old:4.0-Mona: Security & passwords</a> without leaving a redirect</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:45, 21 June 2013</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>BobShttps://wiki.uniformserver.com/index.php?title=Old:4.0-Mona:_Security_%26_passwords&diff=5587&oldid=prevBobS: Punctuation and grammatical changes; some clarification.2011-06-07T20:33:18Z<p>Punctuation and grammatical changes; some clarification.</p>
<a href="https://wiki.uniformserver.com/index.php?title=Old:4.0-Mona:_Security_%26_passwords&diff=5587&oldid=3649">Show changes</a>BobShttps://wiki.uniformserver.com/index.php?title=Old:4.0-Mona:_Security_%26_passwords&diff=3649&oldid=prevRic: New page: {{Nav 4.0-Mona}} '''Security and passwords''' New users may find Uniform Server’s security features a little bewildering this page attempts to explain their use and when passwords are r...2009-02-15T09:19:14Z<p>New page: {{Nav 4.0-Mona}} '''Security and passwords''' New users may find Uniform Server’s security features a little bewildering this page attempts to explain their use and when passwords are r...</p>
<p><b>New page</b></p><div>{{Nav 4.0-Mona}}<br />
'''Security and passwords'''<br />
<br />
New users may find Uniform Server’s security features a little bewildering this page attempts to explain their use and when passwords are required.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Default installation ==<br />
After extracting Uniform Server 4.0-Mona it’s ready to run and very secure. Apache and MySQL servers are locked down allowing only local access. No external access allowed from either Intranet or Internet hence while connected to these you can safely develop a web site.<br />
<br />
Uniform Server 4.0-Mona achieves this lock down through the use of '''.htaccess''' files placed in each folder that is protected. The file also '''protects''' any '''sub-folders''' in that folder.<br />
<br />
Each of these folders contains an .htaccess file:<br />
<pre><br />
\UniServer\udrive\home\admin\www – Control panel for the server<br />
\UniServer\udrive\www – Server web-root folder (your web site ) <br />
\UniServer\udrive\ssl – Server secure web-root (your secure web site)<br />
</pre><br />
Open either of the .htacces files and you will find these three lines <br />
<pre><br />
Order Deny,Allow<br />
Deny from all<br />
Allow from 127.0.0.1 <br />
</pre><br />
The first line informs Apache to look for the next two lines and execute them in that order (Deny and then Allow)<br />
<br />
The second line denies access to every one (all)<br />
<br />
The third line is very specific and allows access from IP address 127.0.0.1 this is the IP address of the local machine. Hence Apache is locked down allowing only localhost access. (IP address 127.0.0.1 is also referred to as the local loop back address)<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Allowing external access ==<br />
To put your servers on-line you need to allow external access this is achieved by commenting (adding a hash “#” to the beginning of each line) the three lines as shown below:<br />
<pre> <br />
#Order Deny,Allow<br />
#Deny from all<br />
#Allow from 127.0.0.1<br />
</pre><br />
Alternatively you could delete the three lines.<br />
<br />
With the lines commented everyone connected to the Internet or Intranet has access to the folders that the .htaccess file was protecting.<br />
<br />
Your web site or sites are placed in the folders:<br />
<pre> <br />
\UniServer\udrive\www – Server web-root folder (your web site ) <br />
\UniServer\udrive\ssl – Server secure web-root (your secure web site)<br />
</pre><br />
These are now available and pages will be served by Apache from these folders.<br />
<br />
However modifying the '''.htaccess''' file in folder '''\UniServer\udrive\home\admin\www''' you will have allowed everyone access to your server’s control panel (kiss your servers goodbye). OK I was after a dramatic impact there are additional security features that prevents this however I recommend you do not place Apanel on-line, if you must! Make sure you enable name/password protection. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Name Password protection ==<br />
You may wish to prevent other Internet users accessing your server (a personal web server) this can be achieved by forcing a user to enter a name and password. Uniform Server has this facility pre-configured, '''Apanel''' allows you to set a name and password for three specific areas of the server. Under '''Configurations''' (left menu) you will find these three links: <br />
<br />
* Admin Panel Configuration<br />
* Private Server Configuration<br />
* Private Secure Server Configuration<br />
<br />
After setting a name and password they do not become effective '''unless enabled''' in the '''appropriate .htaccess''' file, lets look at these in more detail. <br />
<br />
'''''[[#top | Top]]'''''<br />
=== A) Admin Panel Configuration ===<br />
If you have placed Apanel on-line it must be protected with a name and password as follows:<br />
<br />
Edit file: \UniServer\udrive\home\admin\www\'''.htaccess'''<br />
<br />
At the bottom of this file un-comment (remove the hash”#”) the last four lines as shown<br />
<pre><br />
AuthName "Uniform Server - Admin Panel 2.0"<br />
AuthType Basic<br />
AuthUserFile /htpasswd/home/admin/www/.htpasswd<br />
Require valid-user<br />
</pre><br />
First line is the text displayed in the browser pop-up<br />
<br />
Second line informs Apache the type of authentication (Basic)<br />
<br />
Third line is the location of the file containing the name/password pair<br />
<br />
The forth line forces Apache to instruct a browser a name and password are required. <br />
<br />
Change name and password using Apanel, click on the link “'''Admin Panel Configuration'''” a new page opens showing current name/password. Enter new name/password click change.<br />
<br />
Alternatively edit file /htpasswd/home/admin/www/'''.htpasswd''' and enter a name and password in the following format. <br />
<br />
'''aname:apassword''' <br />
<br />
'''''Note'':''' Do not add any additional characters or carriage return (enter key) after the password.<br />
<br />
'''''Test'':''' Enter the following into your browser<br />
<br />
'''<nowiki>http://localhost/apanel/</nowiki>'''<br />
<br />
or<br />
<br />
'''<nowiki>http://your_domain/apanel/</nowiki>'''<br />
<br />
In both cases you will be challenged for a name and password.<br />
<br />
'''''Note'':''' Default name and password are '''root:root'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== B) Private Server Configuration ===<br />
You can protect you web site with a name and password as follows:<br />
<br />
Edit file: \UniServer\udrive\www\'''.htaccess'''<br />
<br />
At the bottom of this file un-comment (remove the hash”#”) the last four lines as shown<br />
<pre><br />
AuthName "Uniform Server - Server Access"<br />
AuthType Basic<br />
AuthUserFile /htpasswd/www/.htpasswd<br />
Require valid-user<br />
</pre><br />
First line is the text displayed in the browser pop-up<br />
<br />
Second line informs Apache the type of authentication (Basic)<br />
<br />
Third line is the location of the file containing the name/password pair<br />
<br />
The forth line forces Apache to instruct a browser a name and password are required. <br />
<br />
Change name and password using Apanel, click on the link “'''Private Server Configuration'''” a new page opens showing current name/password. Enter new name/password click change.<br />
<br />
Alternatively edit file /htpasswd/www/'''.htpasswd''' and enter a name and password in the following format. '''aname:apassword''' <br />
<br />
'''''Note'':''' Do not add any additional characters or carriage return (enter key) after the password.<br />
<br />
'''''Test'':''' Enter the following into your browser<br />
<br />
'''<nowiki>http://localhost</nowiki>'''<br />
<br />
or<br />
<br />
'''<nowiki>http://your_domain/</nowiki>'''<br />
<br />
In both cases you will be challenged for a name and password.<br />
<br />
'''''Note'':''' Default name and password are '''root:root'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== C) Private Secure Server Configuration ===<br />
You can protect you secure web site with a name and password as follows:<br />
<br />
Edit file: \UniServer\udrive\ssl\'''.htaccess'''<br />
<br />
At the bottom of this file un-comment (remove the hash”#”) the last four lines as shown<br />
<pre><br />
AuthName "Uniform Server - Server Access" <br />
AuthType Basic<br />
AuthUserFile /htpasswd/ssl/.htpasswd<br />
Require valid-user<br />
</pre><br />
First line is the text displayed in the browser pop-up<br />
<br />
Second line informs Apache the type of authentication (Basic)<br />
<br />
Third line is the location of the file containing the name/password pair<br />
<br />
The forth line forces Apache to instruct a browser a name and password are required. <br />
<br />
Change name and password using Apanel, click on the link “Private Secure Server Configuration” a new page opens showing current name/password. Enter new name/password click change.<br />
<br />
Alternatively edit file /htpasswd/ssl/.htpasswd and enter a name and password in the following format. '''aname:apassword''' <br />
<br />
'''''Note'':''' Do not add any additional characters or carriage return (enter key) after the password.<br />
<br />
'''''Test'':''' Enter the following into your browser<br />
<br />
'''<nowiki>https://localhost/</nowiki>'''<br />
<br />
or<br />
<br />
'''<nowiki>https://your_domain/</nowiki>'''<br />
<br />
In both cases you will be challenged for a name and password.<br />
<br />
'''''Note'' 1:''' Default name and password are '''root:root'''<br />
<br />
'''''Note'' 2:''' Make sure you have generated a '''new server certificate and key''' as detailed on [[4.0-Mona: Enable SSL | this page]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== MySQL Password ==<br />
The MySQL server has been locked down for local access and protected by a password. If you have not put Apache on-line there is no need to change the password (default '''root'''). However it is good practice to change this at the '''earliest opportunity'''.<br />
<br />
With Apache on-line there is a risk either through malicious intent or a rouge script to gain access to the MySQL server’s root user hence change the password. Note access remains local because user root has been restricted to local access.<br />
<br />
To change the MySQL password use Apanel, click on the link “'''MySQL Server Configuration''' ” a new page opens showing current password ('''default root'''). Enter new password click change; there is no need to re-start the server. <br />
<br />
<br />
'''''Note 1'':''' After changing either the MySQL port or password you may find server access is no longer possible using phpMyAdmin. A common cause is your browser cache close down servers and browser then restart. <br />
<br />
'''''Note'' 2:''' If for any reason the password becomes corrupted don’t panic use the password recovery link, found under Apanel's Plugin Manager section (left menu). Alternatively check out [[MySQL Lost Password | this page]], how to manually create a new password.<br />
<br />
'''''Note'' 3:''' If you need to quickly back-up your databases no need to use phpMyAdmin or any other tool just back-up folder '''UniServer\udrive\usr\local\mysql\data''' this contains all databases.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
In terms of security if you are using the server for development there is nothing to do.<br />
<br />
If you are putting the servers on-line they need to be enabled first by editing each of the '''.htaccess''' contained in each web-root folder (www and or ssl). Comment the lines as shown:<br />
<pre><br />
#Order Deny,Allow<br />
#Deny from all<br />
#Allow from 127.0.0.1<br />
</pre><br />
If you want a personal server with name/password access uncomment the last four lines in the above '''.htaccess''' files. Remember to change the name/password pairs using Apanel or manually edit the appropriate file.<br />
<br />
'''''Note 1'':''' All names and passwords are set to a value of '''root'''<br />
<br />
'''''Note 2'':''' Additional information can be found on the [[4.0-Mona: Security features | Security features]] page this includes Apanel's '''Security Center''' page <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 4.0-Mona]]</div>Ric