Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-25-2008, 11:42 AM   #1
Registered: Jun 2006
Posts: 84

Rep: Reputation: 16
Configuring USERDIR apache2 option.


I've installed a LAMP server for web developement and
I would like to configure the USERDIR Apache2 option so that I can
code from my home. In fact I would like to change the USERDIR default repository "public_html" to another repository :
But I don't know how to do that ...
I tried to edit httpd.conf but whatever I do it fails ...

This is the part I tried to edit :

<IfDefine USERDIR>
<IfModule userdir_module>

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
UserDir public_html

# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Order allow,deny
Allow from all
Order deny,allow
Deny from all
Can you help me please ?

Old 06-25-2008, 06:28 PM   #2
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Old 06-26-2008, 04:33 AM   #3
Registered: Jun 2006
Posts: 84

Original Poster
Rep: Reputation: 16
I didn't find that documentation :-( thanks,
Old 06-26-2008, 12:05 PM   #4
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
What does that mean? You can't load the page? Can't see the document? Or ???

The document indicates what you can ( and by way of omission ) cannot do.
Old 06-26-2008, 01:05 PM   #5
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 780
Blog Entries: 6

Rep: Reputation: 75
"code from my home." i am thinking from your house after read it again yeah maybe from /home/urfolder if it right , you need to setup VirtualHost

follow this way as example

//////in the shell///
adduser mike
su - mike
cd /home/mike
mkdir -p /home/mike/public_html/cgi-bin
mkdir -p /home/mike/logs
ln -s public_html www
chmod 755 public_html
chmod a+r public_html/*
cd /home/
chmod 711 mike
//////end in the shell///

//now edit your httpd.conf//

<VirtualHost *:80>
DocumentRoot /home/mike/www
TransferLog /home/mike/logs/access-log
ScriptAlias /cgi-bin/ /home/mike/www/cgi-bin/


to check your config correct or not execute this command in shell

apachectl configtest

hope this help so u can work from your home
Old 06-27-2008, 02:09 AM   #6
Registered: Jun 2006
Posts: 84

Original Poster
Rep: Reputation: 16
Mr. C:
When I try to go to http://localhost/~naaman I've got a permission error telling me this : "You don't have permission to access /~naaman on this server.". I'd like to access to this part
that is here : ~/devel/webserver but it seems there are permission errors with that .... I've missed the Apache2 configuration concerning USERDIR and/or there are perm errors I think.

routers: Ok thanks rooters I'm going to do that :-)
(the VirtulHost part interest me .. I think I can do what I want with that.

Old 06-27-2008, 02:16 AM   #7
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
What are the directory permissions of the directory ?

VirtualHosts are fine too. The UserDir is designed essentially to allow each user a public_html web root without having to create VirtualHosts for each user. With the above VirtualHost example, you create one VirtualHost per user. There are other issues with VirtualHosts that you'll need to learn about.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 userdir "almost" works - can't serve images directory jpantone Linux - Server 14 07-15-2008 01:25 PM
openSUSE 10 RC1 - Apache2 userdir forbidden Smartcat99S SUSE / openSUSE 9 02-11-2006 10:12 PM
apache2 UserDir: where do I start? Brother Michael Debian 2 01-07-2005 10:22 PM
UserDir not working in apache2 hamish Linux - Networking 4 06-29-2004 11:43 AM
Problem: Running cgi scripts with userdir option beatlelane Fedora 4 04-16-2004 03:06 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration