Skip to main content

Cannot serve directory /home/public_html: No matching DirectoryIndex (index.html,index.php) found, and server-genera

Comments

18 comments

  • cPRex Jurassic Moderator
    Hey there! That error indicates that there is no readable index page in the directory that is specified as the document root for the domain. Normally the Apache server would expect to see an index.html or index.php file in the /home/user/public_html directory that it can read, but in your case that file is not there. The second part of the message is just letting you know that a directory listing, which can show the contents of your directory if there is no index page, has also been disabled. Let me know if that helps!
    0
  • MrDodd
    Thanks for the support, look I have the htaccess in the root of my project with these rules. Are they well defined? Options -Indexes RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA,L]
    0
  • cPRex Jurassic Moderator
    That seems like a standard .htaccess file. Is the index file also present in the directory?
    0
  • MrDodd
    That seems like a standard .htaccess file. Is the index file also present in the directory?

    yes is, it
    0
  • MrDodd
    That seems like a standard .htaccess file. Is the index file also present in the directory?

    Yes the index also present in the directory.
    0
  • cPRex Jurassic Moderator
    Is the actual error you're seeing referencing /home/public_html or /home/username/public_html?
    0
  • MrDodd
    Is the actual error you're seeing referencing /home/public_html or /home/username/public_html?

    Is the actual error referencing /home/public_html
    0
  • MrDodd
    Is the actual error referencing /home/public_html/myWebApp

    0
  • cPRex Jurassic Moderator
    That is likely the issue then, as that directory would not exist. cPanel expects all web content to be underneath /home/username/public_html so you may need to update your tool to check that area of the server.
    0
  • MrDodd
    That is likely the issue then, as that directory would not exist. cPanel expects all web content to be underneath /home/username/public_html so you may need to update your tool to check that area of the server.

    mmm. OK thanks
    0
  • cPRex Jurassic Moderator
    Alternatively, if the software really is configured at /home/public_html, that would need to be moved inside a cPanel user account area in order to be accessible on the web.
    0
  • MrDodd
    Hello, can someone help me with this ..! 1. my custom autoloader doesn't work on linux, but it does on windos. I don't use a composer
    0
  • cPRex Jurassic Moderator
    @MrDodd - we'd need some more details to be able to help. Can you get me information about the autoloader system and any error messages you're seeing?
    0
  • MrDodd
    @MrDodd - we'd need some more details to be able to help. Can you get me information about the autoloader system and any error messages you're seeing?

    Hello CpRex, I'll explain what happens to me, I have a project which I develop in window 10, the project works perfectly, when I migrated it to the hosting it began to give an error due to various issues which linux does not allow. 1. The issue of upper and lower case 2. Namespaces I had to lowercase every example: (Src \ User to src \ user), now no error but autoloader not working.
    0
  • MrDodd
    Hello CpRex, I'll explain what happens to me, I have a project which I develop in window 10, the project works perfectly, when I migrated it to the hosting it began to give an error due to various issues which linux does not allow. 1. The issue of upper and lower case 2. Namespaces I had to lowercase every example: (Src \ User to src \ user), now no error but autoloader not working.

    this is the autoloader function autoload_once($class){ $path = str_replace('\\','/',$class.'.php'); if(!is_readable($path)) exit("Error al intentar cargar esta clase: $path"); require_once $path; } spl_autoload_register('autoload_once'); this work in windows perfectly
    0
  • cPRex Jurassic Moderator
    Unfortunately I don't have much info I can provide for this. I wouldn't necessarily expect a Windows application to work well in a Linux environment, so you may need some additional development work to happen on the Linux side of things in order to get that working.
    0
  • FrankCEzene
    I uploaded a nextjs out file to cpanel and configured .htaccess file as follow: RewriteEngine On RewriteBase / RewriteRule ^index\.html$ " [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule . /index.html [L] . I get a 500 internal server error and in log I see: cannot serve directory /home/oxbourn1/public_html/: No matching DirectoryIndex. I don't know what to do here.
    0
  • cPRex Jurassic Moderator
    @FrankCEzene - cPanel doesn't have any support for nextjs tools, so it's not surprising that the system doesn't recognize it. Apache is still looking for an index.html or index.php file in the user's home directory in order to display content. The best information I have would be at these two links:
    0

Please sign in to leave a comment.