Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Been trying to Google this, but I can't figure out good search terms to find any info about what I need, since I don't really know what it's called.

I'm pretty much being thrown to the wolves to figure out how to set up a LAMP server. We had someone who knew how to do it, he set one up and then quit. It was set up so that when I went to "http://{myservername}.com/~travis" it showed the contents of my /home/travis/public_html folder. This worked fine, then we lost power and the server restarted (I know, battery backup, but this is a dev server in a dev building so it's OK). Now, the browser can't find that URL.

I also need to know how to set this up on a new server, so instead of wasting time diagnosing this problem (probably just something dumb I did messing with settings or something), I really need to know how to set this up from scratch.

Thanks for taking the time to read this and (hopefully) answer!

share|improve this question
    
Which webserver are you using? –  Christoffer Madsen Jun 1 '10 at 15:31
1  
"LAMP server" = Linux + Apache + MySQL + PHP –  Sean Edwards Jun 1 '10 at 15:38
add comment

1 Answer

up vote 2 down vote accepted

In Apache it's called mod_userdir.

http://httpd.apache.org/docs/1.3/mod/mod_userdir.html

Just the one config directive, as long as mod_userdir is loaded. To mimick your old setup, it should be:

 UserDir public_html

Assuming your users homedirs are all in /home

(Edit) It's a little different in Apache 2.2. Here's the link to those docs: http://httpd.apache.org/docs/2.2/mod/mod_userdir.html

But the config is exactly the same:

UserDir public_html
share|improve this answer
    
I know this is the answer, but I need it dumbed down if possible, as I am still in the process of learning everything...including Linux. I created a link from /etc/apache2/mods-enabled/userdir.load to /etc/apache2/mods-available/userdir.load, added "<Directory /home/*> Allow from All </Directory> UserDir public_html" to /etc/apache2/httpd.conf (which was empty, so now all it has is that), and restarted apache using "/etc/init.d/apache2 restart". I have no doubt that one of those steps was wrong. I'm using Ubuntu with a standard installation, no special stuff going on that I know of. –  Travesty3 Jun 1 '10 at 16:31
    
Take a look in /etc/apache2/mods-available/userdir.conf. In Apache2 nothing really needs to go in httpd.conf anymore. Take that stuff out and symlink userdir.conf as well and you should have all the configuration you need. (a2enmod is a nice little app that will do all that symlinking for you: 'a2enmod userdir' / The antonym to that is a2dismod, which works the same way. They stand for 'Apache2 enable/disable module'.) –  Sean Edwards Jun 1 '10 at 17:17
    
For some reason that wasn't working on my dev server even though it should have. I got sick of messing with it so I reinstalled Ubuntu, created the public_html directory in /home/travis, ran a2enmod userdir, and restarted apache and it worked fine. Not sure what my complication was before. Thanks for your help! –  Travesty3 Jun 1 '10 at 18:02
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.