Skip to main content

User home directory as document root of a domain with WHM/cPanel

Comments

11 comments

  • kodeslogic
    After modifying files have you Rebuild the Apache conf and reload the Apache configuration? /scripts/rebuildhttpdconf service httpd graceful
    Then clear your browser cache and refresh the page.
    0
  • 2h1n846
    Yes, already did it.
    0
  • cPanelAaronH
    Hello, Is adding the new domain as an addon domain, and then setting the users ssh path to their domain folder be an option for you?
    0
  • 2h1n846
    Hello, Is adding the new domain as an addon domain, and then setting the users ssh path to their domain folder be an option for you?

    yes, already tried this but I am just getting "404 not found"
    0
  • cPRex Jurassic Moderator
    In general, there are going to be many configuration conflicts between a standard Linux user and a cPanel user with hosting. cPanel creates many files to ensure things get setup properly in WHM, cPanel, Apache, PHP, DNS, MySQL, and other services, so trying any manual workarounds like this is something we don't test as it's not supported. It would be better to undo any previous work and then try to create the addon domain to see if that gets things working how you expect. That would ensure all the necessary files for Apache are in place. If you are geting a 404 error, it may also be worth it to check the Apache logs at /etc/apache2/logs/error_log to see if that gives you more details about what the problem may be.
    0
  • 2h1n846
    In general, there are going to be many configuration conflicts between a standard Linux user and a cPanel user with hosting. cPanel creates many files to ensure things get setup properly in WHM, cPanel, Apache, PHP, DNS, MySQL, and other services, so trying any manual workarounds like this is something we don't test as it's not supported. It would be better to undo any previous work and then try to create the addon domain to see if that gets things working how you expect. That would ensure all the necessary files for Apache are in place. If you are getting a 404 error, it may also be worth it to check the Apache logs at /etc/apache2/logs/error_log to see if that gives you more details about what the problem may be.

    Already done this and got the same 404 error... Removed DNS entry for the domain, added the domain again as addon domain then pointed outside of cPanel home, updated the directory owner,group, permission...nothing helped And no error log for the target domain in apache error_log found if I point the domain outside of the cPanel home directory. I just couldn't figure it out and quit...
    0
  • cPRex Jurassic Moderator
    If you'd like our team to look into that a bit more for you, feel free to submit a support ticket using the link in my signature and we can check it out.
    0
  • 2h1n846
    If you'd like our team to look into that a bit more for you, feel free to submit a support ticket using the link in my signature and we can check it out.

    Well, I already did that too!! Unfortunately, that guy from the support team just quit as well saying something like, "This is not a part of cPanel functionality so I am not resolving this..."
    0
  • cPRex Jurassic Moderator
    Any chance you could get me the ticket number? While I do agree the core issue isn't part of cPanel's functionality, we may be able to come up with something else.
    0
  • 2h1n846
    Any chance you could get me the ticket number? While I do agree the core issue isn't part of cPanel's functionality, we may be able to come up with something else.

    Here it is: #93880516 The addon domain (sub domain got from AWS) "ec2-x-x-x-x.compute-1.amazonaws.com" is currently pointed under cPanel directory...but you can point it to any SSH user directory you see under /home for testing purpose.
    0
  • cPRex Jurassic Moderator
    Thanks for that :D Is it possible there is a caching issue on your side causing a problem? When I visit the full URL in the ticket on my end I get taken to a password prompt, and I do see there is a .htpasswd file on the account. Could you try this work from a different browser just to rule that out?
    0

Please sign in to leave a comment.