apache2 Virtual Host configuration - Setup

This is a discussion on apache2 Virtual Host configuration - Setup ; Hi, I got warning message "www.domain.com:80 has no VirtualHosts" My machine has one IP address and I want to use several subdomains. These are my enabled configuration file. --- default file -------------------------- NameVirtualHost *:80 ServerAdmin webmaster@localhost ... ------------------------------------------- --- svn.domain.com ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: apache2 Virtual Host configuration

  1. apache2 Virtual Host configuration

    Hi,

    I got warning message "www.domain.com:80 has no VirtualHosts"
    My machine has one IP address and I want to use several subdomains.

    These are my enabled configuration file.

    --- default file --------------------------
    NameVirtualHost *:80

    ServerAdmin webmaster@localhost
    ...

    -------------------------------------------

    --- svn.domain.com file -------------------
    NameVirtualHost svn.domain.com:80

    ServerName svn.domain.com:80

    DAV svn
    SVNPath /home/public/repositories/svn.domain.com
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/apache2/dav_svn.passwd
    Require valid-user


    -------------------------------------------

    --- www.domain.com file -------------------
    NameVirtualHost www.domain.com:80

    ServerName www.domain.com:80
    DocumentRoot /home/public/www/www.domain.com/htdocs
    ...

    -------------------------------------------

  2. Re: apache2 Virtual Host configuration

    Sean Kim wrote:
    > I got warning message "www.domain.com:80 has no VirtualHosts"


    This means that you have defined NameVirtualHost www.domain.com:80
    without a VirtualHost definition.

    > My machine has one IP address and I want to use several subdomains.


    Is there a reason, why you should only listen on that IP? If you listen
    on all IPs and you got only one IP you're listening on taht IP.

    Like that:

    # 1 NameVirtualHost Statement for all VirtualHosts
    NameVirtualHost *:80

    # The ServerName Switch is used to direct Apache to the right Website.


    ServerName localhost
    ServerAdmin webmaster@localhost
    ...



    ServerName svn.domain.com
    ...



    ServerName www.domain.com
    ...



    Cheers, Isaac

+ Reply to Thread