Skip to content

Apache configuration on Raspberry Pi Linux machine

Vaibhav Pujari edited this page Jun 18, 2013 · 1 revision

Finding location of config file

Execute $ ps -ef | grep apache

It should give a list like following

deploy@cmd01:/$ ps -ef | grep apache
root      4053     1  0 06:26 ?        00:00:04 /usr/sbin/apache2 -k start
www       5189  4053  0 11:00 ?        00:00:00 /usr/sbin/apache2 -k start
www       5199  4053  0 11:00 ?        00:00:00 /usr/sbin/apache2 -k start
...

Then simply run

$ /usr/sbin/apache2 -V

Server compiled with....
 -D SERVER_CONFIG_FILE="apache2.conf"

Turning on rewrite mod for apache

  1. Locate mod_rewrite.so It will found in “/usr/lib/apache2/modules”

  2. New apache follow some folders to enable and disable mods. So now do this:

cd /etc/apache2/mods-enabled
touch rewrite.load
vim rewrite.load
  1. Now paste this following line

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Then edit /etc/apache2/sites-available/default or /etc/apache2/sites-available/000-default (check which one available on your system)

Find the following

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

and change it to

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
  1. Restart Apache
/etc/init.d/apache2 restart
or
service apache2 restart
Clone this wiki locally