Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Rep:
Apache DocumentRoot UserDir problem
I've seen other have similar problems getting user directories working. I'm seeing something a bit different than others have described, though, so here goes:
The Apache server version is 2.2.0 and was installed as part of the distribution (SuSE 10.x). I've previously had my main web server document tree located under /home/httpd/html so I changed DocumentRoot to point to that. I went into the configuration and disabled the UserDir record that read "UserDir disable root". There was already a record that read "UserDir public_html" that I left alone.
When any attempt to access a user's public_html directory using the normal "http://myhost.mydomain/~username/" URL, what I get in the log files is a message reading:
Code:
File does not exist: /home/httpd/html/~username
Well of course it doesn't exist. Apache is supposed to be -- according to the documentation on the Apache web site -- looking up username's home directory and appending the setting for Userdir. Not just tacking UserDir onto the end of DocumentRoot.
Is there some new Apache module that needs to be loaded/enabled to make UserDir work as before? If so, this is a major change to Apache. Otherwise, this is starting to look like a snafu on the part of the SuSE packagers.
Now there's some mention in the configuration file of the UserDir directive being used in virtual host configurations. I sure hope that this is not mandatory as I have no access to DNS configurations on the network and getting additional IP addresses is like pulling teeth (w/o anesthetic).
Aside: I never had this problem when I built my web servers, PHP, etc. from sources. That practice is, unfortunately, no longer practical since the darned distribution installers insist on installing their copy of Apache (or PHP, or whatever) or else you'll have unresolved dependencies all over the place.
Any help in resolving this would be greatly appreciated.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Original Poster
Rep:
Quote:
Originally Posted by davesmith
http://httpd.apache.org/docs/2.2/howto/public_html.html should be a good start.
Check that the mod_userdir is loaded
I've been to that page and the settings of UserDir appears as shown in that tutorial. I will check the loaded modules on that system and see if mod_userdir is even getting loaded. I'm doubting that it is. I just checked on another system -- running 2.2.3 -- and mod_userdir was not being loaded. I had to be add it to /etc/sysconfig/apache2 (in APACHE_MODULES="module1 module2 ..."). I expect the same change will have to be made on the system where I originally had the trouble.
I would have expected a change this significant to have been part of 2.0.x. Probably some ugly security hole needed to get fixed before the next major version number change. Oh well, I can appreciate that. Wonder what else changed? Looks like I got some more readin' to do.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Original Poster
Rep:
Well... got one Apache installation fixed...
... just not the one that I originally posted about. That one doesn't seem to be loading the module. But, when I add it to the list of desired modules in /etc/sysconfig/apache2, I get a syntax warning from apache2ctl that the userdir module is already loaded. I'm not sure why it thinks that that module is already loaded since the user directories are still not accessible by using the "http://site/~user/" URLs. Apparently, there is/was something different between the two systems. Maybe the changelogs from 2.2.0 -> 2.2.1 -> 2.2.2 -> 2.2.3 will reveal something but I'm thinking more along the lines of the 2.2.0 default config files being, um, screwy.
In the other server, is the UserDir directive in the global configuration, or is it in a virtual host like the one you're trying to get working? Could it be something along those lines?
Looking across a few other posts here, you don't have SELinux running do you? Actually that would result in a permissions denied problem, not the problem you're having of it not resolving to the user's public_html folder... would it?
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Original Poster
Rep:
Quote:
Originally Posted by davesmith
In the other server, is the UserDir directive in the global configuration
On the system with a working UserDir parameter, it's in "default-server.conf".
Quote:
...or is it in a virtual host like the one you're trying to get working?
Neither system is using virtual hosts. Yet. The one that I got working usually does have some virtual hosts defined on it that I use for testing. But, even in those, I normally just leave UserDir defined globally to "public_html". The system on which I haven't been able to get UserDir to work will likely never have virtual hosts defined.
I don't think I mentioned it when I reported the error message about the module already being loaded, but it doesn't appear that any modules actually loaded. I've tried
Code:
apache2ctl -t -D DUMP_MODULES
and it returns nothing. Well, OK, it returns that error message about the "userdir" module already being loaded or something like that but no list of modules. (I can post the exact message tomorrow. Hopefully, the firefighting will be at a minimum and I can look into this over lunch. )
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.