[Techtalk] Stumped - accessing site on local server

Becky Lewis scaryclam at scaryclam.co.uk
Mon Feb 11 21:28:03 UTC 2013


Hi,

I'm normally just a lurker on this list so hello everyone!

Since you're still having trouble I thought I might wade in (I'm not 
exactly an apache expert but part of my day job requires some knowledge 
of apachefoo .

I just made a simple setup for enabling user directories by doing the 
following:
1) Create /home/someuser/public_html as that's where I'm planning on 
serving stuff from
2) Create very simple file /home/someuser/public_html/index.html so I 
can see when it's working
3) From here I change directory into /etc/apache2/ so from here on in 
you can assume that's the directory I'm working from
4) ls mods-available/userdir.* should show you that userdir.conf and 
userdir.load are present. If not you'll have to find and install the 
userdir module.
5) ls mods-enabled should have links to the userdir.conf and 
userdir.load files in mods-available. If they are there then skip the 
next step
6) If they're not there then run:
# ln -s mods-available/userdir.conf mods-enabled/userdir.conf
# ln -s mods-available/userdir.load mods-enabled/userdir.load
7) For simplicities sake I'm just going to edit the existing default 
config file that comes with apache. You can make your own if you like 
but you should probably make sure to remove the default sites link from 
sites-enabled to ensure your config is the one being used. Also, use 
whatever you want to edit the file, I just like vim:
vim sites-available/default

That will open up the file. Here are the first four lines from my edited 
file:
<VirtualHost *:80>
     ServerAdmin webmaster at localhost
     UserDir public_html
     UserDir disabled root

Then I added:
<Directory /home/*/public_html>
         AllowOverride All
         Options MultiViews Indexes SymLinksIfOwnerMatch
</Directory>

below some of the other Directory sections. Write the file and back to 
the command line....

8) If you created your own config file then you'll probably still need 
to link it:
# ln -s sites-available/yourconfig sites-enabled/yourconfig
Remember that if you've made your own config and leave the default 
configs link in the sites-enabled directory it might get loaded instead 
of yours (I really don't know what the order of precedence is).
9) restart apache:
# service apache2 restart

Apache should restart and you should then be able to navigate to:
192.168.2.101/~someuser/
and see your index.html page rendered in all its glory.

Hope that made some sense and that it helps you figure out what's 
missing to get you running!

Becky


On 11/02/13 01:42, Sheila Fenelon wrote:
> Billie Walsh wrote:
>>>> I have tried the "cslsa" site [ 192.168.1.125/~cslsa/ ] in
>>>> /home/billie0w/public and /var/www/public/. No luck.
>>>>
>>>>
>>> userdir.conf defines
>>> 192.168.1.125/~cslsa/ as pointing to /home/cslsa/public_html
>>> Is cslsa a user? Does that directory exist?
>>>
>> The public_html goes after the cslsa?
>>
> Your userdir.conf has this
> <Directory /home/*/public_html>
> so, yes the pattern is /home/{login_id}/public_html
>
> If you had a directory
>   /home/billie0w/public_html/
> then it would be web viewable from
> http://192.168.1.125/~billie0w/
>
>> The only thing I can find about adding a user to apache2 is to add a
>> password to /usr/local//apache2//bin/htpasswd. I don't want it
>> passworded.
> That's for password protecting access to web pages. You don't want that.
>
>> Other than that I don't know what you mean by "Is cslsa a
>> user?"
>>
>> There's a cslsa directory in /home/billie0w/public/ and in
>> /var/www/public/ right now while I'm trying to figure this out.
>>
> UserDir is for system users, like billie0w.
>
> if you want this to work, http://192.168.1.125/~cslsa/
> then you need a directory /home/cslsa/public_html/ for the web files.
>
>
> Sheila
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk



More information about the Techtalk mailing list