Is it possible to use the installation of Symfony2 (multiple sites [domains] on the same server)

I want to host multiple sites based on Symfony2 under one root (server). Can I share symfony files? (sellers, etc.). Does anyone know a tutorial? Is it difficult to manage? The AFAIK Symfony installation has about 600 MB, and I do not want to keep this redundant.

+6
source share
2 answers

Of course I look. A few things to remember:

  • The Symfony/vendors contains all the code associated with Symfony. This can be easily shared between applications.
  • The Symfony/app folder contains application-related files, such as a config and cache, and should not be shared between applications.
  • The Symfony/web folder contains a shared folder from which the application will run, and cannot be used.
  • The Symfony/src folder contains your packages and can be used together, depending on your needs.

So at least do the following:

  • Make copies of the web and app folders. Save copies to the Symfony folder. AFAIK, there is no easy way to have these folders in different places.
  • In the new app folder, edit both app.php and app_dev.php . Replace all links to the app folder with the name of your new / second application folder.
  • Run php newapp/console assets:install newapp on the command line to install related assets.

I am sure that you can also copy the src folder, although I have not experimented with this. Reusing your packages is probably a good idea.

+11
source

Are you talking about structure? If so, you can simply move the folder anywhere on your server (let them say โ€œ/ usr / local / symfonyโ€) and from your sites, just download the autoloader from this directory.

Refer to this documentation page for more information (in the "Verifying Installation" section).

If you want to use the same application for all your sites, it must be for this ...

0
source

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


All Articles