dphphvs496524 2015-06-30 12:43
浏览 19
已采纳

在共享主机上部署Symfony2

I can not find reply to my question. I am trying to understand how i should deploy symfony2 app on shared hosting. I know i should rename my "web" catalog to "public_html", but i have many sites in this catalog. My catalog's structure is like:

-public_html
  -www.firstsite.com
  -www.secondsite.com
  ...
  -www.nextsite.com
-private_html

So where i should put my files? app,src,vendor under public_html, and files from web i should put directly to "public_html"? Or catalog web should be in public_html and other files under public_html? So i will have:

-public_html
  -...
  -web
-private_html
-app
-src
-...

EDIT: Now i have whole app in "public_html/example/" It's work fine, but it is safe?

  • 写回答

2条回答 默认 最新

  • dongzou1964 2015-06-30 13:23
    关注

    You should create a folder for your new website inside "public_html". Let's say you have the domain "example.com".

    You will have: public_html/example.com, public_html/example2.com, ..

    Inside the folder example.com you will copy the folders: app, src, public.. (all Symfony's project main folders and files).

    To answer to your question. "EDIT: Now i have whole app in "public_html/example/" It's work fine, but it is safe?". Yes, it's safe.

    Just search on google for: "prevent directory traversal", if you want to make sure that it's secure.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?