1

I have installed Drupal 8 on EC2. I am trying to install a module (simple_sitemap-8.x-2.5.tar.gz).

When I use the interface, I get a failed transfer message:

enter image description here

I have chmod a+x the directory (which already exists), but to no avail.

How should I solve this one? Is there a workaround to install modules without FTP?

1

3 Answers 3

5

The chmod a+x isn't enough, the directory should have write permission for HTTP server user, so try:

chmod 755 /var/www/html

Prefix with sudo if it's necessary.

or if you've already some files in it, try:

chmod -R u+rwX,go+rX,go-w /var/www/html

and if you're using Apache, you should change the ownership by:

chown -R www-data:www-data /var/www/html

If www-data is not correct, you can find the Apache user by the following command:

ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {if ($1) print $1}
1
  • As an alternative, you can use ps aux | egrep '(apache|httpd)' to find the Apache user name.
    – Joshua LI
    Commented Mar 15, 2019 at 5:38
1

Assuming you're using Ubuntu as your EC2 OS:

If you were to use FTP, right now it would work, while browser install method doesn't. To allow browser method to work:

cd /var/www/html

sudo chown www-data -R modules

Note that the browser method works now, but FTP won't work. In the future, if you decide to use FTP, you will need to switch it back to ubuntu as the folder owner:

cd /var/www/html

sudo chown ubuntu -R modules
0

I know this may sound silly but I've had the same issue and all I had to do was unblock the port 21/22 on my EC2's Security Group. Thought maybe as simple as that -- I had been stuck for over an hour on permissions.

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