Post

Apache command cheatsheet

Find DB Version

1
mariadb --version
1
mysql --version

When your running your own lamp on vps having a cheatsheet like this for Apache may come in handy. Especially when the rubber hits the road.

Stop your web server

1
sudo systemctl stop apache2

Start the web server when it is stopped, type:

1
sudo systemctl start apache2

Stop and then start the service again, type:

1
sudo systemctl restart apache2

Reload without dropping connections.

1
sudo systemctl reload apache2

Re-enable the service to start up at boot, type:

1
sudo systemctl enable apache2

Enable the file with the a2ensite tool:

1
sudo a2ensite your_domain.conf

Disable the default site defined in 000-default.conf:

1
sudo a2dissite 000-default.conf

Test for configuration errors:

1
sudo apache2ctl configtest

REBOOT reboot a server from the command line, run:

1
sudo shutdown -r now

By default, Apache is configured to start automatically when the server boots. If this is not what you want, disable this behavior by typing:

1
sudo systemctl disable apache2

Query the state of apache processes

1
sudo systemctl status apache2.service -l --no-pager

Check apache for config errors

1
sudo apachectl configtest

Search apache error log

This will only search 2 lines

1
sudo tail -n 2 /var/log/apache2/error.log

View apache error log

1
vim /var/log/apache2/error.log
This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.