Article ID: 116651, created on Aug 6, 2013, last review on Aug 12, 2014

  • Applies to:
  • Operations Automation 5.4

Symptoms

A customer subscribed to the Linux Shared Hosting NG service, created a website in the NG webspace and installed an APS application into it, e.g., WordPress. Any request containing cgi|pl|py|rb leads to the HTTP 404 "Page not found" error in the browser and a truncated entry appears in the Apache log of the website at this time.

For example, if WordPress is installed on the customer.com domain, then the problem may appear when opening a URL like http://customer.com/plugin.html or http://customer.com/plugins.php (the pl letters are present in the URLs).

The Apache log in this case may contain an entry like this:

[error] [client 192.168.1.1] script not found or unable to stat: /var/www/vhosts/1/100101/webspace/siteapps/WordPress-4744/htdocs/pl

The files that cannot be opened in the browser are present in the customer's webspace, and they have the proper permissions.

Resolution

Upgrade POA to version 5.4.11 or 5.5 to resolve the problem.

In the meantime, the problem may be resolved by a manual update of the aliases field in the v_apache_h2e_websites table in the NG Configuration Database for broken webspaces.

Here is an example of a broken record in the NG Configuration Database for the webspace #100611:

SELECT webspace_id, aliases FROM v_apache_h2e_websites WHERE aliases LIKE '%SCRIPTALIASMATCH%' AND webspace_id = 100611;
 webspace_id |                                            aliases
-------------+------------------------------------------------------------------------------------------------
      100611 | SCRIPTALIASMATCH ^/siteapps/(.*.(cgi|pl|py|rb)) /var/www/vhosts/1/100611/webspace/siteapps/$1
ALIASMATCH ^/siteapps/(.*) /var/www/vhosts/1/100611/webspace/siteapps/$1
ALIAS /webstat/ /var/www/vhosts/1/100611/webspace/webstat/
ALIAS /webstatssl/ /var/www/vhosts/1/100611/webspace/webstatssl/
ALIAS /ftp_stat/ /var/www/vhosts/1/100611/webspace/ftp_stat/
SCRIPTALIAS /cgi-bin/ /var/www/vhosts/1/100611/webspace/cgi-bin/
SCRIPTALIAS /cgi-php4/ /var/www/cgi-bin/php4/
SCRIPTALIAS /cgi-php5/ /var/www/cgi-bin/php5/
SCRIPTALIAS /cgi-sw-engine/ /var/www/cgi-bin/sw-engine/
ALIAS /error_docs/ /var/www/vhosts/1/100611/webspace/error_docs/

And here is the correct record:

SELECT webspace_id, aliases FROM v_apache_h2e_websites WHERE aliases LIKE '%SCRIPTALIASMATCH%' AND webspace_id = 100062;
 webspace_id |                                            aliases
-------------+------------------------------------------------------------------------------------------------
      100062 | SCRIPTALIASMATCH ^/siteapps/(.*\.(cgi|pl|py|rb)) /var/www/vhosts/1/100062/webspace/siteapps/$1
ALIASMATCH ^/siteapps/(.*) /var/www/vhosts/1/100062/webspace/siteapps/$1
ALIAS /webstat/ /var/www/vhosts/1/100062/webspace/webstat/
ALIAS /webstatssl/ /var/www/vhosts/1/100062/webspace/webstatssl/
ALIAS /ftp_stat/ /var/www/vhosts/1/100062/webspace/ftp_stat/
SCRIPTALIAS /cgi-bin/ /var/www/vhosts/1/100062/webspace/cgi-bin/
SCRIPTALIAS /cgi-php4/ /var/www/cgi-bin/php4/
SCRIPTALIAS /cgi-php5/ /var/www/cgi-bin/php5/
SCRIPTALIAS /cgi-sw-engine/ /var/www/cgi-bin/sw-engine/
ALIAS /error_docs/ /var/www/vhosts/1/100062/webspace/error_docs/

Attention: Be extremely careful when updating NG Configuration Database; createa fresh backup of the database before updating.

Cause

The problem is caused by an unescaped dot (.) character in the SCRIPTALIASMATCH directive in the Apache configuration file of the problem website.

The following directive is generated mistakenly by POA:

SCRIPTALIASMATCH ^/siteapps/(.*.(cgi|pl|py|rb)) /var/www/vhosts/1/100101/webspace/siteapps/$1

The second '.' character is not escaped in the directive above. The correct directive is as follows:

SCRIPTALIASMATCH ^/siteapps/(.*\.(cgi|pl|py|rb)) /usr/local/pem/vhosts/100101/webspace/siteapps/$1

Search Words

wordpress

HTTP 404 error

ac82ce33439a9c1feec4ff4f2f638899 caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae 2554725ed606193dd9bbce21365bed4e e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF