Still a ‘wordpress draft’, but published already.
It should bring you to an working solution.
I prefer webserver authentication above and php/coded authentication script. This because the webserver can also protect stylesheets, javascript files and, more important, images or other attachments. Within php you can only protect the called page.
Of course, in apache, you can easily use basic authentication. But then the browser shows you an ‘static’ login window. Apache2 has now an module which helps you with form authentication. You can make in now more fancy :).
Please leave comments if necessary 🙂
note… in my test setup this is compiled and running next to system default Apache2 instance.
so 2 apache-bin directories are on the system.
Downloading and extracting Apache 2.4
# cd /opt/src/ # wget http://ftp.tudelft.nl/apache/httpd/httpd-2.4.10.tar.gz # tar xf httpd-2.4.10.tar.gz # cd httpd-2.4.10/
Downloaden and extracting Apache 2.4 requirements. Check requirements here
# cd srclib
# wget http://apache.mirror.triple-it.nl/apr/apr-1.5.1.tar.gz
# wget http://apache.mirror.triple-it.nl/apr/apr-util-1.5.3.tar.gz
# tar xf apr-1.5.1.tar.gz
# tar xf apr-util-1.5.3.tar.gz
# mv apr-1.5.1 apr
# mv apr-util-1.5.3 apr-util
# cd .. (/opt/src/httpd-2.4.10/)
# apt-get install libpcre3 libpcre3-dev (if not already installed)
Configuring source tree. (option –with-ssl is optional, decide for yourself if needed)
# ./configure --prefix=/opt/apache2 --with-included-apr --with-ssl --enable-auth-form