• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Common Directory for All Sites

D

dimitris

Guest
Hi folks...

I have just bought a dedicated server running Fedora and Plesk 7.5 Reloaded. Nice stuff! :)

Some of the sites I am porting over have a common directory, the files of which are referenced relatively (e.g., <a href="../parent/images/a.jpg">, where "parent" could be the vhosts directory used by Plesk). Now they don't work anymore, as all relative referencing is ignored and I have to copy the common parent directory to the root of each site, which is not optimal.

It's probably an Apache thinkg, but still annoying. I looked inside httpd.conf but no reference to the sites is made there, so probably they are declared in a database?

Anyway, here's my question: is there any quick way of declaring a common parent directory using the above architecture? I don't mind hacking with Linux, or even httpd.conf, as long as it's not a major change in terms of either amount of coding and time.

Thanks,

Dimitris
 
One solution that comes to mind is to use symbolic links.

Copy all of the required shared files to a single directory (e.g. /home/shared) and then within each httpdocs folder simply make a symbolic link that points to /home/shared

e.g.

cd /home/httpd/vhosts/DOMMAINNAME/httpdocs
ln -s /home/shared sharedmedia

You would need to make sure that /home/shared is readable by apache and ensure that Apache is configured to allow FollowSymLinks.

Oh - you'd need to check if this is automatically backed up by psadump - not sure if it follows symlinks. Also, if it DOES follow symlinks then it's going to back the same data up multiple times... Just a few points to bear in mind!

HTH

Andy
 
Oh - one other thing... Plesk stores the rest of the httpd.conf information in a whole range of httpd.include files. One is within the /etc/httpd/conf folder and the rest are within the /home/httpd/vhosts/*/conf folders. Do not bother making any manual changes to these files - they are regularly rewritten by Plesk.

If you want to make any per-domain changes to Apache, use the vhost.conf file. There are plenty of examples of using these files within these forums. I seem to recall that there is also basic reference to this file in Chapter 6 of the Manual for Administrators (http://www.sw-soft.com/en/products/plesk75reloaded/docs/)

Cheers

Andy
 
Back
Top