Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache only grants access from localhost
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
hadoque
Apprentice
Apprentice


Joined: 09 Sep 2004
Posts: 150
Location: Stockholm, Sweden

PostPosted: Sat Feb 14, 2009 3:47 pm    Post subject: Apache only grants access from localhost Reply with quote

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
Code:
lynx localhost

I'm getting the "It worked!" page. But when I access with
Code:
lynx ellen
, 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
View user's profile Send private message
Plague.CZ
n00b
n00b


Joined: 13 Mar 2007
Posts: 72

PostPosted: Sat Feb 14, 2009 7:31 pm    Post subject: Reply with quote

Is "ellen" resolvable by DNS or is it only your local setting? I think apache needs FQDN or an IP address...
Back to top
View user's profile Send private message
hadoque
Apprentice
Apprentice


Joined: 09 Sep 2004
Posts: 150
Location: Stockholm, Sweden

PostPosted: Sat Feb 14, 2009 10:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
gimpel
Advocate
Advocate


Joined: 15 Oct 2004
Posts: 2720
Location: Munich, Bavaria

PostPosted: Sun Feb 15, 2009 12:46 am    Post subject: Reply with quote

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
View user's profile Send private message
pappy_mcfae
Watchman
Watchman


Joined: 27 Dec 2007
Posts: 5999
Location: Pomona, California.

PostPosted: Sun Feb 15, 2009 8:11 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum