Alias. Virtualhost & Apache matrix+non matrix site

Hi,
Matrix adds a series of aliases to the apache httpd.conf file, for the purposes of this posting the key one being:

    Alias "/"          "/home/somewhere/matrix36/core/web/index.php/"


is it possible to still use Apache virtualhost configs to run a second non matrix site in parallel. ie something like:

    
         DocumentRoot /var/www/someDocRoot
         ServerName www.anonmatrixdomain.sa.gov.au
     


I've tried, but the alias seems to be overriding the virtualhost. Which kinda makes sense, but isn't what I'd like. Any suggestions on how to config apache to run a second non-matrix (ala static html) site in parallel on the same server.

Thanks

Dale

Do a virtual server for the matrix installation aswell.


And have the Alias within the Matrix snippet.

Yeah, what coolvik said. :slight_smile:

cool, thanks for that, I'll give it a whirl.


Cheers

Dale

The downside to this is that you then have to add ServerAlias lines in the VirtualHost block for every URL you use in Matrix.


If you route everything to Matrix, you can let Matrix handle the "virtual server" stuff itself.

[quote]The downside to this is that you then have to add ServerAlias lines in the VirtualHost block for every URL you use in Matrix.


If you route everything to Matrix, you can let Matrix handle the “virtual server” stuff itself.

[right][post=“9296”]<{POST_SNAPBACK}>[/post][/right][/quote]



Avi isn’t this dependant on how the server is configured? we used named hosting in our environment, so I have the one Virtual Host configuration for MAtrix, then just add ServerName for each URL it will listen for and this works a treat for us…



The other reason we do that is that, in Apache 1.3 there was problems with preventing TRACE method attacks and the only way to put the block in is in the virtual Host directive, as it did not like it in the mainserver configuration. This was a recommendation from a security audit we had conducted on our server so as a result each virtual host we have contains:



RewriteEngine On

RewriteCond %{REQUEST_METHOD} ^TRACE

RewriteRule .* - [F]



Also… I know not relevant but I thought I would just throw it in as half our network is down at the moment, and I cannot do any work, so a little bored :lol:’ /> <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/rolleyes.gif’ class=‘bbc_emoticon’ alt=’:rolleyes:

[quote]Avi isn’t this dependant on how the server is configured?  we used named hosting in our environment, so I have the one Virtual Host configuration for MAtrix, then just add ServerName for each URL it will listen for and this works a treat for us…
[right][post=“9298”]<{POST_SNAPBACK}>[/post][/right][/quote]



Yeah, ServerName, ServerAlias, same thing. :slight_smile:



What I meant was, if you use a VirtualHost block, you have to edit your Apache httpd.conf if you want to add a new site. If you don’t, you can just add the site in Matrix and it will automatically work (because Apache will send EVERYTHING to Matrix, and Matrix will sort it out itself).

[quote]Yeah, ServerName, ServerAlias, same thing. :slight_smile:


What I meant was, if you use a VirtualHost block, you have to edit your Apache httpd.conf if you want to add a new site. If you don’t, you can just add the site in Matrix and it will automatically work (because Apache will send EVERYTHING to Matrix, and Matrix will sort it out itself).

[right][post=“9301”]<{POST_SNAPBACK}>[/post][/right][/quote]



We have seperated out our virtual hosts from the HTTPD.conf file, and include a vhosts.conf file… which does make it a little easier to add items in… could even allow you to have a PHP admin script on the server to allow you to add a new servername entry to Matrix Virtual Host, and then do a Graceful restart on apache using su permissions etc :slight_smile: Food for thought

Oh, yeah. We do similar things for our shared hosting servers. Its not a show-stopper by any means, just something to keep in mind.


If you only have one Matrix system on the server, then you could avoid this by making sure virtual host for matrix is the first one loaded into apache. This is achieved by either making it the first VirtualHost directive or making sure it is loaded first if you're loading vhost config files like include *.conf

Apache treats the first virtual host as the default and all uncaught domains are forwarded to it.

[quote]Apache treats the first virtual host as the default and all uncaught domains are forwarded to it.
[right][post=“9305”]<{POST_SNAPBACK}>[/post][/right][/quote]



I didn’t know that – that’ll come in REAL handy. Thanks! :slight_smile:

We do that for our system too as currently with have 3 matrix instances on one box, 1 prod with lots of vhost, one for sandbox (cms-sandbox.mydomain/), one for training (cms-training.mydomain/). By having prod as the first one read, no need to add Aliases or restart Apache each time