D
digerati@
Guest
A Simple Symlink / Plesk / Apache Solution
We recently moved to Plesk servers from Ensim Servers and we love it. Plesk has come a long way since the last time we used it.
There was one particular issue I had problems finding help with, so I figured I would write a quick article up on the subject.
We have a number of application frameworks built in Adobe Coldfusion 8. In addition, many of our frameworks include FCKeditor, which requires symlinks in the web root for editor-based uploads. Now say a client has a website, extranet and 2 web portals; one for online customers and another for advertisers. The 'webwork' or collection of web applications, share a directory called 'DataVault', which contains all of their uploaded documents, user files, articles, etc. Basically anything uploaded across their 'webwork'.
When we were using Ensim, we simply symlinked the DataVault into each web directory. This became a problem with Plesk.
First I tried tinkering with the httpd.conf, psa conf and vhost.conf. I even tried hard linking. No luck. Many others seem to be having issues with Plesk allowing Apache to follow symlinks, especially to another subdomain path, outside of the web directory, or outside of the vhost directory.
After much frustration, I tried a simpler approach. I took the same approach as linking outside directories to Proftpd jailed home directories.
I simply created a mount point for the mount.
Do the following as root:
[root@localhost ~] vi /etc/fstab
Press 'i' to go into insert mode.
Add the following lines to your /etc/fstab file
Detailed Example:
/path/to/your/target/directory /path/to/your/shortcut/directory none bind 0 0
Real Example:
/var/www/vhosts/domain/DataVault /var/www/vhosts/domain/httpdocs/DataVault none bind 0 0
Press Esc Key to exit insert mode. Use 'wq' to write quit and save changes.
[root@localhost ~] mount -a
This command will mount all mount points you added to the /etc/fstab file.
Now that your additions were added to the /etc/fstab file, all of your mounts will be activated upon system boot.
There are a few issues with this method and maybe someone can provide some insight.
1.As I said earlier, a client could have several mounts to the DataVault directory. Plesk sees this as real disk space. For a 100GB size DataVault directory, linked 4 times, Plesk sees it as 500GB [ (4) 100GB mounts + 100GB physical copy = 500GB total ], but actually 100GB of disk space is being used in the domain's allocated space. This confuses clients in regards to actual space being used. Anyone know a way to exclude a paths or set of paths from Plesk reporting on disc usage and/or limits?
2. Plesk backups also pose a problem with the mounts. Again, is there a way to exclude paths? A 400GB nightly backup is heavy for 100GB of real data. I know I can exclude the DataVault directories manually with the tar command, but I'm not so sure in regards to Plesk as I'm relatively new to Plesk. I suppose I could have an cron job bash script tar up the files and exclude the DataVault paths, except for the physical copy of the DataVault.
Both of these two issues are minor consequences in my opinion.
I really hope this method helps people that are having problems with the symlinks and Plesk. This is a great fix with little sacrifice. Enjoy!
Rock.
:: digerati
- I will post a backup script example with path exclude options when I get time this week.
We recently moved to Plesk servers from Ensim Servers and we love it. Plesk has come a long way since the last time we used it.
There was one particular issue I had problems finding help with, so I figured I would write a quick article up on the subject.
We have a number of application frameworks built in Adobe Coldfusion 8. In addition, many of our frameworks include FCKeditor, which requires symlinks in the web root for editor-based uploads. Now say a client has a website, extranet and 2 web portals; one for online customers and another for advertisers. The 'webwork' or collection of web applications, share a directory called 'DataVault', which contains all of their uploaded documents, user files, articles, etc. Basically anything uploaded across their 'webwork'.
When we were using Ensim, we simply symlinked the DataVault into each web directory. This became a problem with Plesk.
First I tried tinkering with the httpd.conf, psa conf and vhost.conf. I even tried hard linking. No luck. Many others seem to be having issues with Plesk allowing Apache to follow symlinks, especially to another subdomain path, outside of the web directory, or outside of the vhost directory.
After much frustration, I tried a simpler approach. I took the same approach as linking outside directories to Proftpd jailed home directories.
I simply created a mount point for the mount.
Do the following as root:
[root@localhost ~] vi /etc/fstab
Press 'i' to go into insert mode.
Add the following lines to your /etc/fstab file
Detailed Example:
/path/to/your/target/directory /path/to/your/shortcut/directory none bind 0 0
Real Example:
/var/www/vhosts/domain/DataVault /var/www/vhosts/domain/httpdocs/DataVault none bind 0 0
Press Esc Key to exit insert mode. Use 'wq' to write quit and save changes.
[root@localhost ~] mount -a
This command will mount all mount points you added to the /etc/fstab file.
Now that your additions were added to the /etc/fstab file, all of your mounts will be activated upon system boot.
There are a few issues with this method and maybe someone can provide some insight.
1.As I said earlier, a client could have several mounts to the DataVault directory. Plesk sees this as real disk space. For a 100GB size DataVault directory, linked 4 times, Plesk sees it as 500GB [ (4) 100GB mounts + 100GB physical copy = 500GB total ], but actually 100GB of disk space is being used in the domain's allocated space. This confuses clients in regards to actual space being used. Anyone know a way to exclude a paths or set of paths from Plesk reporting on disc usage and/or limits?
2. Plesk backups also pose a problem with the mounts. Again, is there a way to exclude paths? A 400GB nightly backup is heavy for 100GB of real data. I know I can exclude the DataVault directories manually with the tar command, but I'm not so sure in regards to Plesk as I'm relatively new to Plesk. I suppose I could have an cron job bash script tar up the files and exclude the DataVault paths, except for the physical copy of the DataVault.
Both of these two issues are minor consequences in my opinion.
I really hope this method helps people that are having problems with the symlinks and Plesk. This is a great fix with little sacrifice. Enjoy!
Rock.
:: digerati
- I will post a backup script example with path exclude options when I get time this week.