LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-27-2014, 03:19 PM   #1
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Rep: Reputation: 16
unable to add a folder to apache web root


I have a forder /home/username/data and I want to be able to add it to apache webroot, so I added an alias to my 000-default.conf file
Code:
Alias /data "/home/username/data"
<Directory "/home/username/data">
 Order allow,deny
 Allow from all
</Directory>
I added this insed the VirtualHost section... I tried to access a test.php page that I have inside /data folder, but got "Forbidden" error: Permission problem. So I gave everyone rwx permission to /data folder
Code:
chmod -R ugo+rwx data
but still I get same error. Any help appreciated
 
Old 05-27-2014, 04:33 PM   #2
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
everyone (u-g-o) is going to need at least read and execute to /home/username as well, which is not typically the case! Every situation is unique, but it is definitely NOT best practices to give rwx permissions to home directories.

HTH
 
Old 05-29-2014, 01:43 AM   #3
eklavya
Member
 
Registered: Mar 2013
Posts: 641

Rep: Reputation: 142Reputation: 142
What is your distro?
Apart from virtual host configuration, are you able to open your site using IP (when virtual host is not configured) or it gives same error without virtualhost too?
Do you open your site like this.
and it gives forbidden error here.
Did you enable 'userdir' module?
 
Old 05-30-2014, 09:44 AM   #4
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by eklavya View Post
What is your distro?
Apart from virtual host configuration, are you able to open your site using IP (when virtual host is not configured) or it gives same error without virtualhost too?
Do you open your site like this.

and it gives forbidden error here.
Did you enable 'userdir' module?
I'm able to access the webroot through the network using ip address, but not the folder http://ipaddress/data/test.php here I'm still getting "Forbidden error".. how do you enable the userdir module?
 
Old 05-30-2014, 01:17 PM   #5
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Original Poster
Rep: Reputation: 16
ok, I was able to get it working... editing the userdir.conf file; however, I have another vm which I did the same procedure without editing the userdir.conf file, all I did was to add
Code:
Alias directory "/home/user/directory"
<Directory "/home/user/directory">
Order allow,deny
Allow from all
</Directory>
and this did it.... don't know why I had to edit userdir.conf file this time...
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
who should own the files in the Apache web folder? redhat19 Linux - Server 3 08-24-2012 03:11 AM
[SOLVED] root unable to access folder nhelder Linux - Newbie 3 11-29-2010 04:52 PM
Redirect https apache requests to folder not in apache root bax Linux - Enterprise 4 04-12-2010 02:16 PM
Password protect a web folder on apache andy1974 Linux - Security 13 05-15-2009 02:28 AM
Add folder access to Apache conf quilop Linux - Server 6 02-24-2007 08:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:03 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