LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-20-2005, 01:44 PM   #1
leemoreau
Member
 
Registered: Jan 2004
Posts: 48

Rep: Reputation: 15
How do I change document root in apache2 in Ubuntu?


Hey I need some help with this. I have apache2 and of course the default is to have the web sites in /var/www. I have a second slave hard drive mounted to /webserver which is where I want the document root to be. I changed apache2.conf and also tried changing default in apache2/sites-available but whenever I try to access the site from http://localhost I get a "Forbidden you do not have permission" error. I don't know how to set the permissions. Someone said make sure user apache is part of the apache group or www group but I have no user called apache and no groups called www or apache or anything similar. I just did a default install of Ubuntu which had Apache 1.3 installed. I removed it and put 2 on but even before removing I had no users or groups like that. Anyone know what I need to do? Thanks.
 
Old 03-20-2005, 02:12 PM   #2
cylix
Member
 
Registered: Dec 2004
Location: Ohio
Distribution: Fedora Core 3
Posts: 125

Rep: Reputation: 15
The exact error message would be helpful.

The short, quick way of the west....

chown -R apache:apache /newapache/directories

chmod -R ug+r /newapache/directories

make sure DocumentRoot points to /newapache/directories

Make sure your index file is index.html unless you changed the DirectoryIndex directive.

Did you restart apache?

Don't abbreviate the error message.
 
Old 03-20-2005, 03:21 PM   #3
leemoreau
Member
 
Registered: Jan 2004
Posts: 48

Original Poster
Rep: Reputation: 15
K first off that doesn't work. When I do your first command it says "Chown: 'apache:apache': invalid user." There is no user called apache on my system, there never was when I installed and when I reinstalled apache it never created one. I don't know the exact error because I don't have it set back to /webserver as document root, it's just a standard Error 403: Forbidden. It says Error 403, Forbidden. You do not have permission to access index.html. Do I just need to make a user called apache or something?
 
Old 03-21-2005, 04:54 PM   #4
leemoreau
Member
 
Registered: Jan 2004
Posts: 48

Original Poster
Rep: Reputation: 15
Certainly this has to be a common topic I dunno why it's so hard, does anyone know the answer to this? I need to know asap Thanks.
 
Old 03-30-2005, 06:18 AM   #5
Hmm ^_^
LQ Newbie
 
Registered: Aug 2004
Distribution: gentoo
Posts: 2

Rep: Reputation: 0
Red face my solution

You only have to change the DocumentRoot Dir:
DocumentRoot /your/new/dir

AND

add the following section in your config file:
<Directory "/your/new/dir">
allow from all
Options +Indexes
</Directory>
 
  


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
Apache - change document root? squall14716 Linux - Software 2 01-20-2010 10:16 AM
setting the document root firaysinafets Ubuntu 2 04-07-2005 09:07 AM
Apache Qs: Moving Document Root and PHP with Apache2 larsenmtl Linux - Networking 3 09-29-2004 08:31 AM
apache2 w/ ssl - "document contains no data" with https tree_buddy Linux - Security 2 11-23-2003 08:44 PM
Document Root in Apache Hal Linux - Newbie 2 10-28-2003 06:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:11 PM.

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