Link to home
Start Free TrialLog in
Avatar of choccarlm
choccarlm

asked on

Major Apache Problem

Hi,

I was deleting users from our mail server, and also removing mail spools and home directories. This server also runs a website, but the website no longer works. I keep getting a 403 error. I've checked all the permissions, and they seem to be fine. What could be causing this?
Avatar of samri
samri
Flag of Malaysia image

403 - Not found error:  Most likely you might have wiped out your DocumentRoot for good. :(

OS make/Version?
Apache version?

Depending on your Apache version; I believe some version of apache would be sitting in /home/httpd, or /home/apache.

If this is the case, look for your backup media- if there is any.

Another thing, try to locate you httpd.conf (apache config file), normally it would be in /usr/local/apache/conf/httpd.conf, or for RedHat it might be in /etc/httpd/conf/httpd.conf

Once you locate it, look for "ServerRoot" or "DocumentRoot" directive.   Locate that path in you filesystem.  If they are still around, you chaces are pretty bright, otherwise, ... depends on how bad it is.


awaiting..
Avatar of choccarlm
choccarlm

ASKER

Hi,

All the documents are still there. I hashed out (#) the virtualhost directive for the website, and I'm still getting a 403 error, when I would have expected to get "Page Not Found" 404 error. It seems as though it's not reading the conf file anymore
/home/httpd is still there
I renamed /etc/httpd/conf/httpd.conf to httpd.conf.bak and then tried to restart apache, but it said that it couldnt detect the conf file, so it is reading the conf file. I've tried everything I can think off, but Im not that good with apache, soI dont really know what else to try.

Is it worth reinstalling apache?
In the error logs, im getting

[Wed Apr 24 12:23:44 2002] [notice] child pid 913 exit signal Segmentation fault (11)

Could this be the problem?
Apology - just got back home.

I'm not sure what went wrong.  Personally I would have proceed to upgrade the apache, or reinstall it.  In most cases, the configuration would be intact.  Just make a copy of /etc/httpd/conf dir somewhere, and go ahead to reinstall.  Grab a copy from http://httpd.apache.org/dist/ 

If you care to still work on the existing setup, try to watch for error in the logfile when you opne the page.  The 403 error should register in the logfile.

btw, 403 - Forbidden (not Not found as I mentioned earlier).

Try to browse to http://yourserver/index.html

How about the DocumentRoot for each Vhosts? Remember that you must hashed (#) out all the VirtualHost, and the NameVirtualHost directive.

If you plan to upgrade, rename the current httpd.conf (or better the whole conf directory), and proceed with installation.  THe installer should create one for you with the default httpd.conf (new one).  After that, start the apache, and should everything is OK, reaplly the setting from your original config file.  I would presume that this is the cleanest way, but time consuming.  Better still, use the same approach, but once the installation completed, start apache and make sure everything is OK.  Next, backup the new config, and copy the old config back to httpd.conf.  If something in the existing (old apache) configuration is causing the server to "not" starting, Apache should have prompted you with and error during startup.  It's good to check the configuration with apachectl configtest prior to starting the daemon.

good luck.
I removed apache, php, php-mysql and mod_php. I then installed apache, apache common, php, php-mysql and mod_php. I restared apache, and I got the "Welcome to Apache" page. I then added my Virtual hosts directive's underneath the end of the httpd.conf file and restarted. Im now getting the same error again.
Remember that when you configure your server to do VirtualHosting, the first defiend VH would be the default VirtualHost.  Make sure that the DocumentRoot in the first defined VH, is OK, ie, the directory exist, and the default document (as defined in DirectoryIndex) is there.

Did apachectl configtest detect any error?
What rpms do I need to remove to completely uninstall apache? I also have php and mysql on the server, do I need to unistall those aswell. How wbout mod_ssl and mod_perl, mod_php?

Sorry, I really am quite new to apache.
What rpms do I need to remove to completely uninstall apache? I also have php and mysql on the server, do I need to unistall those aswell. How wbout mod_ssl and mod_perl, mod_php?

Sorry, I really am quite new to apache.
And the permission is correct, at least 711 (read access for apache user/group).

We are getting to the right track now.  At least we knew that something about VH is causing the 403.  Most common is due to the fact that by default global apache configuration would not allow directory browsing.  In order words, in each directory, there must be index.html (by default), otherwise, you will get 403 error.
The first VH is there, and the document root exists. index.html is in there also.

apachectl configtest reported everything to be ok
I'm not that expert in rpm.  In most cases "rpm -e pkgname" would erase the package.  However, due other packages might depends on apache, which would cause the rpm to failed.  One option is to do "rpm -e -t pkgname", would list all dependencies.  Next is to remove all dependencies.  Later, reinstall them back.

Anyhow, I would not suspect that you problem might have related to other packages.  It seems that VH is causing the problem.

We seems to be moving quite fast really, and our discussion seems to be "out-of-sync".  

Please try the proposed comment on creating the default VirtualHost, and create the default index.html first.

I have set the permissions to 777 for the index page, but it still isnt working.
I'm not that expert in rpm.  In most cases "rpm -e pkgname" would erase the package.  However, due other packages might depends on apache, which would cause the rpm to failed.  One option is to do "rpm -e -t pkgname", would list all dependencies.  Next is to remove all dependencies.  Later, reinstall them back.

Anyhow, I would not suspect that you problem might have related to other packages.  It seems that VH is causing the problem.

We seems to be moving quite fast really, and our discussion seems to be "out-of-sync".  

Please try the proposed comment on creating the default VirtualHost, and create the default index.html first.

I have now removed all rpms to do with apache, php and mysql. What do I need to install to get apache back?

I have:

apache-1.3.14-2mdk.i586.rpm
apache-common-1.3.14-2mdk
apache-mod_perl-1.3.14_1.24-2mdk

I've also read that I could experience segementation faults with mod_perl and php being built in the same binary. I read this at

http://perl.apache.org/preview/modperl-site-ok/docs/1.0/guide/troubleshooting.html#_exit_signal_Segmentation_fault__11___with_mysql
Yes you might.  I am running mine: OS Rh7.2, Apache 1.3.24, no problem.

Perhaps you might want to grab yourself a newer Apache version.

Grab a copy from http://rpmfind.net/

http://rpmfind.net/linux/rpm2html/search.php?query=apache

Sorted by Name.  Wait for the page to finish loading since it's quite big (damn... I'm on dial-up).
http://rpmfind.net/linux/RPM/AByName.html

Browse thru your OS version, and grab a copy.

Based on your rpm pkg, I would presume that you are running Mandrake.  These might be your best choice:

http://rpmfind.net/linux/RPM/cooker/cooker/i586/Mandrake/RPMS/apache-mod_perl-1.3.24_1.26-1mdk.i586.html
http://rpmfind.net/linux/RPM/cooker/cooker/i586/Mandrake/RPMS/apache-common-1.3.24-1mdk.i586.html
http://rpmfind.net/linux/RPM/cooker/cooker/i586/Mandrake/RPMS/apache-modules-1.3.24-1mdk.i586.html
http://rpmfind.net/linux/RPM/cooker/cooker/i586/Mandrake/RPMS/apache-conf-1.3.24-1mdk.i586.html
http://rpmfind.net/linux/RPM/cooker/cooker/i586/Mandrake/RPMS/apache-manual-1.3.24-1mdk.i586.html



Well there are too manu variation.  As long as the version is the same, it should be ok.

good luck.
what is the outcome?  did you manage to get your apache up and running.

cheers.
Re-install may work for you, but it doesn't address why you no longer have access.

For the record since this is old . . .

However , this sounds more like some permissions got reset on upper level directories during the data migration/shuffle.

check to make sure your permissions are set correctly for all directories, including those above documentroot, etc.  The process needs sufficit priveldge to decend through those directories as the user it is running as.  I have seen upper level directory permissions get changed and all access to the directories below come back 403 because of insufficent permissons.
In order for me to get the sites working again, I had to delete and remove each users webspace, and then add the user and the contents again. I have no idea why this happened, but that was the solution.

Thanks for the help anyway guys
no. prob.
is the problem solved, or do you need more time to decide?

cheers
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial