Find the answer to your Linux question:
Results 1 to 4 of 4
I've tried to create 3 NameVirtualHost(s) on apache2 server of RHEL5. the configuration file: Code: NameVirtualHost *:80 <VirtualHost *:80> ServerName site1 DocumentRoot /var/www/html/site1 </VirtualHost> <VirtualHost *:80> ServerName site2 DocumentRoot /var/www/html/site2 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Location
    China
    Posts
    37

    Question [SOLVED] How to increase the maximum sites of NameVirtualHost in apache2?


    I've tried to create 3 NameVirtualHost(s) on apache2 server of RHEL5.
    the configuration file:
    Code:
    NameVirtualHost *:80
    <VirtualHost *:80>
        ServerName site1
        DocumentRoot /var/www/html/site1
    </VirtualHost>
    <VirtualHost *:80>
        ServerName site2
        DocumentRoot /var/www/html/site2
    </VirtualHost>
    <VirtualHost *:80>
        ServerName site3
        DocumentRoot /var/www/html/site3
    </VirtualHost>
    The BIND9 service is ok. I've bind these 3 sites to the same IP address already. And I'm sure there's no problem with my NS server.
    The problems is I can only access the last 2 sites (site2 & site3) via domain name. When I type the site1 address in the browser, it brings me to the default DocumentRoot folder (e.g. /var/www/html/). How to override this limit? Do not suggest me to use IP virtual host or port virtual host, because I have 1 IP address only.

  2. #2
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    name based virtual hosts - Google Search

    is anything showing up in the logs? that looks correct. you may want to use fqdn for server name and then shortname as a server alias.

  3. #3
    Just Joined!
    Join Date
    Nov 2008
    Posts
    2
    The issue is not related to any limits. Rather this looks to me like some minute config related error.

    Does the server name of the global configuration and server name of the first virtual host match ? If so that could be the issue.

  4. #4
    Just Joined!
    Join Date
    Sep 2005
    Location
    China
    Posts
    37
    Quote Originally Posted by hzJayJ View Post
    The issue is not related to any limits. Rather this looks to me like some minute config related error.

    Does the server name of the global configuration and server name of the first virtual host match ? If so that could be the issue.
    Thanks, that's the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •