Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Dec 01, 2011 12:56 pm 
Offline

Joined: Sat Nov 26, 2011 8:08 pm
Posts: 1
Hello,

I've got a few domains pointing to my VPS. The first few are in separate locations, with a normal virtualhost config it works without a hitch. But I'm starting to host a few domains out of a single directory.

The first domains are configured as followed :

Code:
example.com loads /srv/http/example.com/
example2.com loads /srv/ruby/example2.com/
example3.com loads /srv/http/example3.com/


Now I have a bunch of other domains which are loaded from

Code:
/srv/php/lum/domains/*


Each domain has it's own subfolder there. I've been trying to use the virtualdocumentroot stuff in Apache to let the domains that I haven't declared in httpd-vhost.conf to load there, I've tried via .htaccess in the default domain documentroot as followed :

Code:
RewriteEngine On

RewriteMap lowercase int:tolower

RewriteCond !%{HTTP_HOST} ^defaultdomain\.com [OR]
RewriteCond !%{HTTP_HOST} ^www\.defaultdomain\.com

RewriteRule ^/(.*)$ /srv/php/lum/domains/${lowercase:%{SERVER_NAME}}/$1


Only this gives me an error on RewriteMap, so I moved it to extra/httpd-vhosts.conf

Code:
<VirtualHost *:80>

        DocumentRoot "/srv/php/lum/"
        ServerName defaultdomain.com
        ServerAlias www.defaultdomain.com
        ErrorLog /srv/php/lum/logs/defaultdomain.com

        RewriteEngine On

        RewriteMap lowercase int:tolower

        RewriteCond !%{HTTP_HOST} ^defaultdomain\.com [OR]
        RewriteCond !%{HTTP_HOST} ^www\.defaultdomain\.com

        RewriteRule ^/(.*)$ /srv/php/lum/domains/${lowercase:%{SERVER_NAME}}/$1

</VirtualHost>


With the other static virtualhosts configured below that.

Then when I go to an domain I haven't staticly configured it still shows /srv/php/lum/* instead of /srv/php/lum/domains/thedomain.com/*

Anything else I could try or is it impossible to combine? Would save me some time setting up another block of Vhost for each new domain.

Thanks alot :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group