是否可以共享一个Symfony2安装(在一台服务器上有多个网站[域]) [英] Is it possible to share an Symfony2 installation (multiple websites [domains] on one server)

查看:92
本文介绍了是否可以共享一个Symfony2安装(在一台服务器上有多个网站[域])的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个根(服务器)下托管多个基于Symfony2的网站.可以共享symfony自己的文件吗? (供应商等).有人知道教程吗?很难管理吗? AFAIK Symfony安装约有600MB,我不想以多余的方式保存它..

I want to host multiple Symfony2 based websites under one root (server). Would it be possible to share the symfony own files? (vendors etc.). Does someone know a tutorial? Is it hard to manage? AFAIK a Symfony installation has about 600MB and I don't want to save this in a redundant manner ..

推荐答案

我当然可以.需要记住的几件事:

I certainly looks possible. A few things to remember:

  1. Symfony/vendors文件夹包含所有与Symfony相关的代码.这可以在应用程序之间轻松共享.
  2. Symfony/app文件夹包含与应用程序相关的文件,例如config和cache,并且不应在应用程序之间共享.
  3. Symfony/web文件夹包含将在其中提供应用程序的公用文件夹,并且不应被共享.
  4. Symfony/src文件夹包含您的分发包,可以根据需要进行共享
  1. The Symfony/vendors folder contains all the Symfony related code. This can easily be shared between applications.
  2. The Symfony/app folder contains application related files like the config and cache, and shouldn't be shared between applications.
  3. The Symfony/web folder contains the public folder from which the application will be served, and shouldn't be shared.
  4. The Symfony/src folder contains your bundles, and can be shared, depending on your needs

因此至少,请执行以下操作:

So at the very least, do the following:

  1. 制作webapp文件夹的副本.将副本保留在Symfony文件夹中. AFAIK,没有简单的方法可以将这些文件夹放置在不同的位置.
  2. 在新的app文件夹中,编辑app.phpapp_dev.php.将对app文件夹的所有引用替换为新的/第二个应用程序文件夹的名称.
  3. 在命令行上运行php newapp/console assets:install newapp以安装捆绑的资产.
  1. Make copies of the web and app folders. Keep the copies in the Symfony folder. AFAIK, there's no easy way to have these folders in different locations.
  2. In the new app folder, edit both app.php and app_dev.php. Replace all references to the app folder with the name of your new / second app folder.
  3. Run php newapp/console assets:install newapp on your command line to install the bundled assets.

我确定您也可以复制src文件夹,尽管我还没有尝试过.无论如何,重复使用捆绑包都是个好主意.

I'm sure you can also copy the src folder, although I haven't experimented with that. Reusing your bundles is probably a good idea in any way.

这篇关于是否可以共享一个Symfony2安装(在一台服务器上有多个网站[域])的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