Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just installed Ubuntu on my personal machine. I've never used Linux before. I installed Ruby, and Ruby on Rails. I'm about to start a new project. Where should I save it?

I tried cd /var then mkdir www and got a permission denied error. So I did sudo mkdir www. But now I am afraid that every time I want to save or create something, whether using Rails console or my text editor, I'm going to get permission errors.

Should I move my project into my home dir?

share|improve this question
add comment

2 Answers

Yes You should use Your home folder

for example

mkdir home/YourUserName/Ruby
share|improve this answer
    
Thanks! But what if I decide to install Apache and start developing in say, PHP. Should my files be in /var/www/ then? –  Mohamad Jan 26 '12 at 21:59
    
Why so? I keep all my work in my home folder. If You want to be an admin, or have a permission to write files in some other place You need to configure users and groups and what they can do with those files. –  Misery Jan 26 '12 at 22:14
add comment

Add your user to the www-data group.

Then log out and back in.

The set your permissions in /var/www

Files are owned by root:www-data , permissions of 660

Directories are also owned by root:www-data , permissions of 770

See:

https://help.ubuntu.com/community/FilePermissions

https://help.ubuntu.com/community/ApacheMySQLPHP

https://help.ubuntu.com/community/RootSudo

On a production server (anything publilc facing), I use the same ownership. Permissions - files 640 directories 750

On a production server I edit everything as root ( sudo -e /var/www/file )

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.