Jump to content

Mod_vhost_alias


loki_22

Recommended Posts

Hi,

 

I need help setting up multiple vhosts. I've read the apache docs, but I'm still having trouble. I've set my dns with a wildcard, so all subdomains are mapped to my web server's IP. I've then setup a vhost as follows...

#example.com
<VirtualHost *:80>

    ServerAdmin me@example.com

    ServerName example.com
    UseCanonicalName Off
    VirtualDocumentRoot "/home/www/%2"
    ErrorLog /var/log/example.com-error_log
    CustomLog /var/log/example.com-access_log common

    DirectoryIndex index.php index.html index.htm

    #PHP Go!
    suPHP_Engine On

</VirtualHost>

 

I'm trying to catch the subdomain and use it to map to a directory. I've already accomplished this with mod_rewrite, but my users much prefer having vanity sub domains.

 

So far any subdomain tries to map to the / directory and it throws a 403.

 

Any help is much appreciated.

Thanks in advance.

Link to comment
Share on other sites

Yes,

 

The idea is that lar.example.com maps to /home/www/lar and ken.example.com maps to /home/www/ken. These directories exist.

 

Is the %2 right? for catching the subdomain part. I only need the subdomain to map to the correct folder.

 

Regards,

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.