Solved

Apache misconfiguration

Posted on 2000-02-22
7
411 Views
Last Modified: 2013-12-16
Please help:

I did something, not entirely sure what, to mess up my Apache installation. Now all I get are 403's.

As I retrace my steps:

A) I upgraded the version of Apache that came with RH6.1 (1.3.9-4) to the latest version (1.3.11-5) with an RPM from rpmfind.
B) The upgrade seemed to go relatively smoothly except that the old documentation (html/manual/) was erased and the new one was not installed.
C) I upgraded my initscripts (with initscripts-4.70-1.i386.rpm).
D) It was either at this point, or directly after step B that I noticed httpd would not start.  It complained about a 'PerlHandler' line in httpd.conf.  I commented out that section, and httpd started without errors.
E) Now all I get are '403 Forbidden' messages. Uncommenting the lines from step D does not help. (I also don't even know Perl yet, so I don't think I want the module loaded.)

The directory permissions are correct (drwxr-xr-x) and I have tinkered with just about every setting vaguely relevent in httpd.conf.

I have also tried uninstalling (rpm -e) Apache, but rpm just tells me that it isn't installed (even though rpm -qa tells me it is).

As any expert will likely have guessed, I am a newbie, and have little to no idea what I am doing. At this point I don't care if I have to downgrade. I just want a simple Apache server running so I can educate myself.

Any ideas how to get me back in business?

Thanks in advance,
CubeDweller
0
Comment
Question by:cubedweller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2548736
Have you looked in the apache logs to see what it claims the problem is?

Offhand I'd suspect that the apache is using the wrong conf file or the wrong apache is starting or the conf file isn't point to where the htdocs actually are.

Make sure you are actually running the apache that you think you should be by killing the existing httpd. Then check the conf file to see where it thinks the htdocs dir is (and that that dir exists and has the right content). Then start apache manually from the command line. If that works, you'll need to figure out what the init script is doing wrong.
0
 

Author Comment

by:cubedweller
ID: 2548878
Apache Error Log says:
[Tue Feb 22 22:29:58 2000] [error] [client 192.168.1.35] client denied by server configuration: /home/httpd/html

The script in inet.d that calls httpd defines the conf files correctly as:
# config: /etc/httpd/conf/access.conf
# config: /etc/httpd/conf/httpd.conf
# config: /etc/httpd/conf/srm.conf
(If I uncomment them, the script breaks.)

httpd.conf says htdocs are:
DocumentRoot "/home/httpd/html"
It is a directory that exists and has drwxr-xr-x permissions with an index.html file that has -rw-rw-r-- permissions.

The only Apache I can find is /usr/sbin/httpd.  It tells me that (via 'httpd -v') that it is v1.3.11. I can execute it directly, but I still get the same error.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2549048
The log error says that the server configuration is denying access to the client. Time to go looking at the config file. Late versions of Apache are usually built to only use the httpd.conf file. The others, access & srm, are always empty of directives. Since I always build Apache from source, I don't know what the default for access is, but it could well be that it's been set for something like:

  order deny,allow
  deny from all
  allow from localhost
 
Which would cause the error you've got.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:perimus
ID: 2550070
Apache may have been compiled/installed with user-level access control, where it will su to a user's permissions before accessing documents.  To disable this, rename the suexe executable installed by apache to something else, such as:

mv /usr/sbin/suexe /usr/sbin/disable.suexe

Good luck!
0
 

Author Comment

by:cubedweller
ID: 2550732
Sure enough, my httpd.conf file looked like that.  I tried various alterations, like:
<Location /doc>
  order allow,deny
  allow from all
  Options Indexes FollowSymLinks
</Location>
But I still keep getting 403's.

I also renamed suexec, but that didn't help either.

Is there some way I can just rip the current Apache out and stuff a working version (maybe the older one?) back in?
0
 
LVL 40

Accepted Solution

by:
jlevie earned 60 total points
ID: 2551225
Something in the config file still isn't right. If you are familiar with Apache you could go through it, top-to-bottom, and make it work. I could probably find the problem, but I'd have to see the entire config file.

Alternatively, you could just remove the 1.3.11 (via rpm) and re-install the 1.3.9 from the RedHat CD.
0
 

Author Comment

by:cubedweller
ID: 2551700
Back in business.

Turns out, in my newbie-ness, I did not know that one should not append '.rpm' to an 'rpm -e' command.  With this lesson learned I was able to remove the broken Apache and reinstall the original version.

Thanks to everyone who helped.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question