Skip to main content

Hostname goes to Default Web Page

Comments

10 comments

  • ItsMattSon
    Update on the above. Not sure why the DNS zone was there but it was so I deleted it and then made a new account for domain.com and logged into FTP and uploaded an index for it. As for srv.domain.com (hostname), not sure how I should be putting a splash on that if at all. I could login to domain.com's cPanel and then create a subdomain and put another splash in there via FTP? But again, not sure how this is *supposed* to be done, even if that would sort it.
    0
  • cPanelMichael
    As for srv.domain.com (hostname), not sure how I should be putting a splash on that if at all. I could login to domain.com's cPanel and then create a subdomain and put another splash in there via FTP? But again, not sure how this is *supposed* to be done, even if that would sort it.

    Hello, You can modify the template for the default website page using "WHM Home >> Account Functions >> Web Template Editor": Web Template Editor - Documentation - cPanel Documentation Is this what you are attempting to do? Thanks!
    0
  • ItsMattSon
    Hi @cPanelMichael, Close, but actually I was just wondering how I can put a splash page on my hostname address, since it resolves to the 'Default Webpage' (
    0
  • cPanelMichael
    There's a post here that should help: Server IP Address Note the following changes when modifying the configuration with EasyApache 4: Apache log format issue with EasyApache 4 Thank you.
    0
  • ItsMattSon
    Thanks @cPanelMichael. Can i confirm that I am meant to be making a copy of ea4_main.default as ea4_main.local and then editing that document somewhere? I noticed when trying to find the appropriate line, it said "DO NOT EDIT. AUTOMATICALLY GENERATED. USE INCLUDE FILES IF YOU NEED TO MAKE A CHANGE" so wasn't sure I'm editing the right file? Do i need to find the appropriate include? Sorry to come back so quickly on this one - I'm afraid I'm not 100% sure which file to edit or where in it.
    0
  • cPanelMichael
    Can i confirm that I am meant to be making a copy of ea4_main.default as ea4_main.local and then editing that document somewhere?

    Hello, Yes, once you make the copy, you then edit the /var/cpanel/templates/apache2_4/ea4_main.local file directly via the command line. However, there's actually an easier solution for a single VirtualHost change that you may find helpful. First, browse to: "WHM Home " Service Configuration " Apache Configuration " Include Editor" Edit "All Versions" under "Pre VirtualHost Include", and enter the custom VirtualHost for the IP address. EX:
    ServerName 1.2.3.4 DocumentRoot /home/example/public_html ServerAdmin root@hostname suPHP_UserGroup nobody nobody
    Replace the "DocumentRoot" value with the path of your choosing and click "Update". You may also want to add an additional VirtualHost entry with the same lines, except with port 443 instead of 80. Thank you.
    0
  • ItsMattSon
    Hi @cPanelMichael, Tried the WHM approach as that seemed cleaner for me and I thought that was going to be a winner but for some reason it actually didn't work. Where 1.2.3.4 was mentioned twice in your example, I used my Server IP (it's a shared IP that all my domains on my VPS use) in both those places; Then replaced the DocumentRoot path to /home/mydomainaccountname/public_html and; then copy/pasted the lot and changed the port to 443. Since it didn't work after restarting Apache, I removed ServerAdmin line altogether, as I understand it's not required and thought that might've been why but no dice. I then tried to hit
    0
  • ItsMattSon
    I might be clutching at straws here but could this be related? (a redirect on DocumentRoot of some sort?) stackoverflow.com/a/21441260
    0
  • ItsMattSon
    Hi @cPanelMichael, I couldn't figure that out so I went back to your original suggestion of editing the Templates which I'm actually pretty happy with. It is not a bad solution after all. I'd like to point out that I'm sure your answer was correct but it was probably something I couldn't figure out with my setup that was preventing your solution from doing as expected. Thanks for helping! Onto the next stage... :)
    0
  • cPanelMichael
    Hi @cPanelMichael, I couldn't figure that out so I went back to your original suggestion of editing the Templates which I'm actually pretty happy with. It is not a bad solution after all. I'd like to point out that I'm sure your answer was correct but it was probably something I couldn't figure out with my setup that was preventing your solution from doing as expected. Thanks for helping! Onto the next stage... :)

    I'm happy to see it helped. Thank you for updating us with the outcome.
    0

Please sign in to leave a comment.