Symfony setup directory on cloudways

454 views Asked by At

I want to set up symfony3 on cloudways. Path for application folder is /home/master/applications/[appName]. pwd in this dir: conf logs private_html public_html ssl tmp.

As this link says I should install symfony application in public_html. However, I know that public_html is the same as web. So an application should not live in that folder. So, I think to install folder directly in /home/master/applications/[appName] and change 'web' directory to public_html. Is that right? Do not other existing folders (conf, logs) interfere symfony app?

Update: I am going to setup a git repo for symfony app on server. So if symfony should be installed in public_html/../ then all other files also will be tracked by git. I do not think that ssl should be tracked. Sure, I can add it to gitignore, but anyway.

2

There are 2 answers

0
Shahroze Nawaz On BEST ANSWER

I am from cloudways. Let me tell you the whole process, Cloudways is a managed hosting so there are some restrictions. You can't install symfony in: /home/master/applications/[appName]. You need to move in Public_html which is not a typical public directory. Install Symfony in this folder and don't worry your other files are not exposed beside the web folder. Every file is securely hidden and the whole process is also tested by Symfony officials.

After installing symfony in public_html folder, you can point out the URL to web directory: enter image description here

Again nobody will have access to your files they are protected.

You can add .gitignore file to avoid unusual files to be tracked. I created some tutorials you can take guidance from them. here is the URL: https://www.cloudways.com/blog/php/symfony/.

0
Jake Litwicki On

The web directory is the directory Symfony is served out of via the frontend controller app.php (or app_{env}.php for non-prod). This is separate in philosophy from where your web server serves from (apache, nginx, etc). The directory structure ultimately doesn't matter much in either case so long as you point your web server to the correct directory where your frontend controller lives.

This is a good starting point: http://symfony.com/doc/current/setup/web_server_configuration.html