Jump to content

Virtual host not working from localhost?


edwinboersma

Recommended Posts

Just registered to this forum, and hope to find my answers here.... Here we go:

I have a server with a number of virtual hosts. The server has only one ip-address. When I login to the server as a user, and do a wget on a file on one of the websites, it returns a 403 error. From outside the server, it works fine. Here's some output. The virtual host is configured by Confixx.

This is from the localhost, logged in as root, but with a normal user it does the same:
prolinus:/srv2/home/edwin # wget http://www.flisvos-sportclub.com/images/webcam.jpg
--18:32:41--  http://www.flisvos-sportclub.com/images/webcam.jpg
          => `webcam.jpg'
Herleiden van www.flisvos-sportclub.com... 80.126.234.12
Verbinding maken met www.flisvos-sportclub.com|80.126.234.12|:80... verbonden.
HTTP-verzoek is verzonden, wachten op antwoord... 403 Forbidden
18:32:41 Fout 403: Forbidden.

From another machine, outside the network:
edwin@donousa:~> wget http://www.flisvos-sportclub.com/images/webcam.jpg
--18:34:07--  http://www.flisvos-sportclub.com/images/webcam.jpg
          => `webcam.jpg.1'
Resolving www.flisvos-sportclub.com... 80.126.234.12
Connecting to www.flisvos-sportclub.com|80.126.234.12|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19,101 (19K) [image/jpeg]

100%[=====================================================================================>] 19,101        18.29K/s

18:34:18 (18.25 KB/s) - `webcam.jpg.1' saved [19101/19101]

Apache's error log:
[Thu Jan 11 18:45:07 2007] [error] [client 80.126.234.12] client denied by server configuration: /srv/www/htdocs/images


But /srv/www/htdocs/images is not where the file is. The config file of this virtual server:
<Directory "/srv2/home/web6/html">
  Options -FollowSymLinks -SymLinksIfOwnerMatch
  DirectoryIndex index.html index.htm index.php index.php3 index.php4 index.php5
  <IfModule mod_access.c>
    Allow from all
  </IfModule>
  php_admin_flag engine on
  <Files ~ "\.shtml$">
    deny from all
  </Files>
  <Files ~ "\.(wml.*|wbmp)$">
    deny from all
  </Files>
</Directory>

<VirtualHost 192.168.1.1:80>
  ServerName www.flisvos-sportclub.com
  ServerAlias www2.flisvos-sportclub.com
  DocumentRoot /srv2/home/web6/html/flisvos-sportclub.com
  SuexecUserGroup web6 web6
  php_admin_value open_basedir /srv2/home/web6/html/:/srv2/home/web6/phptmp/:/srv2/home/web6/files/:/srv2/home/web6/atd/
  php_admin_value file_uploads 1
  php_admin_value upload_tmp_dir /srv2/home/web6/phptmp/
</VirtualHost>


Why does it look in the standard DocumentRoot????
Link to comment
https://forums.phpfreaks.com/topic/33782-virtual-host-not-working-from-localhost/
Share on other sites

  • 2 weeks later...
I have exactly the same problem. when Im trying to access an outward facing website thru local host or a local I.P it tells me to naff off.

Try using a web proxy such as http://www.hidemyass.com/ works for me :-)

p.s. try and find a proxy as physically close to you as possible.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.