1

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
1
  • 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
    Commented Oct 12, 2011 at 19:56

2 Answers 2

0

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.

2
  • 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
    Commented Oct 12, 2011 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
    Commented Oct 12, 2011 at 20:15
0

consider using mount --bind olddir newdir.

4
  • 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
    Commented Oct 12, 2011 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. Commented Oct 12, 2011 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
    Commented Oct 12, 2011 at 20:32
  • @Chris: If you found answer useful, you should up-vote it :-) Commented Oct 12, 2011 at 20:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .