Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache-2.2.6 & Virtual Hosts
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
sandytoshev
n00b
n00b


Joined: 30 Dec 2007
Posts: 8

PostPosted: Sun Dec 30, 2007 10:06 pm    Post subject: Apache-2.2.6 & Virtual Hosts Reply with quote

Hi guys,

I have recently updated my system (it have been a while) and i got myself into the new apache2. It is fine (ofcourse it is) but i can't manage to make virtual hosts to work. The default virtual host is working fine. The syntax check is fine:

===Code===
#apache2 -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 mrtg.liolio.net (/etc/apache2/vhosts.d/00_default_vhost.conf:50)
Syntax OK
===End===

When I try to access "mrtg.liolio.net" i get: "You don't have permission to access / on this server."

First I thought it is a persmission issue so I changed to 777 every file in the mrrtg directory plus the directory itself.

No success till now and help will be appreciated.
Here is my vhost config file:

#cat 00_default_vhost.conf
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

<IfDefine DEFAULT_VHOST>
# see bug #178966 why this is in here

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

# Use name-based virtual hosting.
NameVirtualHost *:80

DocumentRoot /var/www/localhost/htdocs

# When virtual hosts are enabled, the main host defined in the default
# httpd.conf configuration will go away. We redefine it here so that it is
# still available.
#
# If you disable this vhost by removing -D DEFAULT_VHOST from
# /etc/conf.d/apache2, the first defined virtual host elsewhere will be
# the default.
<VirtualHost *:80>
Include /etc/apache2/vhosts.d/default_vhost.include

<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>

</IfDefine>

<VirtualHost *:80>
DocumentRoot /var/www/localhost/htdocs/mrtg
ServerName mrtg.liolio.net
</VirtualHost>
Back to top
View user's profile Send private message
Malvineous
Apprentice
Apprentice


Joined: 20 Oct 2006
Posts: 281
Location: Brisbane, Australia

PostPosted: Sun Dec 30, 2007 11:48 pm    Post subject: Reply with quote

You don't seem to have a permissions section in your vhost config - what happens if you add this?
Code:
    <Directory "/var/www/localhost/htdocs/mrtg">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

Also, /var/www/localhost/htdocs is meant for the default vhost, you should really be using something like /var/www/mrtg/htdocs.
Back to top
View user's profile Send private message
sandytoshev
n00b
n00b


Joined: 30 Dec 2007
Posts: 8

PostPosted: Mon Dec 31, 2007 2:43 am    Post subject: Reply with quote

Problem solved by adding the permissions section. Thanks for the reply and the help.
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