Skip to main content

Hosting files on hostname

Comments

9 comments

  • cPanelLauren
    Hi @inteldigital By default, the hostname will use the default page. You could use WHM>>Account Functions>>Web Template Editor to modify the default website page to add the information you want. We have documentation on this here: Web Template Editor - Version 70 Documentation - cPanel Documentation Thanks!
    0
  • inteldigital
    Hi Lauren, Thanks again for your timely response, I do realise I can alter the default pages this way. But I am trying to host files on the hostname, just as you would any other website. I have dependencies that would not work inside the template editor, not only that but it would show these files in places I don't want them to appear. So to avoid this, I am trying to find out how to serve the files at the hostnames domain/URL.
    0
  • cPanelLauren
    Hi @inteldigital The documentroot is for the hostname is /var/www/html/ you could add your files there but you'd need to ensure that they're owned by the nobody user + group I tested this on my own server by doing the following: 1. I went to WHM>>Service Configuration>>Apache Configuration -> directory index priority and ensured that index.php was the top (that way an index.html won't take precedence.) 2. I created an index.php file and added some text to it touch index.php
    3. I ran the following to change the UID and GID of the file: chown nobody. index.php
    Please keep in mind this configuration while possible to implement is not directly supported by cPanel.
    0
  • inteldigital
    Hi Lauren, But then, won't the index.php show for every default page instead the index.html? I only want to show the (hypothetical) index.php on the hostname URL and everywhere else, the default cPanel template. Will this accomplish this task? Also, to note, it is an entire folder of content with .js and .css files plus one single index.html that I am trying to host. :) @cPanelLauren
    0
  • cPanelLauren
    Hello, Yes, that would be correct, that's the problem you're going to run into with any modifications you make to the hostname, of this nature as far as I understand it. In testing on my personal server, I am unable to make modifications to the hostname without it affecting the default page as a whole. Thank you,
    0
  • inteldigital
    @cPanelLauren Hi Lauren, Actually come to think of it, this wouldn't be such a bad thing I don't suppose. It would only affect the default page wouldn't it, as the error pages still exist. So, in theory, when would anyone see this page (aside from going directly to the hostname URL?) Regards, Ben
    0
  • cPanelLauren
    Hi Ben, That's correct, it wouldn't affect the other error pages. Only people who receive the default page would see the error. So if you had a domain that was pointed to your server but no account existed for it just yet you would also get the custom page. Thank you,
    0
  • inteldigital
    Hi Ben, That's correct, it wouldn't affect the other error pages. Only people who receive the default page would see the error. So if you had a domain that was pointed to your server but no account existed for it just yet you would also get the custom page. Thank you,

    @cPanelLauren Hi Lauren, Thanks for your help here, this is the solution I'm looking for. Have a great day. Regards, Ben
    0
  • cPanelLauren
    I'm glad to hear that! You're very welcome, I'm glad I could help.
    0

Please sign in to leave a comment.