Skip to main content

Configuring a virtual host

Comments

7 comments

  • epanagio
    I looked in httpd.conf and there is a virtual host included for every domain. If I were to include a httpd-vhosts.conf that would override the cpanel's entry I am guessing that I would include it AFTER the cpanel's generated entry in httpd.conf?
    0
  • epanagio
    After adding a virtual host the documentroot is not served properly. httpd restarts without errors. NameVirtualHost *:80 ServerAdmin DocumentRoot "/home//public_html/wordpress" ServerName ServerAlias www. ErrorLog "/usr/local/apache/logs/a-name_log" CustomLog "/usr/local/apache/logs/a-name-access_log" common When I go to domain name it does not shows me the contents of the documentroot path, instead, I get the contents of the domain name, which is a list of directories.
    0
  • quietFinn
    Read here how to change the documentroot:
    0
  • epanagio
    Thanks, quietFinn. Fixed!
    0
  • cPanelMichael
    Hello :) I am happy to hear the solution in that post was able to help you. Thank you for letting us know the issue is resolved.
    0
  • Anuj Kushwaha
    Read here how to change the documentroot:
    0
  • cPRex Jurassic Moderator
    @Anuj Kushwaha - you may not have the level of access necessary to perform that work if you only have cPanel access and not root access to the system. The modern installation guide can be found here, so I'd recommend reviewing that and seeing if your server meets the requirements: How to Install a Node.js Application | cPanel & WHM Documentation but there are things in there that require root access to the system.
    0

Please sign in to leave a comment.