Hostname goes to Default Web Page
Hi guys,
Note quickly that I have read this thread here and it was enlightening but my query I feel is a little different. Just chasing the "correct" procedure, I suppose.
My hostname srv.domain.com goes to the Default Web Page .cgi and so does the actual domain domain.com so I was wondering if there was a guide on how to make those URLs show specific splash pages.
I tried to create a new account in WHM for domain.com but it didn't allow me (because of DNS zones, or something to that effect). Presume it already has entries for the domain name, I'm not sure.
What would be the right way to change the splash page for your hostname and the domain name? (not looking to modify the default web page, by the way)
-
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 -
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 -
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 -
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 -
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 -
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 -
I might be clutching at straws here but could this be related? (a redirect on DocumentRoot of some sort?) stackoverflow.com/a/21441260 0 -
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 -
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.
Comments
10 comments