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?
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.
Alternative solution could be installing/deploying Symfony in a folder outside "public_html", let's name it "symfony_app".
Then, your directory structure could look something like this:
-public_html
-www.firstsite.com
-www.secondsite.com
...
-symfony_app
And then, you should make a symlink of a Symfony "web" folder in the "public_html" folder.
For example:
ln -s /home/your_username/symfony_app/web /home/your_username/public_html/www.symfony-site.com
** folder named "www.symfony-site.com" must not exist in "public_html" before creating symlink!
Last step would be adding new subdomain in cPanel. There you should connect your new subdomain with "www.symfony-site.com" symlink inside "public_html".