kevinlinxp
12/31/2016 - 5:36 AM

Apache,Httpd

Apache,Httpd

Production Server
-----------------------------------
#NameVirtualHost *:80

<Directory "/var/www/commubuy_au">
    AllowOverride All
</Directory>

<VirtualHost *:80>
    DocumentRoot "/var/www/commubuy_au"
    ServerName commubuy.com.au
    ServerAlias www.commubuy.com.au
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot "/var/www/commubuy_au"
    ServerName commubuy.com.au
    ServerAlias www.commubuy.com.au
    SSLEngine on
    SSLProtocol all
    SSLCertificateFile /etc/httpd/ssl/www.commubuy.com.au.crt
    SSLCertificateKeyFile /etc/httpd/ssl/www.commubuy.com.au.key
    SSLCACertificateFile /etc/httpd/ssl/intermediate.rsa.sha-2.sha-1root.crt
</VirtualHost>


Development Server
-----------------------------------
#NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "/var/www/redirect"
    ServerName tbmango.com
    ServerAlias www.tbmango.com
</VirtualHost>

<Directory "/var/www/textbookmango">
    AllowOverride All
</Directory>

<VirtualHost *:80>
    DocumentRoot "/var/www/textbookmango"
    ServerName tbmango.com
    ServerAlias dev.textbookmango.tbmango.com
</VirtualHost>

<Directory "/var/www/commubuy_au">
    AllowOverride All
</Directory>

<VirtualHost *:80>
    DocumentRoot "/var/www/commubuy_au"
    ServerName tbmango.com
    ServerAlias dev.commubuy.au.tbmango.com
</VirtualHost>
# CentOS
sudo systemctl status|start|restart|stop|enable <serviceName> (7+, https.service, mariadb.service, ...)

httpd -V | grep "HTTPD_ROOT" #"SERVER_ROOT" in "phpInfo();"

# OSX
sudo apachectl restart
sudo apachectl -k restart

Log locations

  • RHEL / Red Hat / CentOS / Fedora Linux Apache error file location - /var/log/httpd/error_log
  • Debian / Ubuntu Linux Apache error log file location - /var/log/apache2/error.log
  • FreeBSD Apache error log file location - /var/log/httpd-error.log

To find exact apache log file location, you can use grep command:

$ grep ErrorLog /usr/local/etc/apache2/httpd.conf
$ grep ErrorLog /etc/apache2/apache2.conf
$ grep ErrorLog /etc/httpd/conf/httpd.conf