Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed ISPConfig and have an Apache /var/www folder.

I would like to move this www folder to another drive mounted at /data.

I did

cp -r /var/www /data

to create a copy in the /data folder

I then did

mv /var/www /var/wwworig

to create a backup of the www folder just in case

I then created a symbolic link from /var/www to /data/www

ln -s /data/www /var/www

Giving me a link from /var/www to /data/www

I have tried restarting Apache but still only receive 403 errors when browsing my page.

I have FollowSymLinks in my Apache config. I don't want to change the directories listed in my Apache config because I don't want to get into changing ISPConfig that much. I would just like a symbolic link to another drive.


Here are permissions that may be pertinent.

Original /var folder

drwxr-xr-x 10 root   root   4096 Mar 23  2011 www

Original /data folder

drwxr-xr-x 10 root  root   4096 Oct 12 06:02 www

/var folder with link

lrwxrwxrwx  1 root   root      9 Oct 12 10:16 www -> /data/www
drwxr-xr-x 10 root   root   4096 Mar 23  2011 wwwbackup
share|improve this question
    
Check the Apache logs in /var/www and see what the actual problem is. You might have to turn up the logging level of Apache. –  CarlF Oct 12 '11 at 19:56
add comment

2 Answers

up vote 0 down vote accepted

When you copied the directory have you checked file permissions and ownership? If you copied as root user the new directory will belong to root from that point on. user nobody or httpd will not be able to reach these data.

share|improve this answer
    
I tried the copy again while keeping permissions cp -rp /var/www /data/www correct? Now I'm getting a different error of 500 "The server encountered an internal error or misconfiguration" –  Chris Oct 12 '11 at 19:30
    
You're right keeping the permissions the same while copying got it to serve correctly. I then needed to correct my suphp.conf by removing the docroot lines. –  Chris Oct 12 '11 at 20:15
add comment

consider using mount --bind olddir newdir.

share|improve this answer
    
I tried that per your suggestion but received this: [root@server var]# mount --bind /var/www /data/www mount: special device /var/www does not exist Thank you for the suggestion though. –  Chris Oct 12 '11 at 20:18
    
@Chris: does /data/www exists? It should. What OS are you on? Does your man mount say anything about --bind option? It works on my debian. –  Michał Šrajer Oct 12 '11 at 20:22
    
Your right the folder didn't exist when I tried it the first time. I had a /var/www folder and tried it again and it worked just fine. I will probably stick to the link but thanks again. –  Chris Oct 12 '11 at 20:32
    
@Chris: If you found answer useful, you should up-vote it :-) –  Michał Šrajer Oct 12 '11 at 20:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.