Introduction
Apache is a first class web server. This file outlines some maintenance operations for local Mac usage and Ubuntu.
Configuration file
$ cd /etc/apache2
$ nano apache2.conf
$ nano httpd.conf
# Include generic snippets of statements
Include conf.d/
# Include the virtual host configurations:
Include sites-enabled/
If problems arise try remove sites from the config to eliminate bugs in scripts
MPM configuration
List compiled in modules
$ apache2 -l
Check for the prefork.c module to know what section of the configuration to modify
Server maintenance
Change user to root sudo -s
Usage: service < option > | –status-all | [ service_name [ command | –full-restart ] ] |
$ sudo service apache2 restart
scp ~/.ssh/rackspace/id_rsa.pub [email protected]
http://cbracco.me/ssh-keys/ ssh-add -K ~/.ssh/rackspace/id_rsa
Log files
Log files by standard are stored in this
$ cd /var/log/apache2
View the last 100 entries of a log file
$ tail -100 /var/log/apache2/access.log
$ tail -100 /var/log/apache2/error.log
Log file removal
$ df -h
$ du -hs
$ du -a /var | sort -n -r | head -n 100
$ cd "/var/www/storage/logs"
$ sudo rm -vi /var/www/storage/logs/*
$ rm -vi /var/log/apache2/*ls -al
$ find . -name "*.gz" -type f
$ find . -name "*.gz" -type f -delete
https://www.a2hosting.com/kb/developer-corner/apache-web-server/viewing-apache-log-files
Common errors
child process XXX still did not exit
http://stackoverflow.com/questions/19891440/django-mod-wsgi-apache2-child-process-xxx-still-did-not-exit-sending-a-si
Usage: service < option > | –status-all | [ service_name [ command | –full-restart ] ] iwarner@WebServer:~$ sudo apache2ctl –help Usage: /usr/sbin/apache2ctl start|stop|restart|graceful|graceful-stop|configtest|status|fullstatus|help /usr/sbin/apache2ctl