LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   httpd mod_securiry generating 400 bad request error (https://www.linuxquestions.org/questions/linux-newbie-8/httpd-mod_securiry-generating-400-bad-request-error-622336/)

lcornea 02-19-2008 04:41 PM

httpd mod_securiry generating 400 bad request error
 
Hi
I ran into a small problem today, i just finished installing Fedora Core 8 OS, and started the httpd using:
service httpd start

This worked ok, but when i tried to navigate to my page using 127.0.0.1 i got the 400 bad request error. At first i thought that the server was not started but then realized that it could not return that error if it wasn't active. After searching the web and forums for a solution and found none apropiate one i thought that i could just reinstall it. So i went ahead and done this:
yum remove httpd
........
Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
httpd x86_64 2.2.8-1.fc8 installed 2.6 M
Removing for dependencies:
BackupPC noarch 3.1.0-1.fc8 installed 2.2 M
gnome-user-share x86_64 0.11-9.fc8 installed 120 k
httpd-manual x86_64 2.2.8-1.fc8 installed 3.4 M
mod_fcgid x86_64 2.2-3.fc8 installed 126 k
mod_perl x86_64 2.0.3-14 installed 6.3 M
mod_python x86_64 3.3.1-5 installed 1.5 M
mod_security x86_64 2.1.5-1.fc8 installed 3.5 M
mod_ssl x86_64 1:2.2.8-1.fc8 installed 175 k
php x86_64 5.2.4-3 installed 3.6 M
webalizer x86_64 2.01_10-34 installed 260 k

Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 11 Package(s)


After all of this i used yum to reinstall all of them back. After just installing httpd and php i tried the server, and it showed my page just fine. After I finished installing all of them back, i got the same error.

Restarted the whole process and stopped after each package to see witch was cosing the problem(stoping the httpd before install and starting it after). So i installed in this order
httpd
httpd-manual
php
mod_ssl
mod_security

Right after installing the mod_security, the server started giving the 400 error. So i removed it, and i restarted the httpd. It works now.

Any sugestions about how to get mod_security to work?

Thank you for your time.

unSpawn 02-19-2008 05:48 PM

Reinstalling software is a Playstation-like OS (aka POS) reflex, shouldn't need that with GNU/Linux. Apache comes with a test switch to check if the config is OK. Next place to look are the logs. Mod_security might need some config tweaking.

lcornea 02-20-2008 05:52 AM

Quote:

Originally Posted by unSpawn (Post 3063086)
Reinstalling software is a Playstation-like OS (aka POS) reflex, shouldn't need that with GNU/Linux. Apache comes with a test switch to check if the config is OK. Next place to look are the logs. Mod_security might need some config tweaking.

Of course it is, but i have no idea on how to configure Apache,or where the config files are, or log files.
So i was kind of thinking that someone might help me do that, so i posted all the information i could on the matter.
Thank you again for your time.

unSpawn 02-20-2008 08:40 AM

Quote:

Originally Posted by lcornea (Post 3063556)
i have no idea on how to configure Apache,or where the config files are, or log files.

There's lots of tutorials on setting up Apache, shouldn't be hard to find. To find the config file depends on how you want to look: '(s)locate httpd.conf' or 'rpm -ql httpd|grep conf' or 'rpm -ql httpd|grep 'etc/''. To find the logfiles depends on how you want to look as well. You could read your httpd.conf or 'rpm -ql httpd|grep /var/log' or get the info from the running process. Use 'pidof' or (better) 'pgrep' to get the process ID, then 'lsof' to find which logs it's got open knowing most logs will reside somewhere in /var): 'pgrep -f httpd|xargs -iP lsof +D/var/log -a -p 'P''. All that CLI stuff may seem a bit like dark magic but you'll get the hang of it soon enough.

saadsaidi 02-28-2008 08:40 AM

Re: HTTPD 400 bad request
 
Hello There,
I faced that problem. simply go and update httpd
by going to konsole: $> yum update httpd (Fedora in my case)

this will update all the modules in addition to apache.

Hopfully this will help you too.


regards


All times are GMT -5. The time now is 04:57 PM.