Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 11-20-2005, 09:52 AM   #1
Registered: Nov 2003
Location: Omaha, NE
Distribution: Ubuntu, Kubuntu, Ubuntu Server
Posts: 77

Rep: Reputation: 15
Problems setting up virtual hosts with debian sarge and apache2

Versions: Debian Sarge, Apache2
Goal: Set up apache2 with a virtual servers. If I type "pince" into the browser, I want to go to the default page. If I type in "rt", I want to go to the home page for virtual host rt.

What I've done so far:
-added my two hosts to the /etc hosts file like this:
Code:       localhost.localdomain   localhost       pince rt
-verified that apache is running
-typed in "pince" in a locally run browser and gotten the apache2 default page
-copied the /etc/apache2/available-sites/default file to /etc/apache2/available-sites/rt
-change the DocumentRoot and Directory settings in rt to /var/www/rt
-created directory /var/www/rt shame with same permissions as /var/www/apache2-default
-copied over the index.html.en file to /var/www/rt and changed the contents so I know when I hit it.
-in directory /etc/apache2/sites-enabled, I created a symbolic link
ln -s /etc/apache2/sites-available/rt rt
-restarted apache with /etc/init.d/apache2 restart (restarted without error)

What happens

When I type in "pince", I now get a 404 error. Here's the error log:
[Sun Nov 20 09:48:24 2005] [debug] /home/adconrad/build/apache2/security/sarge/apache2-2.0.54/build-tree/apache2/modules/mappers/mod_alias.c(438): [client] incomplete redirection target of '/apache2-default/' for URI '/' modified to 'http://pince/apache2-default/'
[Sun Nov 20 09:48:24 2005] [error] [client] File does not exist: /var/www/rt/apache2-default
If I remove the link to rt in active-sites and restart apache. Apache behaves normally. Any ideas as to what I'm breaking? Pointers to docs on creating vhosts The Debian Way?
TIA Dave
Old 11-23-2005, 05:25 PM   #2
LQ Newbie
Registered: Nov 2005
Location: Northampton, UK
Distribution: debian, ubuntu
Posts: 1

Rep: Reputation: 0
I just set up apache2 today, here should be the solution:

You need to remove line 17 from the rt configuration file:
RedirectMatch ^/$ /apache2-default/
As it is pointing to a directory named apache2-default in rt's webroot, which doesn't exist.

You may also want to remove this section, which effectively symlinks in the apache2 documentation into your virtualhost. It won't hurt to leave it in though.
Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from ::1/128

Last edited by funkyHat; 11-23-2005 at 05:27 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[DEBIAN SARGE] problems setting up sshd to use tcpwrapper nonutopia Linux - Security 1 08-23-2005 08:04 AM
Subdomains on Apache2 with virtual hosts - how? <Ol>Origy Linux - Networking 2 08-18-2005 05:53 AM
Apache2 Virtual Dynamic Hosts and defaults techrolla Linux - Networking 1 11-01-2004 04:01 PM
Apache2, SSL, 2 Virtual Hosts franticbob Linux - Software 0 04-07-2004 09:48 PM
apache2 virtual hosts viniosity Linux - Software 4 02-07-2004 12:15 AM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration