LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-23-2010, 09:27 AM   #1
sloshymon
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
Apache directory help


Alright, I have been at this for sometime. I am trying to change the directory /var/www/Data to the following /home/project2. I have tried to alias to it, which is how you do it I think, but i cant get it to take ever. using apache2 and centos

Any help is much appreciated!
sloshy
 
Old 04-23-2010, 09:35 AM   #2
teebones
Member
 
Registered: Aug 2005
Location: /home/teebones
Distribution: sometimes this, sometimes that..
Posts: 502

Rep: Reputation: 56
you can change the apache configuration itself, and change the path of /var/www/data, to the new one.
Make sure the permissions are correct, for the new directory, otherwise apache cannot enter it to serve the pages/files inside that directory.

then after having it changed, and creating the directory with proper permissions, use this command to restart apache.

"service httpd restart"

or

"service apache2 restart" (some distro's need this instead of the first one, not sure about centos. (i compile apache manually, so i choose the init.d name for apache service myself )

or you could go with:
/etc/init.d/httpd restart
/etc/init.d/apache2 restart

you know what i mean here..

that should be all.

good luck

Last edited by teebones; 04-23-2010 at 09:36 AM.
 
1 members found this post helpful.
Old 04-23-2010, 09:43 AM   #3
sloshymon
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
[QUOTE=teebones;3945169]you can change the apache configuration itself, and change the path of /var/www/data, to the new one.
Make sure the permissions are correct, for the new directory, otherwise apache cannot enter it to serve the pages/files inside that directory.

i have chmod 664 the dir, /home/project 2but it still will not work? how exactly do it change the config itself? the httpd,conf does not have a path set in the document that i could find! thanks again for you help
 
Old 04-23-2010, 10:17 AM   #4
ajayan
Member
 
Registered: Dec 2007
Posts: 89

Rep: Reputation: 16
[QUOTE=sloshymon;3945183]
Quote:
Originally Posted by teebones View Post
you can change the apache configuration itself, and change the path of /var/www/data, to the new one.
Make sure the permissions are correct, for the new directory, otherwise apache cannot enter it to serve the pages/files inside that directory.

i have chmod 664 the dir, /home/project 2but it still will not work? how exactly do it change the config itself? the httpd,conf does not have a path set in the document that i could find! thanks again for you help
You can Configure an alias like this.

Alias /project "/home/project"
<Directory "/home/project">
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

Hope it will Help
 
1 members found this post helpful.
Old 04-23-2010, 02:22 PM   #5
sloshymon
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Never mind it is not an alias, i need to change the/var/www/data Directory to /home/project2 thanks for all the help
 
Old 04-23-2010, 02:34 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,921

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by sloshymon View Post
Never mind it is not an alias, i need to change the/var/www/data Directory to /home/project2 thanks for all the help
Well, that's one way. However, by default, Apache will NOT follow symbolic links. You've got to edit the Apache config to allow it. If memory serves, it's the FollowSymLink directive, but don't take that as fact. Just have to change the NO to YES, and restart Apache.

Editing the docroot directive to be something else changes ALL your pages. For me, when I'm developing, I find it simpler to make a symlink to a new directory within the docroot. Can then change/modify it as needed easily, without affecting any other pages. So if my docroot is /srv/www/htdocs, I can make a symlink to /home/testpage, to /srv/www/htdocs/tp, then my URL is http://<server name>/tp/
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] RHEL5 Apache Directory Listing for a directory thorinn Red Hat 8 02-02-2010 10:01 AM
need to link a home directory to an apache directory Melsync Linux - Server 3 09-30-2006 06:08 AM
apache directory varun_saa Mandriva 5 01-08-2006 08:13 PM
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 07:03 AM
apache directory Longinus Linux - Software 2 04-05-2004 06:37 AM


All times are GMT -5. The time now is 04:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration