httpd_logo_wide.gif

Reference

How to install

Debian based

apt-get install apache2
/etc/init.d/apache2 start

Redhat based

yum install httpd
/etc/init.d/httpd start

How to run on Mac OS X only locally

See here.

Permit an access only from the localhost

diff httpd.conf httpd.conf.org

40c40
< Listen 127.0.0.1:8080
---
> Listen 80

Authentication with user name & password

Make password file:

cd path_to_password_file_dir
htpasswd -c filename username

Edit the configuration file:

cd /etc/httpd/conf
emacs -nw httpd.conf
<Directory "/var/www/html">
    AllowOverride AuthConfig
    AuthName "Enter username and password"
    AuthType Basic
    AuthUserFile path_to_password_file_dir/filename
    AuthGroupFile /dev/null
    require valid-user
</Directory>

Then

/etc/init.d/httpd restart

Tips

How Not to display "File does not exist: /var/www/favicon.ico"

Redirect 404 /favicon.ico
<Location /favicon.ico>
 ErrorDocument 404 "No favicon
< /Location>