Apache 101
File Location
Debian:
Global server configuration location: /etc/apache2/apache2.conf
Other configuration files included in the global configuration: - module loading (for more details on module handling on Debian you might check this post: Managing Apache2 Modules the Debian Way):
/etc/apache2/mods-enabled/*.load /etc/apache2/mods-enabled/*.conf
- vhosts loading:
/etc/apache2/sites-enabled/[\^.#]*
- other local configurations (added manually or by other packages):
/etc/apache2/conf.d/[\^.#]*
- listening port:
/etc/apache2/ports.conf
- other user configurations:
/etc/apache2/httpd.conf
Running as: www-data (user) www-data (group)
Binary file: apache2 (/usr/sbin/apache2)
RHEL / Fedora / Centos:
Global server configuration location: /etc/httpd/conf/httpd.conf
Other configuration files included in the global configuration:
- various module configurations:
/etc/httpd/conf/conf.d/*.conf
Running as: apache (user) apache (group)
Binary file: httpd (/usr/sbin/httpd)
Commands
Restart Now
apachectl -k restart
Stop Now
apachectl -k stop
Graceful Restart
apachectl -k graceful
Graceful Stop
apachectl -k graceful-stop
Virtual Host
<VirtualHost *:80>
ServerName mydomain.localhost
DocumentRoot /var/www/html/mydomain/public
<Directory "/var/www/html/mydomain/public">
AllowOverride All
</Directory>
</VirtualHost>