Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Sep 2003
    Posts
    158

    Default unhosted domain pointed at server leads to first account not /usr/local/apache/htdocs

    New whm/cpanel server has one weird thing:
    if someone points a domain at the main namebased hosting IP and there is no account setup for it, it loads the first-created namebased site (i.e. it loads /home/account1/www/)

    So if you remove an account and they're doing their own dns, now that domain shows another account. It should show the default page at /usr/local/apache/htdocs/index.html

    In the httpd.conf whm builds this:
    <VirtualHost *>
    ServerName hostname.mydomain.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin email removed
    </VirtualHost>

    If I change it to
    <VirtualHost main.server.ip.number:80>
    ServerName hostname.mydomain.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin email removed
    </VirtualHost>
    it works as I expect it should (if a domain is pointed at the server's namebased IP and it's not created yet or deleted, it shows the default server page not another account.)

    In the old days I would edit the httpd.conf to change something like this, but now with easyapache I need some direction on how to fix this so it doesn't get unchanged the next time apache is built. Many thanks in advance.

  2. #2
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Wink

    You might want to look over the docs.
    http://www.cpanel.net/support/docs/ea/ea3/index.html

  3. #3
    Member
    Join Date
    Sep 2003
    Posts
    158

    Default

    Quote Originally Posted by Infopro View Post
    You might want to look over the docs.
    http://www.cpanel.net/support/docs/ea/ea3/index.html
    Thanks Infopro.

    Searching the docs, it seems simply editing /var/cpanel/templates/apache1/main.default makes it easy to make the change stick.

    Edit: something else seems to be in play here -- maybe a bad apache build last time even though I did not see any errors.

    It struck me as odd that the way it worked and the way the comment tag implied it should work were in conflict, so I tried backing it out and rebuilding a third time and now it works as designed and in practice I think.

    In the generated httpd.conf I now have

    # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
    NameVirtualHost main-server-ip:80
    NameVirtualHost *
    # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

    <VirtualHost main-server-ip:80>
    ServerName hostname.servername.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin removed
    </VirtualHost>


    # Default vhost for unbound IPs

    <VirtualHost *>
    ServerName hostname.serverdomain.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin removed
    </VirtualHost>

    The top section was not there before... weird.
    Last edited by boatdesign; 02-26-2009 at 05:20 PM.

Similar Threads & Tags
Similar threads

  1. Replies: 4
    Last Post: 03-31-2009, 10:04 PM
  2. File does not exist: /usr/local/apache/htdocs/whm-server-status
    By linux4me in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 11-14-2007, 01:11 PM
  3. CPanel blatently advertising in your /usr/local/apache/htdocs
    By porcupine in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 03-20-2004, 10:34 PM
  4. puzzled? /usr/local/apache/htdocs/index.html
    By earthquakie in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-18-2003, 08:02 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube