LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-19-2013, 01:17 AM   #1
Wellesly
LQ Newbie
 
Registered: Jan 2011
Distribution: Arch Linux
Posts: 16

Rep: Reputation: 6
XAMPP UserDir in /var/www


Trying to use mod_userdir in my XAMPP installation. I want to put the user web directories in /var/www, but I am having some trouble.

httpd-userdir.conf:
Code:
# Settings for user home directories
#
# Required module: mod_authz_core, mod_authz_host, mod_userdir

#
# 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 /var/www
UserDir disabled root

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/var/www/*">
    AllowOverride All
    Options FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>
Accessing http://localhost/~wellesly/ gives me a 403 error and the following error-log entry: “client denied by server configuration: /var/www/wellesly/”. Adding Require all granted to httpd-userdir.conf gives me a 404 error.

Permissions on /var/www/wellesly are 775, /var/www is 755, and /var is 755, and /var/www/wellesly contains CakePHP and the index.php file that comes with it.

What am I missing?
 
Old 02-19-2013, 02:45 AM   #2
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Have you changed
Code:
DocumentRoot "/var/www"
&
Code:
# This should be changed to whatever you set DocumentRoot to.
<Directory "/var/www">
Restart the XAMPP

If you have defined , virtual host, change the path there too.
 
1 members found this post helpful.
Old 02-19-2013, 11:29 AM   #3
Wellesly
LQ Newbie
 
Registered: Jan 2011
Distribution: Arch Linux
Posts: 16

Original Poster
Rep: Reputation: 6
That works, but it seems like odd behavior. If I had used the default configuration of UserDir public_html, would it have been necessary to make /home the document root?
 
Old 02-19-2013, 11:23 PM   #4
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
What is the odd behaviour?
The DocumentRoot is the path where you want to keep your projects, it is not just restricted to 'htdocs', you can set it anywhere in the filesystem.
If you want to put your projects in public_html, set the path of the public_html directory.
 
Old 01-28-2014, 06:48 AM   #5
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
If you want to activate UserDir attribute in xampp, you have to uncomment following line in /opt/lampp/etc/httpd.conf
Code:
Include etc/extra/httpd-userdir.conf
Now open the file /opt/lampp/etc/extra/httpd-userdir.conf and uncomment these two lines and change UserDir disabled to UserDir enabled
Code:
UserDir enabled
UserDir public_html
The second line says public_html directory is now htdocs directory for users. It's path has been given in the same file.
Code:
<Directory "/home/*/public_html">
All new users are created in /home.

Now you can access per user web directories using
Code:
http://localhost/~username1
http://localhost/~username2
http://localhost/~username3
etc
Now here you were facing Access Forbidden Error when you were accessing these links.
Because there wass an Directory attribute in /opt/lampp/etc/httpd.conf
Code:
<Directory />
    AllowOverride none
    Require all denied
</Directory>
it says AllowOverride none & Require all denied
Just comment these four lines
Code:
#<Directory />
#    AllowOverride none
 #   Require all denied
#</Directory>
and restart xampp using
Code:
# /opt/lampp/lampp start
Now try to open http://localhost/~username1
You will not get access forbidden error.

Note : If you make any type of changes in conf file of xampp, Restart xampp once to see the changes.
 
  


Reply



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 still looking at var/www somehow gregAstley Linux - Newbie 7 08-18-2012 12:41 PM
which user should own /var/www qwertyjjj Linux - Security 30 04-08-2011 07:56 PM
Moving /var/www/ 2-tone-joe Linux - Server 2 12-01-2007 01:27 PM
Who should own /var/www and it's contents? morrolan Linux - Server 4 04-03-2007 02:55 PM
help in /var/www/html/!! chidomen Linux - Newbie 4 01-13-2005 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:54 AM.

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