The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How does Apache know where to direct web requests?

Discussion in 'EasyApache' started by advantec, Oct 1, 2013.

  1. advantec

    advantec Registered

    Joined:
    Oct 1, 2013
    Messages:
    0
    Likes Received:
    0
    Trophy Points:
    0
    cPanel Access Level:
    Reseller Owner
    I'm new to cPanel, and Linux based hosting. Doing pretty good, but I can't figure this thing out:

    I have mydomain.com as my primary domain; new.mydomain.com points to my primary IP. I also have an A record for x.mydomain.com pointing to my shared IP (which is different from my primary IP) - I (want to) use it for new website development, I can tell clients to go to x.mydomain.com/~whatever, and they can see what I'm working on. That works fine, except, if you go to x.mydomain.com - you will get, by default the same content as x.mydomain.com/~client2 ...

    (I should also note - if I browse to new.mydomain.com I get the "Default Website Page" that comes with cPanel - which would be expected)

    I could probably fix it, by deleting the A record, then creating a CNAME to point to a specific folder, but I don't really want to do that. Mainly, I want to understand how it works...

    I tried to publish a website in the mydomain.com section of cPanel - I thought that would give Apache something to point to, but that didn't make a difference.

    How does Apache know where to point web requests? If there's something wrong, what can I edit to fix it?
    Also, (out of curiousity) how can a web request for the primary/root account by default point to an entirely different account's website (in this case, that of client2)?

    Thanks to all who reply!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Are you sure the shared IP address is not a dedicated IP or the only IP address assigned to an account? It's likely configured as a dedicated IP address. Thus, any attempts to access it directly, or to access websites pointing to it with no Virtual Host will point to the default cPanel page. Rather than setting up a manual "A" record for your subdomains, have you considered creating them as their own accounts or as subdomains under an existing account? You may also want to try rebuilding the Apache configuration file via:

    Code:
    /scripts/rebuildhttpdconf
    Thank you.
     
Loading...

Share This Page