I'm using a multi-site configration to develop several different drupal sites at the same time. I'm trying to move the installation to a Debiain DMZ web server so that one of the clients can preview their site before it goes live. I want him to be able to access his site using only the IP address of the web server instead of a virtual host name so that he doesn't have to edit one or more hosts files. I have /etc/apache2/sites-available/default configured to point to the base drupal directory and copied the sites/clientsite directory to sites/default. Accessing the web server by IP address instead of the virtual host name correctly displays the front page properly themed. But clicking on any of the links results in a page not found error. I've tried specifying a base_url in settings.php and adding mod_rewrite rules to .htaccess with no luck.
Does anyone know of a way to do this - have the servers IP address return one spefifc site of the multiple sites? Or do I need to have him try and edit the hosts file(s) on his computer(s) - not something I'm anxious to do?
Best, Ed
Comments
have the servers IP address
Well, that's what virtual hosts do. If you're disabling that utility, it's hard for the system to know what you are asking for!
You CAN set one of the sites to be the default one that gets served - in the apache configs. But that only works around the problem temporarily.
If you've built the site with best-practices to be portable, you can also make the multisites available under a directory (virtually) using Apache Aliases, so example.com/site2 can work (almost) as effectively as site2.example.com. Make a symlink in your /sites dir to support that.
Depending on a bunch of factors, your links may not all resolve right - like if you've been hard-coding server-absolute links - but all the Drupal-generated navigation should recognise how to link to itself, even in that different location. (do not hard-code $base_url in this case - let Drupal auto-detect it)
You say the links give a page-not-found. how wrong was the URL they were taking you to? It's not related to a missing .htaccess file or AllowOverride is it? That's a different common problem.
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Can you give us exact example
Can you give us exact example URLs of what you are doing and of the "not found" pages, including any URL paths?
If you have Clean URLs enabled, do the "not found" pages work when you browse there using
?q=? In other words, is this just a Clean URLs problem?The problem is clean URL's.
I restored everything on the debian web server, including setting the server's default document root to /var/www. I turned off clean URL's, linked sites/default/settings.php to sites/his_site/settings.php and linked sites/default/files to sites/his_site/files. I can now access the site using the server's IP address and the name of drupal base directory (i.e. http://192.168.1.111/drupal) and everything seems to work. Thanks for the help.
Best, Ed.
The most usual problems with
The most usual problems with Clean URLs are:
(1) A missing Drupal .htaccess file or an "AllowOverride None" directive in apache, which disables .htaccess files (of course these don't matter if you have moved Drupal's rewrites into an apache vhost file).
(2) A "RewriteBase /drupal" directive (required only if your URL path does not match a real filesystem path, e.g. because of an apache alias)
if you try any of this, you can test whether Clean URLs work by browsing, even while they are disabled in Drupal. The apache rewrites make them work, while the Drupal setting just makes the menu use them.