Apache service configuration
Disclaimer: the article is applicable to the Standard Linux Shared Hosting service only, not to Linux Shared Hosting NG. Refer to the article https://kb.cloudblue.com/en/114326 for information about Linux Shared Hosting NG in POA.
The article describes the main points in the way how POA configures Apache service on Standard Linux Shared Hosting Service, the information may help in problems troubleshooting.
Apache configuration file
Apache on a POA-managed Linux Shared Hosting server does not use the default configuration file /etc/httpd/conf/httpd.conf, it uses the /usr/local/pem/etc/apache/httpd.conf_pem file which is managed by POA. Most of Apache configuration files on POA-managed hosting server are located in the /usr/local/pem/etc/apache/ folder.
When Apache starts it reads the main configration file /usr/local/pem/etc/apache/httpd.conf_pem and loads another configuration file listed in the INCLUDE directive in the main one:
The httpd.conf_pem.common file in turn loads the following files:
The /usr/local/pem/etc/apache/httpd.conf_pem.vhosts file loads configuration files of all customers' webspaces created on a server, file names are /usr/local/pem/vhosts/WEBSPACE_ID/webspace/conf/vhost.conf, where WEBSPACE_ID is the ID of a customer webspace, it may be found in POA Provider Control Panel at Service Director > Shared Hosting Manager > Websites or in Customer Control Panel on the Websites tab. E.g., the Apache configuration file in the customer's webspace #100101 is /usr/local/pem/vhosts/100101/webspace/conf/vhost.conf.
All Apache configuration files of all customers' webspaces must be listed in the /usr/local/pem/etc/apache/httpd.conf_pem.vhosts, POA creates entry in the file during new webspace creating. If vhost.conf of a particular webspace is missing in the httpd.conf_pem.vhosts Apache will not load it on start and as a result all customer's websites hosted in a webspace will not work.
Different SSL and non-SSL workers
Due to performance reasons Apache server on POA-managed hosts starts two separate sets of httpd daemons:
- for HTTP access to websites
- for HTTPS access to websites
It may be seen in the output of the 'ps' utility being run on POA-managed Linux Shared Hosting server:
# ps axf | grep httpd
4937 Ss 0:20 /usr/sbin/httpd -f /usr/local/pem/etc/apache/httpd.conf_pem
11548 S 0:00 \_ /usr/sbin/httpd -f /usr/local/pem/etc/apache/httpd.conf_pem
11559 S 0:00 \_ /usr/sbin/httpd -f /usr/local/pem/etc/apache/httpd.conf_pem
4952 Ss 0:25 /usr/sbin/httpd -DSSL_ONLY -f /usr/local/pem/etc/apache/httpd.conf_pem
11537 S 0:00 \_ /usr/sbin/httpd -DSSL_ONLY -f /usr/local/pem/etc/apache/httpd.conf_pem
11544 S 0:00 \_ /usr/sbin/httpd -DSSL_ONLY -f /usr/local/pem/etc/apache/httpd.conf_pem
The example above shows two sets of httpd processes - one with SSL_ONLY parameter (to serve HTTPS requests) and one without such parameter (to serve HTTP requests).
Apache startup script
Apache service on POA-managed Standard Linux Shared Hosting server uses non-default startup script /etc/init.d/pemhttpd, not the stock Apache startup script /etc/init.d/httpd. The pemhttpd startup script exactly says to Apache to start with non-default configuration file /usr/local/pem/etc/apache/httpd.conf_pem, not the default /etc/httpd/conf/httpd.conf file.
Do not try to stop/start Apache service using the /etc/init.d/httpd startup script on POA-managed Linux web server, it will load Apache with the default configuration file and all customers' website will not working because they are absent in the default Apache configuration file, Apache just will not load corresponding virtual hosts.
Important: keep in mind that non-default Apache startup script /etc/init.d/pemhttpd must be used only on a POA-managed Standard Linux Shared Hosting server, on a Linux Shared Hosting NG server use the default Apache startup script /etc/init.d/httpd.
See the main Knowledgebase article #115790 Website Hosting: General information, Best Practices and Troubleshooting for more information.