stellarbytes

Member
Aug 26, 2009
14
0
51
Hi

Here's my setup:

WHM 11.30.3 (build 4)
CENTOS 5.6 x86_64 standard

The problem is it appears mod_rewrite is not enabled which I badly need for an ecommerce store:

Code:
http:// cupargardencentre . com/phptest.php
I have added the following to httpd.conf:

PHP:
LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c
When I go to WHM>Restart Apache and click Yes to restart Apache, I get the following error:

Apache restart failed. Unable to load pid from pid file and no httpd process found in process list.

If apache restart reported success but it failed soon after, it may be caused by oddities with mod_ssl.

You should run /usr/local/cpanel/scripts/ssl_crt_status as part of your troubleshooting process. Pass it --help for more details.

Also be sure to examine apache's various log files.
Apache Restart Output:

Log:
[Sat Sep 10 18:34:15 2011] [notice] ModSecurity: PCRE compiled version="8.12"; loaded version="8.12 2011-01-15"
[Sat Sep 10 18:34:15 2011] [notice] ModSecurity: LIBXML compiled version="2.7.8"
[Sat Sep 10 18:34:16 2011] [notice] Apache/2.2.20 (Unix) mod_ssl/2.2.20 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 configured -- resuming normal operations
[Sat Sep 10 18:45:35 2011] [notice] caught SIGTERM, shutting down
[Sat Sep 10 18:45:37 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Sat Sep 10 18:45:37 2011] [notice] ModSecurity for Apache/2.6.0 (ModSecurity: Open Source Web Application Firewall) configured.
[Sat Sep 10 18:45:37 2011] [notice] ModSecurity: APR compiled version="1.4.5"; loaded version="1.4.5"
[Sat Sep 10 18:45:37 2011] [notice] ModSecurity: PCRE compiled version="8.12"; loaded version="8.12 2011-01-15"
[Sat Sep 10 18:45:37 2011] [notice] ModSecurity: LIBXML compiled version="2.7.8"
[Sat Sep 10 18:45:38 2011] [notice] Apache/2.2.20 (Unix) mod_ssl/2.2.20 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 configured -- resuming normal operations
[Sat Sep 10 18:46:45 2011] [notice] caught SIGTERM, shutting down
It is quite evident adding these lines to httpd.conf breaks apache, because as soon as I remove them, I can restart apache and the sites work fine.

There appears to be no 'Rewrite' module which can be built with EasyUpdate, presumably this option has been deprecated since I last installed this module a few months ago on an older version of cPanel.


Can anyone offer any pointers as to why this isn't working?

Thanks
 

stellarbytes

Member
Aug 26, 2009
14
0
51
Thank you - I had a look at the thread, when I log in as root and type:

Code:
httpd -l | grep -i rewrite
I get:

Code:
-bash: httpd: command not found
I have interpreted "httpd -l | grep -i rewrite" as "httpd -(lowecase L) PIPE grep -i rewrite" - so what is the problem? Even 'httpd -l' is not working, returning the same error?

Here is the content of httpd.conf if that helps:
-removed-

Is there something missing or broken here? Thanks

Other than this problem, the server seems to be running OK.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Sometimes the symlink for /usr/sbin/httpd doesn't exist to /usr/local/apache/bin/apachectl, so you cannot simply run that command. Try this command instead:

Code:
/usr/local/apache/bin/apachectl -l | grep -i rewrite
 

stellarbytes

Member
Aug 26, 2009
14
0
51
Are you logged in as root user?
Yes, I am logged in via SSH as the root user.

Sometimes the symlink for /usr/sbin/httpd doesn't exist to /usr/local/apache/bin/apachectl, so you cannot simply run that command. Try this command instead:

Code:
/usr/local/apache/bin/apachectl -l | grep -i rewrite
I tried the above and this time I get:
-bash: /usr/local/apache/apachectl: No such file or directory
It appears even simple command line entries don't work, citing bash 'command not found' errors, however this file definitely exists as I have browsed via FTP and located it in that exact path. I just checked for cPanel updates and upgraded to the latest Release version. Any idea where to look to solve these issues as the upgrade hasn't fixed anything in relation to these problems.

I have looked at both /usr/local/apache/logs/error_log and /usr/local/cpanel/logs/error_log and do not see anything out of the ordinary except quite a few of these, it happened six times during the night.

Code:
[Tue Sep 13 08:15:26 2011] [notice] Graceful restart requested, doing restart
Any ideas?:confused:
 
Last edited:

stellarbytes

Member
Aug 26, 2009
14
0
51
Ok I found a thread on here which says to check the $PATH location, I have done so, and here it is, I don't think this is right...

Code:
/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin
I checked all these paths:

/usr/local/jdk/bin - does NOT exist

/usr/kerberos/sbin - exists

/usr/kerberos/bin - exists

/usr/local/sbin - exists

/usr/local/bin - exists

/usr/sbin - does NOT exist, but /usr/local/sbin/ does - is this correct?

Any ideas?
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
The command you tried wasn't the right command. You tried this path:

-bash: /usr/local/apache/apachectl: No such file or directory
I told you this path:

/usr/local/apache/bin/apachectl -l | grep -i rewrite
There is a bin in the path I provided. If the correct command isn't used, the output will error out. It would not be that simple commands do not work, it is that the right command must be entered.
 

stellarbytes

Member
Aug 26, 2009
14
0
51
Yep, you were right, I missed the 'bin' out. I have run this in SSH and it reports back:

mod_rewrite.c

Not sure what this means, but mod_rewrite definitely does not seem to be working. When I enable the SEO module in my shopping cart, it reports that mod_rewrite cannot be found on the server and is not installed. Support say it's not a problem with the software but a problem with mod_rewrite on my server. ARGH!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
This means that mod_rewrite is enabled, which was going to be the outcome as it is default installed.

Please provide the exact error you receive when you enable the SEO module on your shopping cart. You likely have the wrong file permissions on the files needed to run the module or are using rewrite rules that aren't supported by the server type.