Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Friday, August 30, 2013

.htaccess and Drupal Multisites

I was having trouble getting htaccess to work on the Drupal multisite I was setting up.

I figured out how I am able to do this.  Due to the way Drupal serves up the multisites, it looks to the document root for htaccess.

I ended up adding my configuration to my httpd-vhost.conf.

Just create a VirtualHost for each site.

<VirtualHost *:80>
    ServerAdmin webmaster@test.com
    DocumentRoot /var/www/html
    ServerName test.com

    <Location />
        AuthUserFile /users/jsmith/.htpasswd
        AuthName "Please Enter Password"
        AuthType Basic
        Require valid-user
    </Location>

</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@test2.com
    DocumentRoot /var/www/html
    ServerName test2.com

    <Location />
        AuthUserFile /users/tsmith/.htpasswd
        AuthName "Please Enter Password"
        AuthType Basic
        Require valid-user
    </Location>

</VirtualHost>

This is how I got it to work.  If there is a better way of doing it, please post in the comments.

Monday, August 26, 2013

Apache Virtual Hosts Overlap on Port

I was getting this odd error.

Starting httpd: [Mon Aug 26 14:44:22 2013] [warn] _default_ VirtualHost overlap on port 8080, the first has precedence

Then I noticed I didn't specify the Name Virtual Host.  I added the following to my httpd-vhosts.conf file.

NameVirtualHost *:8080


Restart apache, problem solved.

OS: RHEL 6.4

ShareThis