Since I've had this problem myself but cannot reply to old threads, I thought I'd post the answer here as it could save some time for someone looking for a similar solution.
Problem: How to edit the auto-generated default virtual host entry on httpd.conf?
Answer: You can't edit the default virtual host, but you can override it..
EDIT: Actually you can (and probably should).. see Tristan's post below.
Note that you may still use this "hack" for temporary testing and such, if you wish to avoid getting your hands dirty on the shell.
The way to do this is using the pre virtual host includes to match your domain/ip in a more specific way than the catchall default entry:
If you want to "mimic" a specific user account, just copy that account's virtual host entry, and be sure to update it's respective ServerName/ServerAlias to whatever domains/ips you wish to bind it to.
Of course that, if you change any setting on that account you will have to manually update here as well.
Hope this helps
Daniel Brinca
Problem: How to edit the auto-generated default virtual host entry on httpd.conf?
Answer: You can't edit the default virtual host, but you can override it..
EDIT: Actually you can (and probably should).. see Tristan's post below.
Note that you may still use this "hack" for temporary testing and such, if you wish to avoid getting your hands dirty on the shell.
The way to do this is using the pre virtual host includes to match your domain/ip in a more specific way than the catchall default entry:
- On WHM, go to Main >> Service Configuration >> Apache Configuration >> Include Editor
- On the "Pre VirtualHost Include" section, select the global configuration (i.e. "all versions")
- Enter your new vhost entry, making sure the ServerAlias directive includes all domains/ips you want to override
Code:
<VirtualHost 1.2.3.4:80>
ServerName domain
ServerAlias 1.2.3.4
DocumentRoot /home/username/public_html
ServerAdmin [email protected]
</VirtualHost>
Of course that, if you change any setting on that account you will have to manually update here as well.
Hope this helps
Daniel Brinca
Last edited: