Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Mar 2004
    Location
    Virginia
    Posts
    76

    Default when going to http://sharedip it goes to the first site listed in httpd config

    When going to http://sharedIPhere it goes to the first site (or first virtual host intry) in the httpd config file...also if you go to http://sharediphere/~username/ at the bottom is says "Apache/1.3.31 Server at www.firstdomaininhttpdconf.com Port 80". How do I fix this? It should go to the hostname or something shouldn't it?

  2. #2
    cPanelBilly
    Guest

    Default

    Add whatever you would like to be there as the 1st virtualhost.

  3. #3
    Member
    Join Date
    Mar 2004
    Location
    Virginia
    Posts
    76

    Default

    Well, is there a better solution than that?

  4. #4
    cPanelBilly
    Guest

    Default

    Unfortunatly not, this is how Apache works.

  5. #5
    Member
    Join Date
    Jun 2004
    Posts
    78

    Default

    If you can work out all of your shared IP's on the machine, just add an include to apache with a dummy VirtualHost for each IP. Add that to the top of the virtualhost section of your httpd.conf

    eg

    Create the file : httpd.conf.shared

    NameVirtualHost 123.123.123.123:80
    <VirtualHost 123.123.123.123>
    ServerName default1.your_server_name.com
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>

    NameVirtualHost 123.123.123.124:80
    <VirtualHost 123.123.123.124>
    ServerName default2.your_server_name.com
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>


    The add an Include into httpd.conf (before your other VirtualHosts)

    Include /usr/local/apache/conf/httpd.conf.shared

    With servers with a lot of resellers that use their own shared IP's - that can be easier to manage than going into httpd.conf and adding them individually - You could make a script up to configure the default VirtualHosts (The ones you see when you go to your shared IP addresses http://123.123.123.123) quite easily.
    Last edited by zentity; 08-24-2004 at 09:01 AM.
    Dedicated Servers - Reseller Hosting
    cPanel Partner NOC - www.zentity.com

  6. #6
    GOT
    GOT is offline
    Get Proactive! GOT's Avatar
    Join Date
    Apr 2003
    Posts
    902

    Default

    We always make sure that the first virtualhost entry for the main server IP is set to the hostname and to point to /usr/local/apache/htdocs. If you do this, then the ~username portion will work fine.
    Proactive Server Monitoring and Management
    http://got-management.com

  7. #7
    Member
    Join Date
    Sep 2002
    Posts
    282

    Default here's a deadpan answer

    Quote Originally Posted by Nathan D.
    When going to http://sharedIPhere it goes to the first site (or first virtual host intry) in the httpd config file...also if you go to http://sharediphere/~username/ at the bottom is says "Apache/1.3.31 Server at www.firstdomaininhttpdconf.com Port 80". How do I fix this? It should go to the hostname or something shouldn't it?
    If you enter the sharedip, and it is shared(it belongs to several names at once) how can the server guess which one?

  8. #8
    Member
    Join Date
    Jun 2004
    Posts
    78

    Default

    Quote Originally Posted by perlchild
    If you enter the sharedip, and it is shared(it belongs to several names at once) how can the server guess which one?
    The server doesn't guess, it will use the first one First VirtualHost container for that IP) that it comes to within the httpd.conf file if you access via IP address.

    For further info on how VirtualHosts work with regards shared ips (Name Based), the apache docs should help there to understand how that works: http://httpd.apache.org/docs/vhosts/index.html
    Last edited by zentity; 08-27-2004 at 10:45 PM.
    Dedicated Servers - Reseller Hosting
    cPanel Partner NOC - www.zentity.com

Similar Threads & Tags
Similar threads

  1. how to force site to open as www.site than http://site
    By pankajarya in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-10-2011, 11:12 PM
  2. httpd config remain some config
    By activa in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 02-01-2008, 06:09 PM
  3. redirect http://www.site.com to http://site.com
    By Chew in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 08-06-2006, 07:51 AM
  4. httpd: [ != HTTP/1..] httpd has failed, please contact the sysadmin.
    By RoWebSolutions in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 02-18-2005, 04:05 PM
  5. Shared IP, first listed in httpd.conf
    By jeroman8 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-17-2004, 05:47 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube