You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Yashesh Bhatia <ya...@gmail.com> on 2006/11/22 14:19:50 UTC
[users@httpd] ServerName directive in a VirtualHost container
Hi,
I have the following setup
Fedora Core 6
Apache 2.2.3
In my httpd.conf file i have the following
----------------------------------------------------------------------------------------------------------------------------
ServerRoot "/opt/httpd-2.2.3"
Listen 80
# ServerName - not used since i'm using Name based virtual hosts
# DocumentRoot - - ditto -
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
----------------------------------------------------------------------------------------------------------------------------
and in the httpd-vhosts.conf i have
----------------------------------------------------------------------------------------------------------------------------
NameVirtualHost 192.168.1.11:80
<VirtualHost 192.168.1.11:80>
ServerName bfc11.venuslabs.int
DocumentRoot "/opt/httpd/htdocs"
<Directory "/opt/httpd/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from 192.168.1.
#Allow from all
<FilesMatch "^config\.inc\.php">
Order allow,deny
Deny from all
</FilesMatch>
</Directory>
</VirtualHost>
----------------------------------------------------------------------------------------------------------------------------
and in the /etc/hosts file i have the following
----------------------------------------------------------------------------------------------------------------------------
# Do not remove the following line, or various programs
# that require network functionality will fail.
::1 bfc11.venuslabs.int bfc11 localhost.localdomain localhost
192.168.1.11 bfc11.venuslabs.int bfc11
----------------------------------------------------------------------------------------------------------------------------
Now when i try to access the url http://bfc11.venuslabs.int/ it gives a message
Forbidden
You don't have permission to access / on this server
but if i change the http-vhosts.conf file to use
ServerName www.bfc11.venuslabs.int
instead of
ServerName bfc11.venuslabs.int
and change the /etc/hosts file to use
192.168.1.11 www.bfc11.venuslabs.int bfc11
instead of
192.168.1.11 bfc11.venuslabs.int bfc11
i'm able to access the url http://www.bfc11.venuslabs.int
what could i be doing wrong with the ServerName bfc11.venuslabs.int ?
any pointers ?
thanks a bunch.
yashesh bhatia.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ServerName directive in a VirtualHost container
Posted by Yashesh Bhatia <ya...@gmail.com>.
thomas,
that worked perfect. thx a lot.
yashesh.
On 11/22/06, Thomas Antony <th...@antony.eu> wrote:
> Hi,
>
> > ----------------------------------------------------------------------------------------------------------------------------
> > and in the /etc/hosts file i have the following
> > ----------------------------------------------------------------------------------------------------------------------------
> > # Do not remove the following line, or various programs
> > # that require network functionality will fail.
> > ::1 bfc11.venuslabs.int bfc11 localhost.localdomain
> > localhost
> > 192.168.1.11 bfc11.venuslabs.int bfc11
>
> You probably get this error when you try to access bfc11.venuslabs.int
> from the web server.
> Remove bfc11.venuslabs.int from the line which starts with ::1.
> Your virtual host bfc11.venuslabs.int listen on 192.168.1.11 and not
> 127.0.0.1.
>
> kind regards
> Thomas Antony
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ServerName directive in a VirtualHost container
Posted by Thomas Antony <th...@antony.eu>.
Hi,
> ----------------------------------------------------------------------------------------------------------------------------
> and in the /etc/hosts file i have the following
> ----------------------------------------------------------------------------------------------------------------------------
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> ::1 bfc11.venuslabs.int bfc11 localhost.localdomain
> localhost
> 192.168.1.11 bfc11.venuslabs.int bfc11
You probably get this error when you try to access bfc11.venuslabs.int
from the web server.
Remove bfc11.venuslabs.int from the line which starts with ::1.
Your virtual host bfc11.venuslabs.int listen on 192.168.1.11 and not
127.0.0.1.
kind regards
Thomas Antony
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org