Admin Panel 2: Private Server Configuration: Difference between revisions
Jump to navigation
Jump to search
Admin Panel 2: Private Server Configuration (view source)
Revision as of 10:21, 24 November 2010
, 24 November 2010no edit summary
(New page: {{Uc_nav_apanel2}} This page allows you to set-up a username and password making your web page server private (restricts access to the root folder www). To use this feature you need to act...) |
Upazixorys (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
=[http://atosaca.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]= | |||
{{Uc_nav_apanel2}} | {{Uc_nav_apanel2}} | ||
This page allows you to set-up a username and password making your web page server private (restricts access to the root folder www). To use this feature you need to activate it in the file /www/.htaccess I have provided a detailed description how to do this see below. | This page allows you to set-up a username and password making your web page server private (restricts access to the root folder www). To use this feature you need to activate it in the file /www/.htaccess I have provided a detailed description how to do this see below. | ||
Line 4: | Line 5: | ||
'''Defaults''' | '''Defaults''' | ||
<table border="0" cellspacing="2" cellpadding="2"> | |||
<tr> | |||
<td bgcolor="#B5B5B5"><strong>Name</strong></td> | |||
<td bgcolor="#B5B5B5"><strong>Default value</strong></td> | |||
<td>&nbsp;</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#DADADA">Username:</td> | |||
<td bgcolor="#DADADA"><strong>root</strong></td> | |||
<td bgcolor="#FFFFFF">This form displays current settings, which is &#8220;root&#8221; for | |||
both name and password. | both name and password.</td> | ||
</tr> | |||
<tr> | |||
<td bgcolor="#DADADA">Password:</td> | |||
<td bgcolor="#DADADA"><strong>root</strong></td> | |||
<td>When you choose your own make sure they are different. </td> | |||
</tr> | |||
</table> | |||
After saving your user name/password pair you can find them in file '''.htpasswd''' this file is located in folder '''*\Uniform Server\udrive\htpasswd\www''' | After saving your user name/password pair you can find them in file '''.htpasswd''' this file is located in folder '''*\Uniform Server\udrive\htpasswd\www''' | ||
Line 44: | Line 45: | ||
The file looks like this: | The file looks like this: | ||
<pre> | |||
# This file provides security to the server limiting access to the localhost only. | # This file provides security to the server limiting access to the localhost only. | ||
# Comment to deactivate. | # Comment to deactivate. | ||
Line 63: | Line 64: | ||
# Defaults: Username - root; Password - root | # Defaults: Username - root; Password - root | ||
#AuthName | #AuthName "Uniform Server - Server Access" | ||
#AuthType Basic | #AuthType Basic | ||
#AuthUserFile /htpasswd/www/.htpasswd | #AuthUserFile /htpasswd/www/.htpasswd | ||
#Require valid-user | #Require valid-user | ||
</pre> | |||
I have split the above into three sections, describing each section in detail at the end I combined all three section. | I have split the above into three sections, describing each section in detail at the end I combined all three section. | ||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 76: | Line 77: | ||
Deleting the htaccess file is a bit draconian you loose flexibly and control for example lets look at the first section of this file. | Deleting the htaccess file is a bit draconian you loose flexibly and control for example lets look at the first section of this file. | ||
<table style="background-color:#00ff00" width="100%" border="0" cellpadding="2" cellspacing="1"> | |||
<tr bgcolor="#A8A8A8"> | |||
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#B5B5B5">'''''Code'''''</td> | |||
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#CCCCCC"> | |||
<nowiki>#</nowiki> This file provides security to the server limiting access to the localhost only.<br> | |||
<nowiki>#</nowiki> Comment to deactivate.<br> | |||
<nowiki>#</nowiki>Order Deny,Allow<br> | |||
<nowiki>#</nowiki>Deny from all<br> | |||
<nowiki>#</nowiki>Allow from 127.0.0.1<br> | |||
</td> | |||
<td valign="top" bgcolor="#CCCCCC"> | |||
'''Section 1)''' The last three lines are commented this means they are inactive and not protecting the folder or its sub-folders | '''Section 1)''' The last three lines are commented this means they are inactive and not protecting the folder or its sub-folders | ||
Line 101: | Line 102: | ||
Alternatively you could delete all lines in this section the effect would still remain the same. | Alternatively you could delete all lines in this section the effect would still remain the same. | ||
</td> | |||
</tr> | |||
</table> | |||
My real point using just three comments you have put your server online, remove the comments and you are back to square one, its that flexibility I am talking about. Delete the lines next time you wish to use them you may have to look up the format for the commands. Lets look at those three lines in more detail. | My real point using just three comments you have put your server online, remove the comments and you are back to square one, its that flexibility I am talking about. Delete the lines next time you wish to use them you may have to look up the format for the commands. Lets look at those three lines in more detail. | ||
Line 118: | Line 119: | ||
Now we make one exception '''Allow''' from port '''127.0.0.1''' this is '''localhost IP adress''' (the PC that Apache is running on) | Now we make one exception '''Allow''' from port '''127.0.0.1''' this is '''localhost IP adress''' (the PC that Apache is running on) | ||
<table style="background-color:#00ff00" width="100%" border="0" cellpadding="2" cellspacing="1"> | |||
<tr bgcolor="#A8A8A8"> | |||
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#B5B5B5">'''''Code'''''</td> | |||
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#CCCCCC"> | |||
<nowiki>#</nowiki> This file provides security to the server limiting access to the localhost only.<br> | |||
<nowiki>#</nowiki> Comment to deactivate.<br> | |||
Order Deny,Allow | Order Deny,Allow<br> | ||
Deny from all | Deny from all<br> | ||
Allow from 127.0.0.1 | Allow from 127.0.0.1<br> | ||
</td> | |||
<td valign="top" bgcolor="#CCCCCC"> | |||
'''Section 1)''' The last three lines are uncommented this means they are active and protecting the folder, where .htacces resides and all its sub-folders | '''Section 1)''' The last three lines are uncommented this means they are active and protecting the folder, where .htacces resides and all its sub-folders | ||
a) Execute the next two commands in this order '''Deny''' and the '''Allow'''. | a) Execute the next two commands in this order '''Deny''' and the '''Allow'''.<br> | ||
b) '''Deny from all''' No one allowed access to the Apache server | b) '''Deny from all''' No one allowed access to the Apache server<br> | ||
c) '''Allow from 127.0.0.1''' Localhost is the only exception and allowed access. | c) '''Allow from 127.0.0.1''' Localhost is the only exception and allowed access.<br> | ||
</td> | |||
</tr> | |||
</table> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 158: | Line 159: | ||
To allow execution of scripts you use the following option +ExecCGI the default is –ExecCGI | To allow execution of scripts you use the following option +ExecCGI the default is –ExecCGI | ||
<table style="background-color:#00ff00" width="100%" border="0" cellpadding="2" cellspacing="1"> | |||
<tr bgcolor="#A8A8A8"> | |||
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#B5B5B5">'''''Code'''''</td> | |||
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#CCCCCC"> | |||
<nowiki>#</nowiki> To disallow execution of cgi scripts in this directory comment next two lines.<br> | |||
AddHandler cgi-script .bat .exe .pl .cgi | AddHandler cgi-script .bat .exe .pl .cgi<br> | ||
Options +ExecCGI | Options +ExecCGI<br> | ||
</td> | |||
<td valign="top" bgcolor="#CCCCCC"> | |||
'''Section 2)''' Allows scripts execution | '''Section 2)''' Allows scripts execution | ||
</td> | |||
</tr> | |||
</table> | |||
<table style="background-color:#00ff00" width="100%" border="0" cellpadding="2" cellspacing="1"> | |||
<tr bgcolor="#A8A8A8"> | |||
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#B5B5B5">'''''Code'''''</td> | |||
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#CCCCCC"> | |||
<nowiki>#</nowiki> To disallow execution of cgi scripts in this directory comment next two lines.<br> | |||
# AddHandler cgi-script .bat .exe .pl .cgi | # AddHandler cgi-script .bat .exe .pl .cgi<br> | ||
<nowiki>#</nowiki> Options +ExecCGI<br> | |||
</td> | |||
<td valign="top" bgcolor="#CCCCCC"> | |||
'''Section 2)''' Comment the lines as shown to disable script execution | '''Section 2)''' Comment the lines as shown to disable script execution | ||
</td> | |||
</tr> | |||
</table> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 209: | Line 210: | ||
The final section of htaccess deals with user name and password protection by default this is disabled. If you have put your servers online (see section 1) anyone on the Internet can view your web site. If you have restricted your server to localhost (default) anyone with access (physical) to your PC can view your web site. | The final section of htaccess deals with user name and password protection by default this is disabled. If you have put your servers online (see section 1) anyone on the Internet can view your web site. If you have restricted your server to localhost (default) anyone with access (physical) to your PC can view your web site. | ||
<table style="background-color:#ff0000" width="100%" border="0" cellpadding="2" cellspacing="1"> | |||
<tr bgcolor="#A8A8A8"> | |||
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#B5B5B5">'''''Code'''''</td> | |||
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#CCCCCC"> | |||
<nowiki>#</nowiki>--<br> | |||
<nowiki>#</nowiki> Activate this to use the Private Server Feature!<br> | |||
<nowiki>#</nowiki>--<br> | |||
<nowiki>#</nowiki> To lock server, uncomment the next 4 lines.<br> | |||
<nowiki>#</nowiki> Defaults: Username - root; Password - root<br> | |||
<nowiki>#</nowiki>AuthName "Uniform Server - Server Access"<br> | |||
<nowiki>#</nowiki>AuthType Basic<br> | |||
<nowiki>#</nowiki>AuthUserFile /htpasswd/www/.htpasswd<br> | |||
<nowiki>#</nowiki>Require valid-user<br> | |||
</td> | |||
<td valign="top" bgcolor="#CCCCCC"> | |||
'''Section 3)''' Comment to disable user name password access to your web site default setting on installing UniServer. | '''Section 3)''' Comment to disable user name password access to your web site default setting on installing UniServer. | ||
</td> | |||
</tr> | |||
</table> | |||
Uncomment the last four lines to enable password protection. Any user trying to view your web site will be requested to enter a name and password. This is the name/password pair you entered for your personal server. | Uncomment the last four lines to enable password protection. Any user trying to view your web site will be requested to enter a name and password. This is the name/password pair you entered for your personal server. | ||
Line 241: | Line 242: | ||
Please note this section is independent of the settings in section one hence authentication will be required. | Please note this section is independent of the settings in section one hence authentication will be required. | ||
<table style="background-color:#00ff00" width="100%" border="0" cellpadding="2" cellspacing="1"> | |||
<tr bgcolor="#A8A8A8"> | |||
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#B5B5B5">'''''Code'''''</td> | |||
<td width="50%" bgcolor="#A8A8A8">'''''Comment'''''</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#CCCCCC"> | |||
<nowiki>#</nowiki>--<br> | |||
<nowiki>#</nowiki> Activate this to use the Private Server Feature!<br> | |||
<nowiki>#</nowiki>--<br> | |||
<nowiki>#</nowiki> To lock server, uncomment the next 4 lines.<br> | |||
<nowiki>#</nowiki> Defaults: Username - root; Password - root<br> | |||
AuthName | AuthName "Uniform Server - Server Access"<br> | ||
AuthType Basic | AuthType Basic<br> | ||
AuthUserFile /htpasswd/www/.htpasswd | AuthUserFile /htpasswd/www/.htpasswd<br> | ||
Require valid-user | Require valid-user<br> | ||
</td> | |||
<td valign="top" bgcolor="#CCCCCC"> | |||
'''Section 3)''' Uncomment last four lines as shown to enable user name password protection. | '''Section 3)''' Uncomment last four lines as shown to enable user name password protection. | ||
</td> | |||
</tr> | |||
</table> | |||
The first line AuthName | The first line AuthName "Uniform Server - Secure Server Access" contains text that is displayed in the authentication required pop-up window, change this to match your web site. | ||
[[Image:Uc_password.gif]] | [[Image:Uc_password.gif]] | ||
Line 284: | Line 285: | ||
The complete htaccess file is shown below. It is currently configure to allow localhost access (section 1), to run cgi scripts (section 2) and require user authentication (section 3). | The complete htaccess file is shown below. It is currently configure to allow localhost access (section 1), to run cgi scripts (section 2) and require user authentication (section 3). | ||
<table style="background-color:#00ff00" width="100%" border="0" cellpadding="2" cellspacing="1"> | |||
<tr bgcolor="#A8A8A8"> | |||
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#B5B5B5">'''''Code'''''</td> | |||
<td width="50%" bgcolor="#A8A8A8">'''''Comment'''''</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#CCCCCC"> | |||
<nowiki>#</nowiki> This file provides security to the server limiting access to the localhost only. <br> | |||
<nowiki>#</nowiki> Comment to deactivate.<br> | |||
Order Deny,Allow | Order Deny,Allow<br> | ||
Deny from all | Deny from all<br> | ||
Allow from 127.0.0.1 | Allow from 127.0.0.1<br> | ||
</td> | |||
<td valign="top" bgcolor="#CCCCCC"> | |||
'''Section 1)''' To put your servers online comment the last three line in this section. | '''Section 1)''' To put your servers online comment the last three line in this section. | ||
The default setting is for localhost access, you can remain connected to the Internet only your local browser will be able to view and access your web-site server. | The default setting is for localhost access, you can remain connected to the Internet only your local browser will be able to view and access your web-site server. | ||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#dadada"> | |||
<nowiki>#</nowiki> To allow execution of cgi scripts in this directory uncomment next two lines.<br> | |||
AddHandler cgi-script .pl .cgi | AddHandler cgi-script .pl .cgi<br> | ||
Options +ExecCGI | Options +ExecCGI<br> | ||
</td> | |||
<td valign="top" bgcolor="#dadada"> | |||
'''Section 2)''' The default is to allow execution of scripts. | '''Section 2)''' The default is to allow execution of scripts. | ||
If you do not runs CGI scripts comment out the last two lines in this section. | If you do not runs CGI scripts comment out the last two lines in this section. | ||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#CCCCCC"> | |||
<nowiki>#</nowiki>--<br> | |||
<nowiki>#</nowiki> Activate this to use the Private Server Feature!<br> | |||
<nowiki>#</nowiki>--<br> | |||
<nowiki>#</nowiki> To lock server, uncomment the next 4 lines.<br> | |||
<nowiki>#</nowiki> Defaults: Username - root; Password - root<br> | |||
<nowiki>#</nowiki>AuthName "Uniform Server - Server Access"<br> | |||
<nowiki>#</nowiki>AuthType Basic<br> | |||
<nowiki>#</nowiki>AuthUserFile /htpasswd/www/.htpasswd<br> | |||
<nowiki>#</nowiki>Require valid-user<br> | |||
</td> | |||
<td valign="top" bgcolor="#CCCCCC"> | |||
'''Section 3)''' For a personal web server the last four lines have been uncommented. To access your web site a user must supply coreect user name and password. | '''Section 3)''' For a personal web server the last four lines have been uncommented. To access your web site a user must supply coreect user name and password. | ||
To disable this comment the last four lines. This allows every one access with the restriction set in section 1) | To disable this comment the last four lines. This allows every one access with the restriction set in section 1) | ||
</td> | |||
</tr> | |||
</table> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' |