Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th September 2006, 06:23
Dave Lane Dave Lane is offline
Junior Member
 
Join Date: Mar 2006
Location: Christchurch, New Zealand
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via ICQ to Dave Lane
Default Tip: URL Aliases vs. Redirects

This one had me stumped for a long time - how to use the ISPConfig interface to specify Co-Domains that should redirect vs. those that should simply be aliases...

Turns out it's easy, just not obvious.

Here's the scenario: I have a new hosting client who wants to run 2 separate Drupal sites off of one account, with two separate domains: domainone.com and domaintwo.com. Because of Drupal's "multisite" capabilities, I want requests for both domains to go to the same DocumentRoot /srv/www/clientXX/web/drupal but to do so with the original domain name intact - i.e. I want the virtual host configuration to direct requests for both domainone.com and domaintwo.com to that DocumentRoot without rewriting them. That's what I refer to as domain aliasing.

To complicate things, my clients want the www. subdomains to redirect to their respective naked domains, i.e. if a user types in the URL http://www.domainone.com - it should get to the right place, but the domain that's actually fed to Apache should be domainone.com (without the www).

The way to achieve this is as follows:
1. create a "new site" or go to an existing site you want to modify

First the alias:
2. choose one domain as the "master" domain for the ISPConfig site "basis" - let's say domainone.com
3. go to the co-domain tab and enter "new" co-domain
4. set the "domain" to be domaintwo.com - enter nothing else (no forward info or anything - this will be an alias to the default domain, domainone.com - but will not be rewritten to anything. This corresponds to simply creating a "ServerAlias" entry in the VirtualHost definition.

Now the redirects:
5. create a "new" co-domain, enter "www" for the host and "domainone.com" for the domain
6. then go to the "forward" tab and enter the full URL you want to redirect to: http://domainone.com - this will create the appropriate ServerAlias entry as well as the Rewrite rules.
7. repeat 5 and 6 for domaintwo.com

Hope that helps someone!

Dave
Reply With Quote
Sponsored Links
  #2  
Old 6th September 2006, 10:04
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,037
Thanks: 268
Thanked 152 Times in 132 Posts
Default

Nice one Dave, but can this not be done with a simple .htaccess rule, or am I misunderstanding your setup?
Reply With Quote
  #3  
Old 18th September 2006, 02:55
Dave Lane Dave Lane is offline
Junior Member
 
Join Date: Mar 2006
Location: Christchurch, New Zealand
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via ICQ to Dave Lane
Default

Hi Edge (if that's your real name ),

Yes, it probably can be done with a .htaccess file, but I was interested in seeing how it could be done within the ISPConfig framework - doing it that way makes management of many sites easier. When I found the way, I decided to document it for others.
Cheers,

Dave

Last edited by Dave Lane; 18th September 2006 at 03:01.
Reply With Quote
  #4  
Old 20th October 2006, 02:55
xavier xavier is offline
Junior Member
 
Join Date: Oct 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Another Drupal sub-domain question

Here's one that has me stumped: "Do I need to configure ISPCONFIG to see Drupal 'sub-domains' ?"

Drupal is extracted right in the /var/www/web5/web directory. I chose Drupal because of it's multisite feature, which seems like it doesn't require an actual subdirectory to the web root directory, but something isn't working. The drupal "sub-domains" are sharing a database with unique headers, and their URLS are configured like this:

drupal/sites/abcd/settings.php ...
$base_url = "http://abcd"
drupal/sites/abcd.def/settings.php ...
$base_url = "http://abcd/def"


But I get "page not found" Do I need to configure co-domains or new domains in ISPCONFIG for this to resolve properly?

Last edited by xavier; 20th October 2006 at 17:00.
Reply With Quote
  #5  
Old 20th October 2006, 16:50
xavier xavier is offline
Junior Member
 
Join Date: Oct 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drupal Multi-site and ISPConfig redirects -- linux solution!

I'm working on "Ubuntu 6.06 LTS ISP Server Setup" and have a default "Drupal CMS On An ISPConfig Server Within 10 Easy Steps"

I have a site http://abcd, configured in ISPConfig, this works fine.

Now i would like to enable a site http://abcd/def which will have its own Drupal table_prefixes, users, modules, themes - basically a site by itself.

The steps i followed were:
IN DRUPAL
- Modified settings. php as in previous post

IN ISPCONFIG
- Created a new site http://abcd/def
- In Co-domains, clicked on site and set up forward to the web doc root of http://abcd

NO DICE !! But a command line implementation worked ...

cd /var/www/web5/web
ln -s . def

That allows the web server to serve requests to the "def" subdirectory from the main drupal directory. The conceptual leap for me was that the "def" subdirectory is virtual: it only exists in Drupal's database, but if you want to send people to it, the webserver needs to have directions.

I'm sure there is a more sophisticated way to do this using .htaccess or perhaps even ISPConfig, but thought I would share my solution. It's quick!

Best,

x
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Email aliases problem rosa hsiao General 12 21st September 2006 17:01
creation of multiple aliases rantoniazzi Installation/Configuration 3 25th May 2006 17:29
Can't receive email for aliases sbecker Installation/Configuration 10 4th April 2006 17:51
Mail Redirects and Mailing Lists bogdinator General 1 22nd February 2006 19:31
Delivery failure when using aliases ggouts Server Operation 2 20th February 2006 10:17


All times are GMT +2. The time now is 05:15.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.