Gii Web Process Permission on AWS

I’m a noob and running through a Yii tutorial on AWS. So far I’ve been able to get everything up and running - including mysql connection. But now I’m using the Gii code generation tool to help create some model classes. In doing so, I’m getting the following error:

generating models/User.php

                Unable to write the file '/var/www/html/blog/protected/models/User.php'.


The documentation also tells me:

Info: Because the code generator needs to save the generated code into files, it is

    required that the Web process have the permission to create and modify the corresponding

     files. For simplicity, we may give the Web process the write permission to the whole

     /www/blog directory. Note that this is only needed on development machines when using Gii.

This makes sense to me and I understand the basic logic of Linux permissions as applied to users and groups … but not processes. Can someone point me to a primer on how to give the Gii process write permissions to the webroot (in my case:/var/www/html/blog/) directory?

I’ve read and understand the danger of running Gii on a production server. However, the ip filter setting in the config/main.php file is set to only allow Gii to be run from my public ip address. So running a live AWS instance (as opposed to WAMP localhost) seems like it would still be safe.

Also, I made the mistake of trying a quick fix without properly understanding it and did … chmod -R 0644 /var/www/html/blog/ … and I cannot access the page now which means I’ve shut down the application. … HELP!!

I wonder, do you really need code generation ability on the production environment?

Since I’m learning to work in Linux/AWS at the same time, I don’t see why I shouldn’t be working on a live server as long as it’s a development server. I felt like I was almost wasting time working locally in WAMP. It’s probably why I’m having this problem - not enough experience at the command line in Linux.

Do this:

where yourName is the one you get using "whoami"

This will tell your server that you and your web-server process own the files. Whoever owns the files can do whathever he is up to with them.

Keep in mind that you have to rerun the command whenever you create a file yourself not using Gii.


[color="#008000"]NOTE: moved to proper section as this is not a tip (General Discussion for Yii 1.1.x instead of Tips, Snippets and Tutorials)[/color]