Apache
Apache
Appache is the web server software I use to host all of the websites I developed.
Common commands:
sudo /etc/init.d/apache2 reload sudo /etc/init.d/apache2 force-reload sudo /etc/init.d/apache2 restart
Password protect a directory
In Ubuntu, Apache's password file is: /etc/apache2/passwd/passwords
Use either one of the following commands to create user-password pair.
htpasswd -c /etc/apache2/passwd/passwords support htpasswd /usr/local/apache/passwd/passwords support
Add the following content so that Apache will read those configuration when it is started.
In Ubuntu, it can be put in the file: /etc/apache2/httpd.conf
<Directory /var/www/xxx/yyy> AuthType Basic AuthName "Restricted Files" AuthUserFile /etc/apache2/passwd/passwords Require user support </Directory>