Several sites with shared files

I have developed more than 50 sites that use the same files except CSS and IMAGES. I duplicate files every time I create a new site and upload different css and images.

What would be the best practice just to do this in 1 main place for all common files?

Here is my current structure for each site:

/home/ftpuser/public_html/commonfile1.php
/home/ftpuser/public_html/commonfile2.php
.....
/home/ftpuser/public_html/commonfileN.php
/home/ftpuser/public_html/commonfolder1/
/home/ftpuser/public_html/commonfolder2/
.....
/home/ftpuser/public_html/commonfolderN/
/home/ftpuser/public_html/css/
/home/ftpuser/public_html/css/mycssfiles.css
/home/ftpuser/public_html/images/
/home/ftpuser/public_html/images/myimages.jpg

How could I make all the common files located in 1 place for each site, while still having the ability to make custom css and images.

I use Apache, PHP, Centos

+3
source share
5 answers

50 , DocumentRoot. , , .

css , Alias, VirtualHost.

+4

, , / , - :

+- common files (outside web root)
|
+- httpdocs (web root)
   |
   +--+- website 1 specific files
   |      |
   |      +- images (etc)
   |
   +--+- website 2 specific files
          |
          +- images (etc)

, , / , ( , -root).

, , - - ( http). , , .

- ; , , ( dland ).

+1

, php.

, , php .

0

, # , , ( - , , )

, "" httpdocs.

0

, :

ln -s /home/ftpuser/public_html/commonfile1.php /home/ftpuser/public_html/commonfile2.php

, ( ).

0

Source: https://habr.com/ru/post/1722799/


All Articles