dcsimg
www.webdeveloper.com
Results 1 to 8 of 8

Thread: how to point two domains that share one IP to different folders using Webmin

  1. #1
    Join Date
    Aug 2006
    Posts
    152

    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


    am I doing sth wrong?

    TY...

  2. #2
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Not too familiar with webmin ... Did you restart apache? Does webmin automatically restart apache when it makes these changes?

  3. #3
    Join Date
    Aug 2006
    Posts
    152
    yes I restarted it..

  4. #4
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    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.

  5. #5
    Join Date
    Apr 2010
    Posts
    213
    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.

    I hope that helps.

  6. #6
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    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.

  7. #7
    Join Date
    Apr 2010
    Posts
    213
    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.

    Good luck with the project

    P.S. - I think the ports should also be set to 80
    Last edited by Chipzzz; 05-04-2010 at 12:24 AM.

  8. #8
    Join Date
    May 2010
    Posts
    1
    Thanks for sharing!!


    Managed Service provider

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles