LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Why does Apache not see my files? (https://www.linuxquestions.org/questions/linux-software-2/why-does-apache-not-see-my-files-259456/)

BlueNoteMKVI 11-26-2004 05:27 AM

Why does Apache not see my files?
 
I have a new webserver set up, running RedHat 9 and DirectAdmin for a control panel. I've been moving my clients over from my old server over the past week. So far it's gone well with no snags, but then tonight comes the problem.

This particular client runs an online store. I copied all of his files from the old server to the new using SCP. I then took the store offline for a few minutes while I exported the database from the old server, then imported into the new server. Database sets up just fine. Back to the old server, I change all of the DNS settings to the new IP address and it should be good to go. This is the same procedure that I've followed with a dozen other sites, most database driven, a few using the same shopping cart software.

Now it's time to test. I load up the site in a browser and see the normal black background of his index.html file. The index.html has a meta-refresh that sends the user to the directory of the store. When the meta-refresh happens, I get a 404 error on that subdirectory.

So now I'm confused. I've checked on file permissions and ownership, everything is right. If I load the site by going to www.mysite.com/~client_username/path/to/store/ it loads fine. www.clientssite.com still gives me a 404 BUT www.clientssite.com/index.html gives me...the default Apache page!

I don't know what the heck is going on. The procedure for moving the site was the same for this as it was for all of my other clients (who are operating smoothly now). The setup is the same as it is for those other clients. What the heck is going on?

rjlee 11-26-2004 05:36 AM

This sounds like you haven't set up the location correctly, in that that virtual domain is pointing to a different directory.

It could just be that you need to reload the apache server's settings:
Code:

killall -HUP httpd
The fact that www.clientssite.com doesn't read the index.html page also suggests that the index isn't looking for the .html extension. Check through your httpd.conf and compare the settings for this virtual domain (search the file for clientsite.com) and compare it with the settings for another. Change them to make them the same, then HUP httpd.

The other thing you could check is the apache's error.log and access.log files, which might give you slightly more meaningful information than just a 404 page.

BlueNoteMKVI 11-26-2004 11:34 AM

So this morning when I read your suggestion (killall -HUP httpd) I tried that and it worked fine, the site came up just great. Everything was happy for a while and then it came crashing back down.

I've checked over the httpd.conf files for both that site, and another site that should have the same setup. Both are the same except for obvious places where it says siteone.com instead of sitetwo.com.

I also checked the logs - the error log shows lots of "file not found" on favicon.ico but that's about it. Any other clues?

rjlee 11-27-2004 06:41 PM

Code:

killall -HUP httpd
just tells Apache to re-read its configuration files.

The favicon.ico file is the standard name of an icon file that some browsers will automatically request in order to associate an icon with a web-site. (linuxquestions.org uses a penguin, for example). You can probably just ignore this (it's an Microsoft icon resource file).

If the configuration is changing over time, then it might be that you're hitting a bug in Apache, or some sort of server load limit. First make sure that you have all the Red Hat updates downloaded and installed.

Also, check what is being reported by the top command and by the /proc/meminfo file, in case there's some obvious load problem (eg. processes have a tendency to die if they run completely out of memory).

BlueNoteMKVI 11-27-2004 06:54 PM

I found the problem, it seems to be completely unrelated to this.

The site in question is on its own dedicated IP address. When I changed the DNS settings on the OLD server, I put in the default IP of the NEW server. When I went in and changed those to be the dedicated IP for that site on the new server, everything worked beautifully.

I'm still not entirely sure why I saw the right files when my box was pinging the new IP...but regardless, the problem is solved now.

Thanks for your help!


All times are GMT -5. The time now is 12:56 AM.