Based on a recommendation on stack overflow, i am giving yii framework a spin.
It appears that I am only able to gain shell access to my web server if I log in as root.
I am running through the tutorial, and am having a number of problems typical command to create a web app-
/usr/local/bin/php /home/testuser/public_html/yii/framework/yiic webapp /home/testuser/public_html/demo
- Do I have to type /usr/local/bin/php EVERY TIME???
- Do I have to type /home/testuser/public_html/yii/framework/yiic in full every time???
- Do I have to yype /home/testuser/public_html/demo in full?
- As I am logged in as ROOT, I have to chown every file / folder created by root to make the file viewable by testuser!!!
- I create a new controller using yii.
controller message helloWorld, yii does some funky stuff, but I can’t do ANYTHING with the files without chown EVERYTHING!!!
I’m not too confident with SSH, and I know it’s all a learning curve, but… having to change file permissions EVERY time, and having to type full directories every time is just a pain.
I know that there are some shortcuts that I will probably learn with time, but if anybody could give me some pointers to make my life about 1M times easier (considering my main objectives at present are to learn yii framework) linux/terminal/shell commands are currently secondary to my requirements.
Here’s what I’d do, in this order:
1 – When you login as
rootissue the commandsu - testuser. This changes your effective user id and groupid to that oftestuser, meaning, you now are operating as that user account. Your current directory should now be thetestuser‘s home directory. To get back torootuser just typeexit.2 – Try running
php -vwithout the fullpath. If it prints out a version number then you don’t have to use the fullpath to runphp. If you get an error then you can add/usr/local/binto yourPATHenvironment variable in your.profilefile which is present intestuser‘s home directory. If the.profiledoesn’t exist then you can create it.3 – Add
/home/testuser/public_html/yii/frameworkto your PATH intestuser‘s.profile.After doing all that then the next time you login as
rootyou would be able to do the following:And you wont have to worry about permissions since you are creating directories/files as
testuser, notroot.See also: StackOverflow question about modifying your PATH