Farid Ahmadian / DevOps

Apache Webserver cheat sheet

Public domain


Config file syntax check

httpd -t

Virtual host debug

httpd -S
httpd -D DUMP_VHOSTS

List Loaded Modules

httpd -D DUMP_MODULES

Apache VirtualHost

/etc/apache2/sites-enabled/test

<VirtualHost *:80>
ServerName  test.com 

DocumentRoot /home/farid/htdocs/test
<Directory /home/farid/htdocs/test>
        Options -Indexes
        # AllowOverride All      # Deprecated
        # Order Allow,Deny       # Deprecated
        # Allow from all         # Deprecated
        Require all granted    # << New way of doing it
</Directory>

</VirtualHost>

sudo a2ensite test; sudo service apache2 reload


BY: Pejman Moghadam, Farid Ahmadian
TAG: apache
DATE: 2014-04-25 00:17:29


Farid Ahmadian / DevOps [ TXT ]

With many thanks and best wishes for dear Pejman Moghadam, someone who taught me alot in linux and life :)