Article ID: 115801, created on Mar 24, 2013, last review on Jan 17, 2015

  • Applies to:
  • Operations Automation

Troubleshooting Apache web service


Common problems with Apache web hosting services are as follows:

  • Failed/pending tasks POA tasks - Apache configuration files were not updated properly
  • Services not started - websites are not accessible
  • Firewall configuration - websites are not accessible
  • DNS resolution - website is not accessible
 
If all customers' websites hosted on a particular POA-managed Linux server are not available perform the following steps to troubleshoot the problem:

  • Log into the server by SSH as root
  • Check if Apache service is up and running: # service pemhttpd status
  • Start Apache service if it is down: # service pemhttpd start
  • Check if httpd processes are running: #ps axf | grep httpd
  • Make sure that httpd processes are running with the correct configuration file /usr/local/pem/etc/apache/httpd.conf_pem, you may see it in the list of processes, e.g. in the example below Apache is started with correct configuration file:
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

 
In the following example httpd processes are running with the default Apache configuration file (the stock Apache startup script was used) and in this case all POA-provisioned customers' websites do not work:
12472 ?        Ss     0:00 /usr/sbin/httpd
12474 ?        S      0:00  \_ /usr/sbin/httpd


If you see that Apache is running with incorrect configuration file then follow the steps below to solve the problem:
  • Stop Apache using stock startup script: # /etc/init.d/httpd stop
  • Start Apache using POA startup script: # /etc/init.d/pemhttpd stop

If Apache service does not start:

  • Analyze error messages shown on console by the startup script and react properly.
  • Analyze the /var/log/httpd_error_log file for error messages.

Make sure that the ports 80 (HTTP) and 443 (HTTPS) are being listened to by httpd processes, use the netstat utility to do that:
# netstat -antp | egrep ':80|:443'
tcp        0      0 :::443                      :::*                        LISTEN      12522/httpd
tcp        0      0 :::80                       :::*                        LISTEN      12507/httpd

Check firewall rules in datacenter and make sure that ports 80 and 443 are accessible from the Internet for all POA-managed Linux Shared Hosting servers where customers' websites are hosted. Refer to the PA Firewall Configuration Guide for the recommended settings - http://download.pa.parallels.com/poa/5.4/doc/63161.htm.
 
If a particular customer's website does not work check its configuration file for mistakes and log file for error messages:
/usr/local/pem/vhosts/WEBSPACE_ID/webspace/conf/vhost.conf
/usr/local/pem/vhosts/WEBSPACE_ID/log/error_log

Make sure that hostname of a website resolves to IP address which belongs to the right POA-managed server to exclude DNS-related problems.

Make sure the status of website in POA Customer Control Panel is In Sync. Otherwise, check pending and failed tasks in POA Task Manager related to the customer's subscription - filter tasks by subscription ID. Pay special attention to the following tasks, they perform configuration of Apache for newly created website:
Preparing document root and website structure for domain service
Dump config image for domain service

If you found failed/unprocessed tasks related to the customer subscription resolve problems with them and process tasks.
 
Make sure that virtual host for the problem website is present in the configuration file in customer's webspace - /usr/local/pem/vhosts/WEBSPACE_ID/webspace/conf/vhost.conf, it must have the <VIRTUALHOST> section where website is defined in the SERVERNAME directive, like in the example below for the customer.com website:
<VIRTUALHOST 10.39.83.101:443 10.39.93.101:443>
        SERVERNAME customer.com
        DOCUMENTROOT "/usr/local/pem/vhosts/100975/webspace/httpsdocs"
...
</VIRTUALHOST>

If a particular website is absent in the vhost.conf file then check failed/pending tasks in POA Task Manager related to the problem subscription (filter tasks by subscription ID). Troubleshoot and process all found tasks related to the problem subscription.
 
Make sure that the vhost.conf of the problem customer's webspace is being loaded by Apache, the corresponding entry like below must be present in the /usr/local/pem/etc/apache/httpd.conf_pem.vhosts file:
INCLUDE /usr/local/pem/vhosts/WEBSPACE_ID/webspace/conf/vhost.conf
where WEBSPACE_ID is the ID of a customer webspace.

If the problem vhost.conf is absent in the httpd.conf_pem.vhosts file then add it manually and restart Apache service: # /etc/init.d/pemhttpd restart
 
Check permissions/ownership on webspace files/folders in accordance with the Knowledgebase article Apache webspace structure.


See the main Knowledgebase article #115790 Website Hosting: General information, Best Practices and Troubleshooting for more information.

caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF