You are running an insecure apache setup. (Merged)

tutt

Well-Known Member
PartnerNOC
Apr 16, 2003
46
0
156
Worked fine to upgrade to 4.4.2 on most servers for me, but one server in particular, running CentOS 3.6 has major problems with Apache modules now.

service httpd restart:

/etc/init.d/httpd restart: httpd not running, trying to start
Syntax error on line 2 of /usr/local/apache/conf/httpd.conf:
Invalid command 'Alias', perhaps mis-spelled or defined by a module not included in the server configuration

If I comment that out, I get:

/etc/init.d/httpd restart: httpd not running, trying to start
Syntax error on line 227 of /usr/local/apache/conf/httpd.conf:
Cannot add module via name 'mod_env.c': not in list of loaded modules
/etc/init.d/httpd restart: httpd could not be started

If I comment that out, it goes down the list of AddModules with each one failing.

I have rebuilt apache loading config defaults, not skipping Apache build if it is the latest version, etc several times and same deal. HELP!!!
 

ddmobley

Member
May 13, 2006
24
0
151
caesar1_caesar1 said:
PHP files have become downloadable !
See the post above:

"We have had a number of clients attempt to upgrade to PHP 5.1.4 as a result of this, and things didn't look too good afterwards When downgrading to PHP 4.4.2, note that cPanel doesn't always seem to re-enable the mod_php4 module in the Apache configuration file (/usr/local/apache/conf/httpd.conf), and as a result you may need to edit this file to uncomment the relevant lines to fix things. If this happens, you'll know because all PHP files become downloadable, as they are no longer parsed."
 

rustelekom

Well-Known Member
PartnerNOC
Nov 13, 2003
290
0
166
moscow
it's only your choise - use php 5.xxx or 4.xxx on servers, but to whom who have a problem with php 5.xxx compilling i can recommend:

1) run /scripts/easyapache
2) select option which you need
3) when easyapache begin configure your php, copy and save somewhere ./configure string
4) when compiling will finished without success go to:

cd /home/cpapachebuild/buildapache
rm -rf php[version number] folder
tar zxf php-[version number].tar.gz
cd php[version number] folder

remove from backed .configure sring two option:

--with-mysqli
--with-versioning

and run ./configure (with options string)
make
make install
 

KualoCraig

Member
PartnerNOC
Oct 22, 2002
20
0
151
caesar1_caesar1 said:
PHP files have become downloadable !

...

I'd be so grateful if you tell me what to edit in (/usr/local/apache/conf/httpd.conf)
It is a large file and I don't know what to do there.
As mentioned, please see my post above. The lines in question that have found themselves commented out by cPanel are:

LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c

Once you have uncommented these lines in the httpd.conf file, restart Apache:

httpd restart

Craig.
 
Oct 5, 2005
20
0
151
ddmobley said:
See the post above:

"We have had a number of clients attempt to upgrade to PHP 5.1.4 as a result of this, and things didn't look too good afterwards When downgrading to PHP 4.4.2, note that cPanel doesn't always seem to re-enable the mod_php4 module in the Apache configuration file (/usr/local/apache/conf/httpd.conf), and as a result you may need to edit this file to uncomment the relevant lines to fix things. If this happens, you'll know because all PHP files become downloadable, as they are no longer parsed."
Thanks ddmobley,

I'd be so grateful if you tell me what to edit in (/usr/local/apache/conf/httpd.conf)
It is a large file and I don't know what to do there.

Regads
 

KualoCraig

Member
PartnerNOC
Oct 22, 2002
20
0
151
caesar1_caesar1 said:
I'd be so grateful if you tell me what to edit in (/usr/local/apache/conf/httpd.conf)
It is a large file and I don't know what to do there.
Please see my response on the previous page, posted just before you asked :)

Craig.
 

RobM

Active Member
Aug 15, 2003
43
0
156
it did not update on 1 server.

Building Apache Config.....Done
Downloading and compiling apache+modules....

Verifying archive integrity... All good.
Uncompressing buildapache.........................................................................................................................................................
Verifying compiler and libs....Verifying installation....Using newyum support...
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Parsing package install arguments
Nothing to do
Using newyum support...
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Parsing package install arguments
Nothing to do
Done
Done
********************************
This is buildapache version 10.8.6r4 (ap=1.3.36)
********************************
buildapache configured from Web Host Manager
Apache configured from Web Host Manager!
/etc/rc.d/init.d/httpd start: httpd started
Setting /home permissions to 0711......Done
Setting permissions for.....xxxx.xxxxx.xxxxxx.....Done
initfpsuexec: using apache 1.x support

Attempting to restart httpd

goes and restarts it, but does not fix the problem.... :eek:

worked fine on the other centos boxes, except 1...
 

t9clkclnr

Well-Known Member
Jun 11, 2004
254
0
166
Southern California
i've followed suggestions and no go

apache is down and won't come back. ok, just waiting for the phone calls to start now.

anyone have any other ideas on how to get apache to restart?
 

RobM

Active Member
Aug 15, 2003
43
0
156
t9clkclnr said:
apache is down and won't come back. ok, just waiting for the phone calls to start now.

anyone have any other ideas on how to get apache to restart?
install it again, just had that problem and did another install and it came back up.
 

mctDarren

Well-Known Member
Jan 6, 2004
665
9
168
New Jersey
cPanel Access Level
Root Administrator
Weird, dunno if this is related or not - went to run easyapache on email from a trusted admin and my ISP lost connection. When it came back up, logged in SSH again, ran easyapache and get these messages stating 'Undefined argument in option spec'... apache wont compile OR reinstall now... yikes! Removed apachebuild dir and sea file and still no go. Anyone help? Appreciate it.
 

Daemon1

Well-Known Member
Nov 26, 2003
87
0
156
I am getting this error aswell, I have tried both update methods as suggested for Apache and nothing has changed it says it's still out of date? It's saying my front page is out of date aswell... whats going on?
 

Daemon1

Well-Known Member
Nov 26, 2003
87
0
156
I ran the update which supposidly installs the latest PHP 4.4.2 but it's not doing anything!
 

mctDarren

Well-Known Member
Jan 6, 2004
665
9
168
New Jersey
cPanel Access Level
Root Administrator
In my error log only thing I see as bad is 'Child 23118 returned a Fatal error... \nApache is exiting!'... weird!

[edit] and my httpd.conf file is a big goose egg. empty![/empty]
 
Last edited:

eth00

Well-Known Member
PartnerNOC
Mar 30, 2003
721
1
168
NC
cPanel Access Level
Root Administrator
webtiva said:
In my error log only thing I see as bad is 'Child 23118 returned a Fatal error... \nApache is exiting!'... weird!

[edit] and my httpd.conf file is a big goose egg. empty![/empty]
You should have a backup left in /usr/local/apache/conf/

As far as getting it online some people have had sucess with recompiling with easyapache. I found another way was to source compile everything.
 

eth00

Well-Known Member
PartnerNOC
Mar 30, 2003
721
1
168
NC
cPanel Access Level
Root Administrator
jamesbond said:
Can't we just download and install the latest frontpage server extensions without rebuilding apache by running /scripts/fpupgrade ? Did anyone try this?

Also I don't understand why it shows 4.4.2 as vulnerable...I can't upgrade to php5 (compatibility reasons)

4.4.3 will be out next week probably (read here http://groups.google.com/group/mailing.www.php-dev/browse_thread/thread/6f421065c8ec7f6b/ )

The scripts may work, I was having trouble earlier with it. I was able to just install the rpm manually from http://layer1.cpanel.net/fp/ and it worked.

Regarding php-4.4.2 it is fine and once you upgrade frontpage it will no longer show as vulnerable
 

HappymanUK

Well-Known Member
May 3, 2003
255
1
168
After running the update on Apache (that you are warned about in WHM), I am now unable to connect to MySQL databases.

When trying to access part of my site I get the following error:

Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/sitename/public_html/Connections/siteinfo.php on line 9

Fatal error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/sitename/public_html/Connections/siteinfo.php on line 9

If I try stopping MySQL, I get the following error:

root@server [/]# /etc/rc.d/init.d/mysql stop
No mysqld pid file found. Looked for /var/lib/mysql/server.rhdns.com.pid.

My daily logs are showing:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!



Does anyone have any ideas what I can do, as my site is effectively down at the moment ?


Thanks in advance,
Daniel
 
Last edited:

Radio_Head

Well-Known Member
Verifed Vendor
Feb 15, 2002
2,048
1
343
impossible to update to 5.1.4 using easyapache . Or php file are downloaded , or it shows a blank page , or I have mutiple copies of php and only 4.4.2 works , or other problems ...
nothing to do from months , impossible to install 5.x using easypache on all my servers.
If you want peace of mind , I strongly suggest to avoid an update to 5.1.4 using easypache .

The upgrade to 4.4.2 went fine (using easypache)