Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2002
    Location
    Toronto, Canada
    Posts
    11,059

    cPanel before DNS propagation

    When I get a new hosting customer, in my Welcome Email, I tell them that before DNS propagation, they can point to their site at http://IPaddress/~username . This is a shared hosting account, BTW.

    Pointing to the above address works, but the URL in the address bar changes to http://www.anothercustomer.com/~username where anothercustomer.com is another customer that I have on the server.

    Why does it do that? I think someone told me once before that cPanel automatically defaults to the first site that was ever set up on that server. Frankly, I don't know if this is true, because I can't remember the first domain I set up on this server.

    Nonetheless, how do I change this? This customer (anothercustomer.com) emailed me asking why he sees traffic in his logs that are a result of other sites. It's not much BW used, but if I had a choice, I'd rather change it to point to one of my sites.

    So how do I address this?

    Vito
    DemoDemo.com - Flash tutorials since 2002
    DemoWolf.com - 5,300+ Flash tutorials for hosting companies, incl. Voice tutorials

  2. #2
    Join Date
    Feb 2003
    Location
    Providence, RI
    Posts
    1,512
    The first 'website' ever setup in the server should most likely be your hostname, therefore, most cpanel servers will forward the address ip_addr/~username to <hostname>/~username. I am pretty positive about this, at least all my servers act as it is.

    To see what website is first created, login as root - click Show IP Address Usage under IP functions in WHM. You will see bunches of domain names right beside your main server IP. The first appears in the list should be the first website you created. As I said, all my servers appear the server hostname.

    In WHM, there is also a new feature called 'Tweak Security' - 'mod_userdir Tweak'. Try include the protection in all websites except for "DefaultHost" (if you have one). One of my servers do not have that, but it has the server hostname (The first domain in the list.)

    That's pretty much I know. Let me know if this helps, I am sorry if it doesn't.

  3. #3
    Join Date
    Jan 2002
    Location
    Toronto, Canada
    Posts
    11,059
    Thanks for the info. I've learned something new.

    However, I'm still unclear on what to do to change the "default" site from my customer's site to one of my sites. I looked at "mod_userdir Protection" but I'm not clear on what to do.

    BTW, when I clicked "Show IP Address Usage", indeed the very first site that showed up was the one that seems to be the "default" site used. The problem is that I want to change that to one of mine...

    Vito
    DemoDemo.com - Flash tutorials since 2002
    DemoWolf.com - 5,300+ Flash tutorials for hosting companies, incl. Voice tutorials

  4. #4
    Join Date
    Oct 2002
    Location
    Brooklyn NY
    Posts
    817
    Go to your httpd.conf and move your virtualhost up so it becomes the first one under NameVirtualHost. That will make it the default.
    Why do they call them fingers? I never seen them fing. Oh, there they go.

  5. #5
    Join Date
    Feb 2003
    Location
    Providence, RI
    Posts
    1,512
    As interesting as this is, I've looked around the cpanel scripts and found the solution as below:

    vi /usr/local/apache/conf/httpd.conf
    /<VirtualHost main_ip> ; search for the line in vi editor

    It should appear similiar as below:

    <VirtualHost main_ip>
    BytesLog domlogs/somedomain_or_servername-bytes_log
    ServerName somedomain_or_servername
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>

    Change the value of somedomain_or_servername to the name you want your clients to be redirected to when they hit http://<ip_address>/~client_username

    /sbin/service httpd restart

    Make sure you have an A record for whatever name you have setup above. So edit the DNS entry and restart DNS service.

    To double make sure, /sbin/service cpanel restart

    Then now login to WHM as root, view the Show IP Address Usage, your new name should be appear in the first place of the list.

    Then it's all set. I hope this solves the problem.

  6. #6
    Join Date
    Jan 2002
    Location
    Toronto, Canada
    Posts
    11,059
    Damn. I just knew you guys would end up telling me to SSH into my site to fix the problem. I really REALLY suck at shell commands. If I have to, I suppose I will have to do it. But is there a way to do it within WHM instead?

    Vito
    DemoDemo.com - Flash tutorials since 2002
    DemoWolf.com - 5,300+ Flash tutorials for hosting companies, incl. Voice tutorials

  7. #7
    Join Date
    Feb 2003
    Location
    Providence, RI
    Posts
    1,512
    I don't think you can edit the httpd.conf via WHM. Unless you have setup your ftp configuration at some point to allow root ftp into the server. Then you can download the file and edit on your computer, upload it, restart services through WHM.

    Follow these steps, you will have it done at no time.

    - Download Putty - Run it - type <yourserverIP> into the Host Name field - select SSH - click Open

    - Whatever warning message pop up, just click Yes. Then enter your username as root, and your root's password.

    - In the shell, type vi /usr/local/apache/conf/httpd.conf

    - Then in vi editor, type /<VirtualHost main_ip>. This is to search for the matched string. Of course, replace the 'main_ip' to the real ip address.

    - The configuration should look like the following:

    <VirtualHost main_ip>
    BytesLog domlogs/somedomain_or_servername-bytes_log
    ServerName somedomain_or_servername
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>

    - Click i. This allows you to type.

    Then you can edit them just link you edit a document at Microsoft Word.

    - After you have done, click Esc, follow by :wq. This step will save the file and quit the vi editor.

    - Then, login to WHM as root and restart Apache.

    I've checked all the mis-typed thing, so just follow exactly the command I used in bold

  8. #8
    Join Date
    May 2001
    Location
    Dayton, Ohio
    Posts
    4,903
    Originally posted by vito
    Damn. I just knew you guys would end up telling me to SSH into my site to fix the problem. I really REALLY suck at shell commands. If I have to, I suppose I will have to do it. But is there a way to do it within WHM instead?

    Vito

    Afraid thats all you can do to fix this...
    -Mat

Related Posts from theWHIR.com

Posting Permissions

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