I created an CentOS 7 EC2 instance on AWS and installed nginx as my web server. However unlike Apache, it has not created a /var/www folder and instead created /usr/share/nginx/html.
I'd prefer to upload my website files to /var/www. While I have some experience with the Linux terminal (I am primarily a Windows developer), I'd like to know what is the right way in creating the /var/www folder for a PHP website (Yii2 Framework).
I did use mkdir, but Filezilla gets a permission denied error when uploading files and creating sub-directories. I can do chown on the directory, but I am not sure whether that is secure or the right thing to do. What permissions would I set the folder?
Perhaps the question is a bit confusing...
Filezilla is configured properly and I can upload to other directories. It is a file/folder permission problem, where I need to prefix sudo before mkdir to create the /var/www folder or any folders within, and this is something that Filezilla doesn't do.
The question is not how to reconfigure nginx folder, but what should I keep in mind (security) while creating a /var/www folder for nginx. What permissions should I give so that I don't need to sudo mkdir. I am assuming it is best not to give ownership (chown) to the root or something.
Just want to be sure, since this would be a production server.