DeveloperSide.NET Forums

DeveloperSide.NET => Building a Web Server, for Linux => Topic started by: dvruiz on September 16, 2004, 03:14:34 PM



Title: Problem with Apache2 and virtual hosts
Post by: dvruiz on September 16, 2004, 03:14:34 PM
I installed and configured Apache2 on a RedHat 9.0 box according to the step-by-step guide by devside. The main webserver works fine in both http and ssl, but when I added virtual hosts which are ip based I get "The page cannot be displayed" message. Listed below is the virual host section of the server's httpd.conf.

Thank you

### Section 3: Virtual Hosts
#
# VirtualHost: 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.0/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.

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

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

# Virtual host jgmsinc
<VirtualHost xxx.xxx.xxx.xxx>
    DocumentRoot /home/website1/www/html
    ServerAdmin dvruiz@website1.com
    ServerName www.website1.net
#        ServerAlias website1.com
    <Directory />
         Options            FollowSymLinks
         AllowOverride      None
    </Directory>

    <Directory "/home/website1/www/html">
         Options            Indexes FollowSymLinks
         AllowOverride      None
         Order              allow,deny
         Allow              from all
    </Directory>


</VirtualHost>

# Virtual host website2
<VirtualHost xxx.xxx.xxx.xxx>
    DocumentRoot /home/website2/www/html
    ServerAdmin dvruiz@website2.com
    ServerName xxx.xxx.xxx.xxx
</VirtualHost>


Title: Problem with Apache2 and virtual hosts
Post by: admin on September 16, 2004, 09:06:42 PM
You can start here...
http://httpd.apache.org/docs-2.0/vhosts/


Title: Problem with Apache2 and virtual hosts
Post by: admin on September 19, 2004, 07:21:44 PM
You can also search these forums for "VirtualHost" to get an example.