Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

For some reason the user directory I have for my server has stopped working whenever I go to 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?

share|improve this question
1  
Might wanna try serverfault. That's where the apache gurus are. –  John Conde Aug 20 '10 at 2:59
add comment

2 Answers

up vote 2 down vote accepted

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
    </Directory>
  </IfModule>

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!

share|improve this answer
    
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 '10 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 '10 at 15:28
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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