By theorichel on
In order to have the multisite option working and with drupal in a subdirectory, one must make domain www.example.com resolve to www.mydomain.com/drupal .
Can I do that only in httpd.conf?
Many thanks for answering this post since instead of configuring Drupal (which is rather easy) I have been struggling with this problem for a long time.
Theo Richel
Comments
Resolution != delivery
Domain resolution is responsibility of the Domain Name System (DNS), which translates human-readable names (foo.example.com) to 4-byte numbers (192.200.1.2).
A single IP address can serve requests for multiple HTTP domains. The usual method is "name-based virtual hosting."
As of HTTP 1.1, Web browsers send not only the request, but the domain being requested. This allows the webserver to know the difference between a request for index.php from "foo.example.com" and "bar.example.com."
Typically, each domain is served from a different directory structure. When you make use of Drupal's so-called multisite option, you serve all the domains from the same directory.
Yes, this can be accomplished through httpd.conf (or a file that is included in httpd.conf), and if you're using name-based virtual hosting, then httpd.conf is the only way you can do it.
However, depending on how your domain is configured, this may not be necessary, depending on how cheap your hosting provider might be. Drupal actually lets you do this without using name-based virtual hosting.
Here's how to check: Find out the IP address of your website. Hit that address with your Web browser, without using your website's name.
If your Drupal site comes up, then you are not using name-based virtual hosting. You have your very own IP address.
If that's the case, all you need to do is create a DNS entry for your other website(s), pointing them to your primary website's address.
The safe way to do this in DNS is a CNAME record, which aliases one name to another, rather than an A record, which aliases a name to a number. When the client computer looks up and address and gets a CNAME entry, it recursively looks up the corresponding name until it gets to an A record.
This allows your base A record to be changed without your having to run around chasing all your secondary sites' DNS records.
Thank you. I have tried your suggestion
I do have a fixed webaddress ( 65.18.139.113 ). When I hit that, the root of my site ( www.richel.org ) opens (which is not drupal). I have drupal in a subdirectory ( www.richel.org/drupal ) and I want www.baszeeland.org to resolve to that.
Both my regular domain www.richel.org and baszeeland.org (parked) now point to the root of my site and now I want the directory www.richel.org/drupal/sites/www.baszeeland.org to respond to browsers looking for www.baszeeland.org
Could you be a bit more specific? I wouldnt know which dns to alter.
IN that case ...
... you need both DNS and the server configured properly. I just checked and you already have them pointing to the same IP, so the DNS part is finished.
To configure Apache, see the Apache documentation.
'to configure apache'
Thank you but I do not understand that link at all. Should I go into httpd.conf?
Yes
Yes. To configure Apache to serve multiple websites from the same document root, you need to edit httpd.conf or a file that it includes. (With some Linux installations that would be vhosts/Vhost.conf immediately below the directory containing httpd.conf.)