Results 1 to 2 of 2

Thread: apache virtualhosts problem after test upgrade

  1. #1
    Join Date
    Aug 2006

    Question apache virtualhosts problem after test upgrade


    I recently upgraded a machine to 8.10 to check it for problems with the software were working on, and I ran into this problem: the httpd.conf file was overwritten.
    In putting it back together I noticed that local virtual hosts don't seem to be responding correctly.
    For instance, on this machine if we go to:
    an alias in the httpd.conf file correctly routes the request to it's correct place, and
    http://localhost/ (or
    correctly goes to the "It worked!" page (indicated by the DocumentRoot directive)
    On the same machine a virtual host for phptest has been set in the httpd.conf file:
    NameVirtualHost *
    <VirtualHost *>
       ServerName phptest
       DocumentRoot "/home/ttt/public-html/phptest"
    however going to:
    takes me to the same place as localhost (the "It worked!" page)

    I tried making modifications to the httpd.conf file, however it looks as if the DocumentRoot directive is being ignored within the VirtualHost directive.

    I'm sure that something else must have gotten overwritten/changed in the update, but I can't for the life of me figure out what it is.

    Here's my httpd.conf file:
    ServerName TestServer
    DocumentRoot "/var/www"
    NameVirtualHost *
    <VirtualHost *>
       ServerName phptest
       DocumentRoot "/home/ttt/public-html/phptest"
    # Alias for wiki
    Alias /wiki "/var/www/wiki/"
    <Directory "/var/www/wiki/">
           Options Indexes FollowSymLinks MultiViews ExecCGI
           AllowOverride All
           Order allow,deny
           Allow from all
    also, here's my /etc/hosts file:
    Code:       localhost       phptest     TestServer
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts

  2. #2
    Join Date
    Dec 2006

    Re: apache virtualhosts problem after test upgrade

    /etc/apache2/httpd.conf should not be used. It is only there for backwards compatibility. Delete everything in there. For your "phptest" vhost, create this file

    <VirtualHost *:80>
            ServerName phptest
            DocumentRoot /home/ttt/public-html/phptest/
    then enable it, and reload
    sudo a2ensite phptest
    sudo /etc/init.d/apache2 reload
    You want your default vhost's root to be "/var/www", correct? Why would you create an alias /wiki for /var/www/wiki? Isn't that where it would point anyway? If you want to edit your default vhost configuration, it is in /etc/apache2/sites-available/default.

Tags for this Thread


Posting Permissions

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