Difference between revisions of "Controlling access to /billing"
From Kolmisoft Wiki
Jump to navigationJump to search
(8 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Edit /var/www/html/billing/.htaccess and add following lines to the most bottom of the file: | = BY IP address = | ||
Create (or Edit if exist) /var/www/html/billing/.htaccess and add following lines to the most bottom of the file: | |||
Order Deny,Allow | Order Deny,Allow | ||
Deny from all | Deny from all | ||
Allow from friends_ip another_friends_ip | Allow from 127.0.0.1 friends_ip another_friends_ip | ||
You can add multiple ip addresses, hostnames or diapazones. | You can add multiple ip addresses, hostnames or diapazones. | ||
Line 19: | Line 21: | ||
http://httpd.apache.org/docs/1.3/mod/mod_access.html#allow | http://httpd.apache.org/docs/1.3/mod/mod_access.html#allow | ||
<br><br> | |||
= By Password = | |||
Create (or Edit if exist) /var/www/html/billing/.htaccess and add following lines: | |||
AuthUserFile /var/www/html/billing/.htpasswd | |||
AuthType Basic | |||
AuthName "Password Protected Area" | |||
Require valid-user | |||
Then you have to create .htpasswd file which contains user and password: | |||
htpasswd -b -m -c /var/www/html/billing/.htpasswd yourusername newpassword | |||
omit "-c" if file already exist. | |||
<br> |
Latest revision as of 13:53, 4 August 2022
BY IP address
Create (or Edit if exist) /var/www/html/billing/.htaccess and add following lines to the most bottom of the file:
Order Deny,Allow Deny from all Allow from 127.0.0.1 friends_ip another_friends_ip
You can add multiple ip addresses, hostnames or diapazones.
Now restart apache:
/etc/init.d/httpd restart
info:
http://httpd.apache.org/docs/1.3/howto/htaccess.html
http://httpd.apache.org/docs/2.0/mod/mod_access.html#allow
http://httpd.apache.org/docs/1.3/mod/mod_access.html#allow
By Password
Create (or Edit if exist) /var/www/html/billing/.htaccess and add following lines:
AuthUserFile /var/www/html/billing/.htpasswd AuthType Basic AuthName "Password Protected Area" Require valid-user
Then you have to create .htpasswd file which contains user and password:
htpasswd -b -m -c /var/www/html/billing/.htpasswd yourusername newpassword
omit "-c" if file already exist.