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

I just don't know where else to look and what else to do. I keep getting a 403 error on all my vhosts after setting varnish 3.0

Apacher log:

[error] [client 127.0.0.1] client denied by server configuration: /etc/apache2/htdocs

Headers:

http://domain.com/

GET / HTTP/1.1
Host: domain.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Cookie: __utma=106762181.277908140.1348005089.1354040972.1354058508.6; __utmz=106762181.1348005089.1.1.utmcsr=OTHERDOMAIN.com|utmccn=(referral)|utmcmd=referral|utmcct=/galerias/cocinas
Cache-Control: max-age=0

HTTP/1.1 403 Forbidden
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html; charset=iso-8859-1
X-Cacheable: YES
Content-Length: 223
Accept-Ranges: bytes
Date: Sat, 01 Dec 2012 20:35:14 GMT
X-Varnish: 1030961813 1030961811
Age: 26
Via: 1.1 varnish
Connection: keep-alive
X-Cache: HIT
----------------------------------------------------------

/etc/default/varnish:

DAEMON_OPTS="-a ip.ip.ip.ip:80 \
             -T localhost:6082 \
             -f /etc/varnish/main.domain.vcl \
             -S /etc/varnish/secret \
             -s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G"
             #-s malloc,256m"

My vcl file: http://pastebin.com/axJ57kD8

So, any ideas what I could be missing?

Update

Just so you know, ports:

NameVirtualHost *:8000
Listen 8000

and <VirtualHost 205.13.12.12:8000>

share|improve this question
    
Why is your Apache configuration set to serve documents from /etc/apache2/htdocs? –  Michael Hampton Dec 1 '12 at 21:10
1  
If the requests are getting the Apache you have something in the access config there Denying the requests from Varnish. Did you change anything in httpd.conf for Varnish? What access rules to you have? –  mtm Dec 1 '12 at 21:29
1  
@mindthemonkey I have the default apache2.conf can't figure it out why only happens with varnish on –  w0rldart Dec 7 '12 at 19:29

1 Answer 1

up vote 3 down vote accepted

You're sending requests to 127.0.0.1:8000, which the server is listening on but your virtual host is configured for 205.13.12.12:8000.

When a virtual host is not matched it will try and serve the default site which, from the error, looks like a DocumentRoot /etc/apache2/htdocs which might not have correct permissions, or exist, or be configured in httpd.conf correctly for access, whatever it is doesn't really matter unless you plan on using it at some stage.

Point Varnish at the interface IP 205.13.12.12
or
Configure your virtual host to work with 127.0.0.1
or
Use the _default_ special name in the same docco if this virtual host should be the default.

share|improve this answer

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.