4

I'm using amazon web services to host my Ubuntu Lamp stack and I'm new to this (of course).

I installed LAMP and wordpress to use for my website using this tutorial:

http://iampuneet.com/wordpress-amazon-ec2/

I have completed this and everything seems to be running smoothly. I have access to the wordpress dashboard and I am attempting to upload a theme I purchased. Now when I go to upload the theme I get this error:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

So I'm trying to add a php.ini file that increases the max upload size, however when I try to move the file into the /var/www/wp-admin directory I get this error:

Error:  /var/www/wp-admin/php.ini: open for write: permission denied
Error:  File transfer failed

I am using an EC2 instance on AWS, Host: my ip address, Username: ubuntu, no password and port 22

Any idea what may need to be done here? I have tried numerous ideas from Googling this issue.

Alaa Ali
  • 31,075
  • 11
  • 94
  • 105
anthony
  • 43
  • 1
  • 1
  • 3

2 Answers2

1

Even as the ubuntu user, you cannot write to a directory owned by root.

If you want to do this, you will first have to upload your files to your home directory (i.e. /home/ubuntu/).

From there, you need to SSH into your system, login, then do sudo cp /home/ubuntu/FILENAME /var/www/wp-admin/FILENAME or whatever the command you need to do is, replacing FILENAME with the actual file's name. As well, if you are not copying to /var/www/wp-admin remember to use the correct path instead.

Thomas Ward
  • 72,494
  • 30
  • 173
  • 237
  • Thank you, now how do I upload the files to my home directory? – anthony Sep 06 '13 at 00:05
  • Well, I just gave you the directory to upload to for the `ubuntu` user: `/home/ubuntu`. If the username is something else, say, `ant`, then the home directory is `/home/ant/`. – Thomas Ward Sep 06 '13 at 04:17
  • Hey thanks i understand this now. But, the file I was trying to upload did not solve the problem, can I do it with the entire theme instead? Upload to ubuntu then copy to var/wp-content/themes? – anthony Sep 06 '13 at 23:15
  • Yes, you should be able to do that, however if you are having issues with permissions or files on wordpress, you might want to get help from a more specific site, such as the [WordPress Answers](http://wordpress.stackexchange.com/) site here on stackexchange. Ask Ubuntu is good for helping to resolve issues with the Ubuntu OS, but not necessarily wordpress issues. – Thomas Ward Sep 06 '13 at 23:21
  • ok I will head over to their forum then, thanks Thomas – anthony Sep 07 '13 at 00:24
  • Note we'll be happy to help with the permissions and such, but actual WordPress issues are probably better suited for that site I linked you. :) – Thomas Ward Sep 07 '13 at 00:34
  • Is there an easier way to use filezilla with my server? seems like it should not be this difficult. – anthony Sep 07 '13 at 00:48
  • Unfortunately, the Linux permissions system is kind of restrictive this way, it's set up so that if you don't have write/read/execute permissions on a directory you can't do those things, and the same restrictions apply to FileZilla. However, you can always set up WordPress in your home directory, and configure the web server to access it from your home directory so you don't have to deal with the permissions issues, like you're seeing here. I did this with my sites. (I used NGINX though, not Apache, because I use nginx almost exclusively) – Thomas Ward Sep 07 '13 at 00:55
  • Would NGINX be easier ? I installed php and mysql, but I do not believe I will ever use them since i'm going to be using a static website for a service and would like to set up a business email. What do you suggest, or should I just go to a host and pay a monthly charge and avoid some of the headache? – anthony Sep 07 '13 at 01:14
  • It's your call, honestly, NGINX is no simpler than Apache, but if you want to avoid the headache and you can spare the money each month to host the files at an actual host, you can do that too. – Thomas Ward Sep 07 '13 at 02:30
  • Hey Thomas, I think I would like to move wordpress to the home directory, I have a few concerns though. Is it as safe? Do I need to change any apache settings? is this : http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory the correct steps I need to follow? – anthony Sep 08 '13 at 02:20
  • @anthony let's not use comments 24/7 for all this, okay? That's frowned against on StackExchange. That's a wordpress question, and you would be better asking about that on the [WordPress StackExchange Site](http://wordpress.stackexchange.com/) – Thomas Ward Sep 08 '13 at 03:19
  • We wouldn't want that now would we? ... – anthony Sep 08 '13 at 15:49
0

I got into this topic because I ran into the same problem.

When I tried to copy files to the server in the /var/www/html/ Filezilla answered me that permission denied. I also needed to create additional folders. And the answer is the same - permission denied.

In search of answers through Google, I found that through SSH I should change access to folder /var/. I've lost a lot of time on this. And it was not necessary.

The solution was simple:

I just needed to connect in Filezilla by SFTP connection on root user.

Eric Korolev
  • 285
  • 4
  • 13