Admin Panel 2: Private Server Configuration: Difference between revisions

no 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...)
 
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">
&lt;table border=&quot;0&quot; cellspacing=&quot;2&quot; cellpadding=&quot;2&quot;&gt;
       <tr>
       &lt;tr&gt;
         <td bgcolor="#B5B5B5"><strong>Name</strong></td>
         &lt;td bgcolor=&quot;#B5B5B5&quot;&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;
         <td bgcolor="#B5B5B5"><strong>Default value</strong></td>
         &lt;td bgcolor=&quot;#B5B5B5&quot;&gt;&lt;strong&gt;Default value&lt;/strong&gt;&lt;/td&gt;
         <td>&nbsp;</td>
         &lt;td&gt;&amp;nbsp;&lt;/td&gt;
     </tr>
     &lt;/tr&gt;
       <tr>
       &lt;tr&gt;
         <td bgcolor="#DADADA">Username:</td>
         &lt;td bgcolor=&quot;#DADADA&quot;&gt;Username:&lt;/td&gt;
         <td bgcolor="#DADADA"><strong>root</strong></td>
         &lt;td bgcolor=&quot;#DADADA&quot;&gt;&lt;strong&gt;root&lt;/strong&gt;&lt;/td&gt;
         <td bgcolor="#FFFFFF">This form displays current settings, which is &#8220;root&#8221; for
         &lt;td bgcolor=&quot;#FFFFFF&quot;&gt;This form displays current settings, which is &amp;#8220;root&amp;#8221; for
           both name and password.</td>
           both name and password.&lt;/td&gt;
       </tr>
       &lt;/tr&gt;
       <tr>
       &lt;tr&gt;
         <td bgcolor="#DADADA">Password:</td>
         &lt;td bgcolor=&quot;#DADADA&quot;&gt;Password:&lt;/td&gt;
         <td bgcolor="#DADADA"><strong>root</strong></td>
         &lt;td bgcolor=&quot;#DADADA&quot;&gt;&lt;strong&gt;root&lt;/strong&gt;&lt;/td&gt;
         <td>When you choose your own make sure they are different. </td>
         &lt;td&gt;When you choose your own make sure they are different. &lt;/td&gt;
       </tr>
       &lt;/tr&gt;
     </table>
     &lt;/table&gt;
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>
&lt;pre&gt;
# 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 "Uniform Server - Server Access"
#AuthName &quot;Uniform Server - Server Access&quot;
#AuthType Basic
#AuthType Basic
#AuthUserFile /htpasswd/www/.htpasswd
#AuthUserFile /htpasswd/www/.htpasswd
#Require valid-user
#Require valid-user
</pre>
&lt;/pre&gt;
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">
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;
<tr bgcolor="#A8A8A8">
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div>
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#B5B5B5">'''''Code'''''</td>
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td>
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#CCCCCC">
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;


<nowiki>#</nowiki> This file provides security to the server limiting access to the localhost only.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; This file provides security to the server limiting access to the localhost only.&lt;br&gt;
<nowiki>#</nowiki> Comment to deactivate.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Comment to deactivate.&lt;br&gt;


