Find what MPM model Apache is using

Apache is the most popular web server, it is Open Source and modular. Multi-Processing Modules (MPM) in Apache decides how Apache listens to the network and handles the incoming requests. Apache have many MPM Modules (Multi-Processing Modules), the most popular among them are Prefork, worker, and Event. You can only activate one Apache MPM at … Read more

Apache Auto Renew SSL on Password Protected site

I have a web site that is password protected using Apache basic autenticiation. I used following code in Apache config to password protect. AuthType Basic AuthName “Restricted Content” AuthUserFile /etc/apache2/demo-sok-htpaswd Require valid-user The problem is when SSL need auto renew, it need url like http://domain/.well-known/ to be accessable with out any password for domain ownership … Read more

Apache disable directory index

apache directory index

When Apache Directory Index is enabled, if you browse to a url that have no index file present, you will see list of all files. This is not good for securiy as hackers can see all files present in the directory. One way to disable this directory listing is create a file with name index.html … Read more

Change Apache User in Ubuntu

On Ubuntu/Debian server, apache run as user www-data. When you install Apache web server on your local computer for developement purpose, it may be easier to run Apache as your user. If you run Apache as www-data user, you will need to chmod folders 777 for yoru web application to write to a folder like … Read more

apachectl status www-browser not found

apachectl status

On a Ubuntu server, run i run apachectl status, i get following error. root@server:~# apachectl status /usr/sbin/apachectl: 113: /usr/sbin/apachectl: www-browser: not found ‘www-browser -dump http://localhost:80/server-status’ failed. Maybe you need to install a package providing www-browser or you need to adjust the APACHE_LYNX variable in /etc/apache2/envvars root@server:~# To fix error, install lynx text based browser. apt … Read more

Password Protect Site using htaccess

To password protect a web site or a sub folder using .htaccess, create a .htaccess file in the folder. vi .htaccess Add following content AuthType Basic AuthName “Restricted Content” AuthUserFile /etc/apache2/site-logins Require valid-user In this case, i used /etc/apache2/site-logins as AuthUserFile, this will store all user and password. You can change this file path to … Read more