maybe OT? apache configuration

E K ekg_ab-FFYn/CNdgSA at public.gmane.org
Sun Oct 24 23:07:33 UTC 2010


Hi Matt,

I don't fully understand the function of the serverName in the <VirtualHost ......> stanza. The only time I specify it is in a secure website specification. 

When I configure virtual hosts I have some thing like
     <VirtualHost virtualhostname:port>
        virtual domain configuration stuff goes here
     </VirtualHost>

The stanza
    <VirtualHost *:80>
        .......
   </VirtualHost>
is for the default website that is not configured with any of the <VirtualHost> ....</VirtualHost> stanzas above it. Anything under it is just redundant which will never be accessed (well, with port 80, to be exact).

Long story short, one solution you might try is to create a symbolic link to your
    /home/drupal-commons/drupal_commons at /var/www/ with

ln -s /home/drupal-commons/drupal_commons /var/www/drupalsitename

and let the drupal site be accessed like the other Wordpress sites.

If your drupal site requires different configuration setting than the word press ones, then this will not work. You have to have a drupal virtual host stanza with 

    <VirtualHost  drupalsite:80>
        configuration stuff
    </VirtualHost>
stanza above the default <VirtualHost *:80> stanza which happened to serve the WordPress sites.

HTH,

Equbay 

--- On Wed, 10/20/10, Matt Price <moptop99-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:

From: Matt Price <moptop99-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
Subject: [TLUG]: maybe OT? apache configuration
To: "TLUG" <tlug-lxSQFCZeNF4 at public.gmane.org>
Received: Wednesday, October 20, 2010, 11:10 PM

Hi folks,

ok, so I have an ubuntu server running multiple wordpress sites; so I have the file wordpress-sites in /etc/apache2/sites-available, containing the following fairly straightforward code:

-------------------

## Virtual host VirtualDocumentRoot                                             
                                                                                
        <Directory />                                                           

            Options FollowSymLinks                                              
            AllowOverride All                                                   
        </Directory>                                                            

                                                                                
        <VirtualHost *:80>                                                      
        UseCanonicalName    Off                                                 

        VirtualDocumentRoot /var/www/%0                                         
        Options All                                                             
        #ServerAdmin admin-hcDgGtZH8xNBDgjK7y7TUQ at public.gmane.org                                          

                                                                                
        # Store uploads in /var/www/wp-uploads/$0                               
        RewriteEngine On                                                        

        RewriteRule ^/wp-uploads/(.*)$ /var/www/wp-uploads/%{HTTP_HOST}/$1      
                                                                                
        </VirtualHost>           
------------------------


now I would like to try a drupal site on the same server (actually, the drupal commons install profile).  This works fine with the following code in /etc/apache2/conf.d/drupal-commons:
---------------------------

Alias /drupal-commons /home/drupal-commons/drupal_commons

<Directory /home/drupal-commons/drupal_commons>
    Options +FollowSymLinks
    AllowOverride All
    order allow,deny
    allow from all

</Directory>

------------------------------

except, of course, that this makes the default drupal site show up as a subdirectory of any site mapped to the server!  not what I want.  The problem is that I can't see how to combine the dynamic virtual host method with old fashioned static virtual hosts, e.g. like this:

        <VirtualHost *:80>                                                      
        DocumentRoot /home/drupal-commons/drupal_commons                        
        ServerName drupal.commons.site.hostname                                      

        </VirtualHost>                                                          

but, and here's my problem, if I put this stanza below the dynamic stanzas I already have, then they're pre-empted by the *wildcard blogging; but if I put the new stanza ahead of the old dynamic stuff, _SURPRISE_, now any site hosted at this ip address suddenly get served up the drupal commons site!  

i don't really understand why that happens -- surely the ServerName directive is supposed to limit the application of the <VirtualHost> directive?  Can anyone offer me any guidance?

Thanks as always,
Matt





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20101024/43be83a8/attachment.html>


More information about the Legacy mailing list