On Wed, Mar 11, 2009 at 11:34 PM, Justin Pasher <justinp@xxxxxxxxxxxxxxxxxxx> wrote: > Tz-Huan Huang wrote: >> >> Hi, >> >> In our www server the /home/* is mounted automatically >> using autofs. >> >> When visiting a user's homepage via >> http://hostname/~user first time, the httpd says >> ``404 not found'', but after reloading page several times >> all thing works. >> >> Is there any way to avoid this annoying behavior but still >> using autofs? Thank you very much. >> > > I use autofs and LDAP myself to mount home directories, and I've never had > any problems with it, so I can't offer a direct solution. However, I can > offer some suggestions. Hi, Thank you very much for your suggestions. > 1) Do you ever have trouble doing an "ls /home/username" on a directory that > is not mounted? Does it properly mount the directory and give you a > directory listing? Let me describe our environment in detail. We have one main server running FreeBSD serves ldap/nfs/www, and 10+ clients running Debian mount /home via autofs. While some users need linux environment to run cgi, we select one of the clients and install apache on it. Besides the www services, there is no mounting problem for ssh usage. > 2) If you request the http://hostname/~username from a browser, get a 404 > error, then do an "ls /home", do you see the "username" directory mounted? Yes. I find that this might be not related to autofs -- while I have connected to the server via ssh and pwd is $HOME (so my $HOME is mounted), I might still get 404 when visit my homepage. > 3) After you successfully pull http://hostname/~username, unmount the home > directory (umount /home/username), then try your request again to see if it > gives out a 404 error again. I cannot do this test while I don't find a page that causes the 404 error at this point. The 404 error behavior is not predictable, sometimes it occurs when I visit the page fist time, but sometimes it just runs well whether it's the fist time visiting or after reloaded several times. I still try to figure out the pattern. > 4) Try restarting the autofs daemon (you have to make sure no home > directories are currently in use to be successful). Sometimes daemons can > just act up for no obvious reason. While there are many users loged in now, I'll try to restart autofs later to see if it helps. > All in all, signs point more to an autofs problem and not Apache. Thank you very much again, I'll continue monitoring the www services. I'll report here if I find anything new. Regards, Tz-Huan Huang --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx