I’m having trouble viewing/log-in to my multisites from other computers on the local network. After getting my multiple sites set up I realized other members of my office needed access to the development sites. So I configured DNS and openSSH on my sandbox. I think I have gotten them all configured properly since when I navigate to http://192.168.1.110 from another computer I get:
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
However, I could not see any of my sites. I have three sites located at /etc/drupal/6/sites/ they are:
science.com
teaching.com
dtest.com
Since the file I could see (index.html) is located in /var/www/ I decided to symlink my drupel site folders to this site using:
sudo ln –s /etc/drupal/6/sites/science.com /var/www/science.com
However, when I navigate to http://192.168.1.110/science.com all I get a list of the files that looks like this:
Index of /science.com
Name Last modified Size Description
Parent Directory -
dbconfig.php 29-Nov-2009 22:57 538
files/ 16-Oct-2009 08:08 -
install.php 30-Nov-2009 00:42 46K
settings.php 30-Nov-2009 00:38 6.0K
Apache/2.2.12 (Ubuntu) Server at 192.168.1.105 Port 80
I should point out that the sites work fine when I access them directly from the server.
Is there some way to make all the sites accessible or should I restart from scratch and install the sites using an ssh connection after I have set up DNS and openSSH on the server (Or am I completely clueless and this would not fix the problem either).
In case it maters my server set up is:
Dell Inspiron 6000
Ubuntu 9.10 Desktop
Apache2.2
mysql-server-5.0
mysql-client-5.0
php5
php5-gd
php5-mysql
phpmyadmin
Drupal 6.14
linksys router
Thanks for your help
Comments
Multisite relies on the domain name in the request
You can't access a specific site using a subdirectory in the url (e.g. http://hostname/sitename).
Multisite works when the domain name in the request equals the name of the directory under sites. So What you want in the dev environment is to be able to access your site at something like http://science.com.hostname/
What you need to do is something like this:
1) Configure your DNS to direct all *.hostname requests to the dev machine.
2) Configure apache to direct all *.hostname requests to the drupal installation. You do this using VirtualHost configuration, e.g.
DocumentRoot "/Users/yourusername/Sites/drupal/6"
ServerName drupal6.local
ServerAlias *.drupal6.local
ErrorLog "/private/var/log/httpd/drupal6.local-error_log"
CustomLog "/private/var/log/httpd/drupal6.local-access_log" common
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
3) Create symbolic links under the sites directory, e.g.
ln -s /etc/drupal/6/sites/science.com science.com.devmachinename
At least this is how I configured it...
Apache Help
Hi
Thanks for the information but I don't think I know enough about apache configuration files to make this work.
My present file has this in it:
VirtualHost *:80 (I removed the < to get the VirtualHost tags to display)
ServerAdmin web@cub.edu (I just realized this email no longer works, however, that did not seem to mater before)
DocumentRoot /usr/share/drupal6/
ServerName dtest
ServerAlias www.dtest.com
RewriteEngine On
RewriteOptions inherit
/VirtualHost
VirtualHost *:80
ServerAdmin web@cub.edu
DocumentRoot /usr/share/drupal6/
ServerName science
ServerAlias www.science.com
RewriteEngine On
RewriteOptions inherit
/VirtualHost
etc
I tried to add this section the the existing file:
VirtualHost *:80
DocumentRoot "/Users/sandbox/Sites/drupal/6"
ServerName drupal6.local
ServerAlias *.drupal6.local
ErrorLog "/private/var/log/httpd/drupal6.local-error_log"
CustomLog "/private/var/log/httpd/drupal6.local-access_log" common
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
VirtualHost *:80
or this:
VirtualHost *:80
DocumentRoot /usr/share/drupal6/
ServerName drupal6.local
ServerAlias *.drupal6.local
ErrorLog "/private/var/log/httpd/drupal6.local-error_log"
CustomLog "/private/var/log/httpd/drupal6.local-access_log" common
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
VirtualHost *:80
However every time I restart apache I get this error message:
* Restarting web server apache2
* We failed to correctly shutdown apache, so we're now killing all running apache processes. This is almost certainly suboptimal, so please make sure your system is working as you'd expect now!
... waiting Syntax error on line 12 of /etc/apache2/sites-enabled/drupal:
AllowOverride not allowed here
Cold some one suggest what I may be doing wrong. Also, since my site folders are in /etc/drupal/6/sites/ why does my drupal file say DocumentRoot /usr/share/drupal6/. Or could you point me to a good resource so I can learn how to read/write these apache files.
Thanks
PJ
Apache config files are a pain in the neck
** I think your configuration should be something like this. At least that what's working for me:
<VirtualHost *:80>DocumentRoot /etc/drupal/6
ServerName drupal6.local
ServerAlias *.drupal6.local
RewriteEngine On
RewriteOptions inherit
</VirtualHost>
** Apache error message tells you "AllowOverride not allowed here". That because it really isn't allowed there. According to Apache's documentation, AllowOverride is only permitted inside Directory context, and this is a VirtualHost context.
** The DocumentRoot should point to the drupal installation directory (not the sites subdirectory). I don't know why your current configuration points to /usr/share/drupal6/. Possibly /usr/share/drupal6/ is soft linked to /etc/drupal/6 ?
If configuring DNS servers is
If configuring DNS servers is beyond your capability (it's certainly beyond mine!), it may be simpler to just edit the hosts file on each client machine to point the test addresses to your server over the network.
192.168.1.110 science.test192.168.1.110 teaching.test
192.168.1.110 dtest.test
...and then on your server, create symbolic links in the "sites" directory for each respective site; science.test links to science.com, etc.
The Boise Drupal Guy!
Another alternative to configuring DNS
Garrett's suggestion is very good. Instead of configuring every machine's hosts file, however, you can probably configure something like that in your router's DNS settings.