how to point two domains that share one IP to different folders using Webmin
Hi everyone,
I have a vps running with webmin with two domain names and one ip and I want to point each of the domains to different folders..
here's the instructions I followed:
■Go to your Webmin control panel.
■Upgrade to the latest version of webmin (required if you are running a version older than 1.080, and normally advisable regardless).
■Go to servers.
■Go to Apache WebServer.
■In the 'Create a New Virtual Server' section select "Any Address" (so you do not end up with a hard coded IP addresses in your conf file)
■Enter 80 for Port (and select the last radio button). This way the VirtualHost will co-exist with any SSL-enabled virtual hosts you add later on. SSL-enabled VirtualHosts need to listen on port 443.
■In the "Document Root" field enter where the virtual host HTML files will be. For example, /home/vhostdomain.com/htdocs.
■For "Server Name" enter the domain name for which you want to serve pages. e.g. "vhostdomain.com"
well it doesn't work, when I add the virtual server both domain redirect to the first folder listed in the servers list..
that's how my existing virtual hosts look like:
=================================
Default Server:
Defines the default settings for all other virtual servers, and processes any unhandled requests.
Address Any
Port Any Server Name Automatic
Document Root Automatic
Virtual Server:
Handles the name-based server www.bibo4pc.com on address *.
Address Any
Port Any Server Name www.bibo4pc.com
Document Root /var/www/bibo4pc
Virtual Server:
Handles the name-based server www.nisr73.com on address *.
Address Any
Port Any Server Name www.nisr73.com
Document Root /var/www/nisr73
Virtual Server:
Handles the name-based server on address *.
Address Any
Port Any Server Name Automatic
Document Root /var/www
Well, as I said, not too familiar with webmin. If you can show me the virtualhost entries from httpd.conf, I can help you correct the issues more directly.
I've set up many vservers on my local network but I'm not sure how the commercial hosts configure their systems.
With that in mind, I think your directory names have to match your domain names. They should be /var/www/www.bibo4pc.com and /var/www/www.nisr73.com. Also, you may have to wait for the host's cron to run and propagate the info to its name servers.
As an afterthought... if you set it up as above, http://www.bibo4pc.com will work but http://bibo4pc.com will not unless you do a rewrite in your .htaccess file.
With that in mind, I think your directory names have to match your domain names. They should be /var/www/www.bibo4pc.com and /var/www/www.nisr73.com. Also, you may have to wait for the host's cron to run and propagate the info to its name servers.
I don't think that's accurate. A vhost directly should be able to point to any directory on the system that the www/apache user has read+browse (execute) permission on. Also, vhost changes != DNS changes. If the A records for each of these domains point to the appropriate IP (they currently point to 66.197.135.104), then apache just needs to be configured to serve requests for those hostnames appropriately.
As I said, my experience with vservers is limited to my local network. I do remember in the hazy past, though. that I had some sort of problem that was resolved by making the host name the same as the directory root. You're right, of course, about the DNS, it propagates the other way.
Bookmarks