For some reason the user directory I have for my server has stopped working whenever I go to http://server/~user/public_html/ I get a 404 error. The files are there on the ftp, but they're not showing up from the web.

It's strange because it was working just a while ago.

Any help?

  • 1
    Might wanna try serverfault. That's where the apache gurus are.
    – John Conde
    Aug 20, 2010 at 2:59
  • You don't normally access the public_html folder in the URL. This would imply that the document root of your site was the parent directory that contained the public_html folder, not the public_html folder itself - this itself would probably be a misconfiguration.
    – MrWhite
    Sep 30, 2015 at 9:59

2 Answers 2


Would you be able to post part of your httpd.conf (or included configuration if it's split into multiple files)?

Inside of it should be the "per user" configuration section, which defines which directory the servers looks for in a user's home.

For example, here is the default I normally have on my Apache servers:

  # Turn on userdirs
  <IfModule mod_userdir.c>
    UserDir public_html

    <Directory /home/*/public_html>
      Order allow,deny
      Allow from all

In this case as long as a user has a public_html directory, with permissions of 0711 (or at least 0755) - the read and execute bits of public_html must be set, along with at least the execute of their home directory - Apache will serve files from it with the proper permissions.

One other question, from your URL above of "server/~user/public_html/" - did you upload the files under the directory public_html/public_html? Otherwise, you should just drop the "public_html" part at the end, as Apache will automatically look under there.

That would make the URL http://server/~user/ and should work, unless your server has a non-standard configuration.

If none of the above works, check to see if you have directory indexes enabled, and remove any index files from your public_html; that should give you a list of all the files, to verify the structure!

  • Well it looks like dropping the public_html in the url worked. It's strange, though, because the public_html was necessary before now. Either way, it works now, so thanks!
    – GuyNoir
    Aug 20, 2010 at 17:14
  • No problem! The oddities of Apache confound me some times as well - perhaps there was a configuration change awhile ago, but Apache was never restarted to re-read it. Who knows, at least it works!
    – Absolute
    Aug 23, 2010 at 15:28

Check permissions on the directory, ownership of the directory, and the user Apache processes run under to make sure the directory is both readable and executable by Apache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.