Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to transfer my CodeIgniter website to /var/www/html located within my Amazon EC2 micro instance using FileZilla. However, the transfer was unsuccessful as I received hundreds of transfer errors while attempting to transfer my CodeIgniter website.

My question is, how do I upload my CodeIgniter website to /var/www/html ?

The results of sudo ls -l /var/www are:

drwxrwxrw- 2 root root 4096 Apr 30 22:54 cgi-bin drwxrwxrw- 3 root root 4096 May 22 12:25 error drwxrwxrw- 2 root root 4096 Jan 6 2012 html drwxrwxrw- 3 root root 4096 May 22 12:25 ic

share|improve this question
What exactly are you getting for errors? – Nathan C May 23 '13 at 11:14
+1 Thanks for your reply Nathan. I got permission errors: "/var/www/html/test.txt: open for write: permission denied Error: File transfer failed" – Anthony May 23 '13 at 11:29
I used FileZilla to drag and drop my website to that location. – Anthony May 23 '13 at 11:30
Looks like a permissions issue. I'll write up some instructions. – Nathan C May 23 '13 at 11:32
up vote 3 down vote accepted

By default, ec2-user (the default Amazon AMI user) lacks permissions to the /var/www directory. To fix it, use:

usermod -a -G www-data ec2-user

This will add your ec2-user to apache's group so you can make the edits. Root is unable to log in via SSH by default (this can be adjusted, though) so this will work as a workaround. If the apache user is different, change www-data to the appropriate user.

share|improve this answer
In ps aux, the user is the first column. Look for a line that shows /usr/sbin/httpd and the first column will have the name of the user. Typical names are "apache2", "apache", or "www-data". – Nathan C May 23 '13 at 12:14
That's probably because the apache user is different. :-) – Nathan C May 23 '13 at 12:16
No, you shouldn't have to. Try this: chmod -R 776 /var/www. This should put the permissions as they should be. – Nathan C May 23 '13 at 12:29
Hm, your permissions are screwed up it looks like. Can you update your question with the output of ls -l /var/www? – Nathan C May 23 '13 at 12:54
I see, they're all owned by root. Type chown -R apache:apache /var/www to replace with the proper owner, where apache is your httpd's user. That'd by why it wasn't working :-) – Nathan C May 23 '13 at 13:13

Your Answer


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.