LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-19-2008, 04:41 PM   #1
lcornea
LQ Newbie
 
Registered: Dec 2005
Location: Onesti Romania
Distribution: fedor core 4
Posts: 24

Rep: Reputation: 15
Question 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.
 
Old 02-19-2008, 05:48 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,112
Blog Entries: 54

Rep: Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784
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.
 
Old 02-20-2008, 05:52 AM   #3
lcornea
LQ Newbie
 
Registered: Dec 2005
Location: Onesti Romania
Distribution: fedor core 4
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
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.
 
Old 02-20-2008, 08:40 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,112
Blog Entries: 54

Rep: Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784Reputation: 2784
Quote:
Originally Posted by lcornea View Post
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.
 
Old 02-28-2008, 08:40 AM   #5
saadsaidi
LQ Newbie
 
Registered: Feb 2008
Posts: 1

Rep: Reputation: 0
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
 
  


Reply

Tags
modsecurity


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm getting an error 400 (Bad Request) jim.thornton Linux - Server 1 01-19-2008 11:42 PM
Suse CUPS error: cups(File)DoRequest error:client-error-bad-request smdonelan Linux - Hardware 6 04-17-2007 06:46 PM
Squid WPAD proxy getting TCP_DENIED/400 Invalid-request HiOctane21 Linux - Networking 0 02-07-2007 12:49 PM
opera: client-error-bad-request landroni Linux - Software 0 11-22-2005 10:22 AM
client-error-bad-request when trying to print with lp blas Linux - General 4 02-09-2005 10:30 AM


All times are GMT -5. The time now is 09:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration