Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    33

    Apache virtual hosting not working

    I have VPS running Ubuntu. I installed apache2 and php5.
    I have two websites I want to run. However, the content for the first site is displaying for both sites. Here is what I did:

    Code:
    # sudo aptitude install apache2 php5
    # sudo cd /etc/apache2/sites-available/
    # sudo cp default kurttest
    # sudo cp default krueckeberg
    I edited kurttest and krueckeberg to look like what is shown below
    Code:
    # sudo a2dissite default
    # sudo a2ensite krueckeberg
    # sudo a2ensite kurttest
    # sudo /etc/init.d/apache2 restart
    kurttest has
    Code:
    <VirtualHost *:80>
    
    	DocumentRoot "/var/www/kurttest.com"
    # I'm not sure what this <Directory /> is for?
    	<Directory />
    		Options FollowSymLinks
    		AllowOverride None
    	</Directory>
    	<Directory "/var/www/kurttest.com/">
    		Options Indexes FollowSymLinks MultiViews
    		AllowOverride All
    		Order allow,deny
    		allow from all
    	</Directory>
    
    	ErrorLog ${APACHE_LOG_DIR}/error.log
    
    	# Possible values include: debug, info, notice, warn, error, crit,
    	# alert, emerg.
    	LogLevel warn
    
    	CustomLog ${APACHE_LOG_DIR}/access.log combined
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    
    </VirtualHost>
    krueckeberg has
    Code:
    <VirtualHost *:80>
    	ServerAdmin webmaster@localhost
    
    	DocumentRoot /var/www/krueckeberg.org
    	<Directory />
    		Options FollowSymLinks
    		AllowOverride None
    	</Directory>
    	<Directory /var/www/krueckeberg.org>
    		Options Indexes FollowSymLinks MultiViews
    		AllowOverride None
    		Order allow,deny
    		allow from all
    	</Directory>
    
    	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    	<Directory "/usr/lib/cgi-bin">
    		AllowOverride None
    		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    		Order allow,deny
    		Allow from all
    	</Directory>
    
    	ErrorLog ${APACHE_LOG_DIR}/error.log
    
    	# Possible values include: debug, info, notice, warn, error, crit,
    	# alert, emerg.
    	LogLevel warn
    
    	CustomLog ${APACHE_LOG_DIR}/access.log combined
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    
    </VirtualHost>
    kurttest.com is returning the content for krueckeberg.org?

  2. #2
    Join Date
    Apr 2012
    Posts
    33
    I forgot ServerName and ServerAlias in each site file. It is now working.

  3. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Similar Threads

  1. Apache + Virtual Hosting
    By danmcl in forum Hosting Security and Technology
    Replies: 0
    Last Post: 10-20-2005, 12:04 PM
  2. Replies: 4
    Last Post: 09-10-2005, 04:23 PM
  3. virtual hosting on apache - two weeks later still not working
    By kckclass in forum Hosting Security and Technology
    Replies: 22
    Last Post: 03-18-2004, 01:58 AM
  4. retard webmaster's virtual hosting on apache - three weeks later still not working
    By kckclass in forum Hosting Security and Technology
    Replies: 2
    Last Post: 01-25-2004, 04:58 AM
  5. Apache 1.3.29 with Virtual Hosting - SSI not working
    By VisiGod in forum Hosting Security and Technology
    Replies: 7
    Last Post: 01-19-2004, 02:24 PM

Related Posts from theWHIR.com

Posting Permissions

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