<nowiki>#</nowiki>Order Deny,Allow<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;Order Deny,Allow&lt;br&gt;
<nowiki>#</nowiki>Deny from all<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;Deny from all&lt;br&gt;
<nowiki>#</nowiki>Allow from 127.0.0.1<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;Allow from 127.0.0.1&lt;br&gt;
</td>
&lt;/td&gt;
<td valign="top" bgcolor="#CCCCCC">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
'''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>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
</table>
&lt;/table&gt;
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">
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;
<tr bgcolor="#A8A8A8">
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div>
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#B5B5B5">'''''Code'''''</td>
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td>
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#CCCCCC">
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;


<nowiki>#</nowiki> This file provides security to the server limiting access to the localhost only.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; This file provides security to the server limiting access to the localhost only.&lt;br&gt;
<nowiki>#</nowiki> Comment to deactivate.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Comment to deactivate.&lt;br&gt;


Order Deny,Allow<br>
Order Deny,Allow&lt;br&gt;
Deny from all<br>
Deny from all&lt;br&gt;
Allow from 127.0.0.1<br>
Allow from 127.0.0.1&lt;br&gt;


</td>
&lt;/td&gt;
<td valign="top" bgcolor="#CCCCCC">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
'''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'''.<br>
a) Execute the next two commands in this order '''Deny''' and the '''Allow'''.&lt;br&gt;
b) '''Deny from all''' No one allowed access to the Apache server<br>
b) '''Deny from all''' No one allowed access to the Apache server&lt;br&gt;
c) '''Allow from 127.0.0.1''' Localhost is the only exception and allowed access.<br>
c) '''Allow from 127.0.0.1''' Localhost is the only exception and allowed access.&lt;br&gt;
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
</table>
&lt;/table&gt;


'''''[[#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">
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;
<tr bgcolor="#A8A8A8">
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div>
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#B5B5B5">'''''Code'''''</td>
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td>
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#CCCCCC">
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;
<nowiki>#</nowiki> To disallow execution of cgi scripts in this directory comment next two lines.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; To disallow execution of cgi scripts in this directory comment next two lines.&lt;br&gt;


AddHandler cgi-script .bat .exe .pl .cgi<br>
AddHandler cgi-script .bat .exe .pl .cgi&lt;br&gt;
Options +ExecCGI<br>
Options +ExecCGI&lt;br&gt;


</td>
&lt;/td&gt;
<td valign="top" bgcolor="#CCCCCC">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
'''Section 2)''' Allows scripts execution
'''Section 2)''' Allows scripts execution
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
</table>
&lt;/table&gt;




<table style="background-color:#00ff00" width="100%" border="0" cellpadding="2" cellspacing="1">
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;
<tr bgcolor="#A8A8A8">
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div>
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#B5B5B5">'''''Code'''''</td>
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td>
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#CCCCCC">
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;
<nowiki>#</nowiki> To disallow execution of cgi scripts in this directory comment next two lines.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; To disallow execution of cgi scripts in this directory comment next two lines.&lt;br&gt;


# AddHandler cgi-script .bat .exe .pl .cgi<br>
# AddHandler cgi-script .bat .exe .pl .cgi&lt;br&gt;
<nowiki>#</nowiki> Options +ExecCGI<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Options +ExecCGI&lt;br&gt;


</td>
&lt;/td&gt;
<td valign="top" bgcolor="#CCCCCC">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
'''Section 2)''' Comment the lines as shown to disable script execution
'''Section 2)''' Comment the lines as shown to disable script execution
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
</table>
&lt;/table&gt;


'''''[[#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">
&lt;table style=&quot;background-color:#ff0000&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;
<tr bgcolor="#A8A8A8">
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div>
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#B5B5B5">'''''Code'''''</td>
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;
<td width="50%" bgcolor="#B5B5B5">'''''Comment'''''</td>
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#CCCCCC">
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;
<nowiki>#</nowiki>--<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;
<nowiki>#</nowiki> Activate this to use the Private Server Feature!<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Activate this to use the Private Server Feature!&lt;br&gt;
<nowiki>#</nowiki>--<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;
<nowiki>#</nowiki> To lock server, uncomment the next 4 lines.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; To lock server, uncomment the next 4 lines.&lt;br&gt;
<nowiki>#</nowiki> Defaults: Username - root; Password - root<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Defaults: Username - root; Password - root&lt;br&gt;


<nowiki>#</nowiki>AuthName "Uniform Server - Server Access"<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthName &quot;Uniform Server - Server Access&quot;&lt;br&gt;
<nowiki>#</nowiki>AuthType Basic<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthType Basic&lt;br&gt;
<nowiki>#</nowiki>AuthUserFile /htpasswd/www/.htpasswd<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthUserFile /htpasswd/www/.htpasswd&lt;br&gt;
<nowiki>#</nowiki>Require valid-user<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;Require valid-user&lt;br&gt;
</td>
&lt;/td&gt;
<td valign="top" bgcolor="#CCCCCC">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
'''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>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
</table>
&lt;/table&gt;


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">
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;
<tr bgcolor="#A8A8A8">
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div>
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#B5B5B5">'''''Code'''''</td>
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;
<td width="50%" bgcolor="#A8A8A8">'''''Comment'''''</td>
&lt;td width=&quot;50%&quot; bgcolor=&quot;#A8A8A8&quot;&gt;'''''Comment'''''&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#CCCCCC">
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;
<nowiki>#</nowiki>--<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;
<nowiki>#</nowiki> Activate this to use the Private Server Feature!<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Activate this to use the Private Server Feature!&lt;br&gt;
<nowiki>#</nowiki>--<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;
<nowiki>#</nowiki> To lock server, uncomment the next 4 lines.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; To lock server, uncomment the next 4 lines.&lt;br&gt;
<nowiki>#</nowiki> Defaults: Username - root; Password - root<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Defaults: Username - root; Password - root&lt;br&gt;


AuthName "Uniform Server - Server Access"<br>
AuthName &quot;Uniform Server - Server Access&quot;&lt;br&gt;
AuthType Basic<br>
AuthType Basic&lt;br&gt;
AuthUserFile /htpasswd/www/.htpasswd<br>
AuthUserFile /htpasswd/www/.htpasswd&lt;br&gt;
Require valid-user<br>
Require valid-user&lt;br&gt;


</td>
&lt;/td&gt;
<td valign="top" bgcolor="#CCCCCC">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
'''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>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
</table>
&lt;/table&gt;
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.
The first line AuthName &quot;Uniform Server - Secure Server Access&quot; 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">
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;
<tr bgcolor="#A8A8A8">
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;
<td colspan="2"><div align="center">File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''</div>
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;
</td>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#B5B5B5">'''''Code'''''</td>
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;
<td width="50%" bgcolor="#A8A8A8">'''''Comment'''''</td>
&lt;td width=&quot;50%&quot; bgcolor=&quot;#A8A8A8&quot;&gt;'''''Comment'''''&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#CCCCCC">
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;
<nowiki>#</nowiki> This file provides security to the server limiting access to the localhost only. <br>
&lt;nowiki&gt;#&lt;/nowiki&gt; This file provides security to the server limiting access to the localhost only. &lt;br&gt;
<nowiki>#</nowiki> Comment to deactivate.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Comment to deactivate.&lt;br&gt;


Order Deny,Allow<br>
Order Deny,Allow&lt;br&gt;
Deny from all<br>
Deny from all&lt;br&gt;
Allow from 127.0.0.1<br>
Allow from 127.0.0.1&lt;br&gt;
</td>
&lt;/td&gt;
<td valign="top" bgcolor="#CCCCCC">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
'''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>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#dadada">
&lt;td bgcolor=&quot;#dadada&quot;&gt;
<nowiki>#</nowiki> To allow execution of cgi scripts in this directory uncomment next two lines.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; To allow execution of cgi scripts in this directory uncomment next two lines.&lt;br&gt;


AddHandler cgi-script .pl .cgi<br>
AddHandler cgi-script .pl .cgi&lt;br&gt;
Options +ExecCGI<br>
Options +ExecCGI&lt;br&gt;
</td>
&lt;/td&gt;
<td valign="top" bgcolor="#dadada">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#dadada&quot;&gt;
'''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>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
<tr>
&lt;tr&gt;
<td bgcolor="#CCCCCC">
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;
<nowiki>#</nowiki>--<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;
<nowiki>#</nowiki> Activate this to use the Private Server Feature!<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Activate this to use the Private Server Feature!&lt;br&gt;
<nowiki>#</nowiki>--<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;
<nowiki>#</nowiki> To lock server, uncomment the next 4 lines.<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; To lock server, uncomment the next 4 lines.&lt;br&gt;
<nowiki>#</nowiki> Defaults: Username - root; Password - root<br>
&lt;nowiki&gt;#&lt;/nowiki&gt; Defaults: Username - root; Password - root&lt;br&gt;


<nowiki>#</nowiki>AuthName "Uniform Server - Server Access"<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthName &quot;Uniform Server - Server Access&quot;&lt;br&gt;
<nowiki>#</nowiki>AuthType Basic<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthType Basic&lt;br&gt;
<nowiki>#</nowiki>AuthUserFile /htpasswd/www/.htpasswd<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthUserFile /htpasswd/www/.htpasswd&lt;br&gt;
<nowiki>#</nowiki>Require valid-user<br>
&lt;nowiki&gt;#&lt;/nowiki&gt;Require valid-user&lt;br&gt;
</td>
&lt;/td&gt;
<td valign="top" bgcolor="#CCCCCC">
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
'''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>
&lt;/td&gt;
</tr>
&lt;/tr&gt;
</table>
&lt;/table&gt;
   
   
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
322

edits