View previous topic :: View next topic |
Author |
Message |
hadoque Apprentice
Joined: 09 Sep 2004 Posts: 150 Location: Stockholm, Sweden
|
Posted: Sat Feb 14, 2009 3:47 pm Post subject: Apache only grants access from localhost |
|
|
Hi
I'm trying to set up apache to work on my local network. The computer with apache has got the hostname ellen.
This is what I've added to the default apache2 config file
Code: | ServerName ellen:80
<VirtualHost *:80>
DocumentRoot /var/www/localhost/htdocs
<Directory /var/www/localhost/htdocs/php4>
AddHandler php4-cgi .php
</Directory>
<Directory /var/www/localhost/htdocs/php5>
AddHandler php5-cgi .php
</Directory>
</VirtualHost> |
When I access the server from itself with
I'm getting the "It worked!" page. But when I access with
, or from another computer in the network, I'm getting
Code: | Forbidden
You don't have permission to access / on this server.
Apache Server at 192.168.2.102 Port 80 |
When access is denied, this is what's in the log
Code: | [Sat Feb 14 16:43:49 2009] [error] [client 127.0.0.1] client denied by server configuration: /var/www/localhost/htdocs/ |
Anyone have an idea on how to fix this? I'm a total newbie on apache2, so I really could use some help. Also, I've looked like crazy on the web for an easy howto on gentoo and apache2, but with no luck. Would be greatefull on any tips... |
|
Back to top |
|
|
Plague.CZ n00b
Joined: 13 Mar 2007 Posts: 72
|
Posted: Sat Feb 14, 2009 7:31 pm Post subject: |
|
|
Is "ellen" resolvable by DNS or is it only your local setting? I think apache needs FQDN or an IP address... |
|
Back to top |
|
|
hadoque Apprentice
Joined: 09 Sep 2004 Posts: 150 Location: Stockholm, Sweden
|
Posted: Sat Feb 14, 2009 10:45 pm Post subject: |
|
|
the hostname ellen is set in /etc/hosts and /etc/conf.d/hostname and I'm not running a dns, so I guess I can't use a FQDN (and i don't want to either). I tried using the IP instead of ellen, but it didn't do any difference. |
|
Back to top |
|
|
gimpel Advocate
Joined: 15 Oct 2004 Posts: 2720 Location: Munich, Bavaria
|
Posted: Sun Feb 15, 2009 12:46 am Post subject: |
|
|
The ServerName should go into the VirtualHost definition.
And into which default apache2 config file did you add this? Usually if you do not need/want more than one virtual host, it's enough to set -D DEFAULT_VHOST in /etc/conf.d/apache2. Works out of the box, no extra config needed. It will use /etc/apache2/vhosts.d/00_default_vhost.conf/.include as config then. _________________ http://proaudio.tuxfamily.org/wiki - pro-audio software overlay
|
|
Back to top |
|
|
pappy_mcfae Watchman
Joined: 27 Dec 2007 Posts: 5999 Location: Pomona, California.
|
Posted: Sun Feb 15, 2009 8:11 am Post subject: |
|
|
My experience is, you have to set up the IP address in /etc/apache2/httpd.conf thusly: Code: | ServerName 192.168.0.130 | Of course, you would use your own IP address, not mine...unless your machine is 192.168.0.130.
After that, the information in /etc/hosts will be functional, assuming the numbering is correct, and you don't make a typo or two. I've done that once...or twice. It seems to work, because I just tried to connect to http://www.core-too/phpmyadmin, and it worked. That was pretty cool.
Blessed be!
Pappy _________________ This space left intentionally blank, except for these ASCII symbols. |
|
Back to top |
|
|
|