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 running since few years directadmin on centos, now I need a better server environment for our sites. I installed last centos version on a rackspace instance, installation of directamin with all necessary services went well. Since I run a magento based store I wanted to test varnish, found everything that I need and installed varnish successfully. Te problem appears as soon as I switch varnish to port 80 and apache to 8080, report from apache error log:

[Wed Sep 18 06:50:25 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/404.shtml 

[Wed Sep 18 08:56:58 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/favicon.ico

[Wed Sep 18 08:56:58 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/404.shtml
[Wed Sep 18 08:56:58 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/404.shtml

[Wed Sep 18 09:09:58 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/www.google.com

[Wed Sep 18 09:09:58 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/404.shtml

[Wed Sep 18 09:09:58 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/405.shtml

[Wed Sep 18 10:18:30 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/robots.txt

[Wed Sep 18 10:18:30 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/404.shtml

[Wed Sep 18 10:18:30 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/skin

[Wed Sep 18 10:18:30 2013] [error] [client 127.0.0.1] File does not exist: /var/www/htdocs/404.shtml

The server doesn't use /var/www/htdocs at all, however there is a record in my httpd.conf:

DocumentRoot "DocumentRoot "/var/www/htdocs""

But the same config is on my old server as well and I didn't ever notice anything wrong. As soon I switch back to apache only everything works fine with the same directive in apache config. New server has only one IP address and I run virtual hosts (configured in directadmin) same as on old server. I am wondering what is wrong here, when I look into Varnish log the URLS for static content are ok, but in need of dynamic content apache is trying to look into /var/www/htdocs and there is nothing of use (empty dir), my files are in /home/user/public_html. I can't figure out :(

share|improve this question

2 Answers 2

There are two places you need to change the port. In ports.conf you need:

NameVirtualHost *:8080
Listen 8080

and in the files for the Virtual Hosts in sites-enabled, so that they start:

<VirtualHost *:8080>

I suspect you forgot to change one of them.

share|improve this answer
    
yes the first one is inside the httpd.conf the secound one concerns virtual hosts, I tried already but no changes. If I try to open mydomain.com:8080/~user/index.php it takes ages and doesn't load css files at the end :( –  mrki Sep 18 '13 at 15:22
    
Can you try: "wget --header="Host: mydomain.com" localhost:8080/"; from the server. Just to see if it returns the correct files for mydomain.com (replace that with whatever your actual domain is). –  seumasmac Sep 27 '13 at 16:00

Do not change apache port, leave varnish on the port 8080 and redirect requests to the port 8080 on the firewall.

share|improve this answer
    
how will sending traffic another way around solve this problem? –  mrki Sep 19 '13 at 17:53
    
This is global recommendation, regarding "File does not exist" - don't think this is related to ports somehow. I guess, you are using virtualhosts and "/var/www/htdocs/" is accessed when someone tries to contact your server without specifying host. Even localhost. –  GioMac Sep 19 '13 at 18:43

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.