Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am in the process of migrating several websites to a new server. While the data transfer itself is going fine - I am running into issue testing the sites on the new hardware setup. Typically, this is done before any DNS changes are made and can be done by accessing the IP Address directly.

My current issue however lies in how my new server (or perhaps all) is handling pulling css (and other) files while using the PHP $_SERVER['DOCUMENT_ROOT']. The location is correct (using the IP address of course) but for some reason the css files are not loading. When I try to access the css files directly (using IP as the root), I get 403 Forbidden errors.

I also have modified my local windows hosts file to recognize a test address mapping to the sites IP address.

Is this common when trying to use IP addresses? Is there a way around so I can test?

Update

Looking at the error_log, I see several files coming back with the folling error:

client denied by server configuration

followed by the actual file name.

Issue Found (*)

I found the issue was related to my .htaccess file though not quite sure why. It is the same setup I used on my previous server.

AuthType Basic
AuthName "Protected Area"
AuthUserFile /var/www/vhosts/site.com/.htpasswd
Require valid-user

order deny,allow
deny from all
allow from ... (list of different ip addresses)
Satisfy Any
share|improve this question

2 Answers 2

Sounds like you have a permissions error. Make sure the files are owned by the same process as the web server, also you can look at Apache error logs to find out why it is throwing permissions errors.

share|improve this answer
    
thanks for the suggestion, I meant to put in my question (and will now) but I also already did this. I run into the same issue with forbidden permissions. –  JM4 Aug 9 '12 at 20:08
    
Updated answer to reflect this information –  Dave Drager Aug 9 '12 at 20:12
    
I run FastCGI so all files are run and owned by the ftp user which is valid. Shouldn't be an issue there (though my old site did not run off fcgi so perhaps something else). –  JM4 Aug 9 '12 at 20:50
    
I would also suggest looking at the Apache error logs to see what is throwing this error. –  Blake Aug 9 '12 at 21:03
    
Found the issue - not sure why it is causing conflict however as it is the same configuration I have on other sites. The issue was in my .htaccess file and it now allowing portions of the site to come through. –  JM4 Aug 9 '12 at 21:27

Probably, your domain name is not default vhost of your webserver so when you try to access with ip address, you get error.

You should add your domain name and ip address of new server to the hosts file of your operating system. Then you can test it with your domain name. All requests from your computer will go new server.

share|improve this answer
    
if I am reading you correctly - I have already changed my windows hosts file without any luck. Accessing the site itself does not necessarily bring issues - it is how it pulls other files based on the doc root and some type of permissions issue it seems. –  JM4 Aug 9 '12 at 20:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.