Because osCommerce doesn’t provide system configuration for admin folder access, I followed this procedure written here by a nice guy.

You can set it up like this:

Enable a couple of modules:


cd /etc/apache2/mods-enabled
ln -s /etc/apache2/mods-available/ssl.conf ssl.conf
ln -s /etc/apache2/mods-available/ssl.load ssl.load
ln -s /etc/apache2/mods-available/rewrite.load rewrite.load
ln -s /etc/apache2/mods-available/suexec.load suexec.load
ln -s /etc/apache2/mods-available/include.load include.load

Create a password file in a directory outside /www:


cd /usr/bin
htpasswd -c /home/rogopag/var/passwords rogopag

Set the directory to secure in httpd.conf, inside a directory tag:


<DIRECTORY>
AllowOverride AuthConfig
AuthName "Novamerx"
AuthType Basic
AuthUserFile /home/rogopag/var/passwords
AuthGroupFile /dev/null
require user rogopag
</DIRECTORY>

Comment out these lines in the .htacces file of the directory to protect:


# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
#<ifmodule mod_setenvif.c>
# <ifdefine SSL>
# SetEnvIf User-Agent ".*MSIE.*" \
# nokeepalive ssl-unclean-shutdown \
# downgrade-1.0 force-response-1.0
# </ifdefine>
#</ifmodule>

Restart Apache:

/etc/init.d/apache2 restart