Notes to Self

Alex Sokolsky's Notes on Computers and Programming

Apache on CENTOS

Apache Install

sudo yum install httpd

Apache Customization

To start service:

sudo systemctl start httpd

To ensure httpd starts on power-up:

sudo systemctl enable httpd

Check status:

sudo systemctl status httpd

Modify firewal to allow for incoming HTTP and HTTPS:

sudo firewall-cmd ––permanent ––add-port=80/tcp
sudo firewall-cmd ––permanent ––add-port=443/tcp
sudo firewall-cmd ––reload

Each virtual host has a separate conf file in /etc/httpd/conf.d/. Logs are in /var/www/html in a separate folders.


After reconfig do not forget:

httpd -t
sudo systemctl restart httpd

Apache status: http://localhost/server-status?refresh=2

Apache performance optimization:

To gracefully restart Apache:

apache2ctl -k graceful