Why is Permission Denied as root? (apache2)

Linode Staff

whenever I try to execute commands on my server I am getting this error:

root@xxxx:/etc/apache2/sites-enabled# sudo a2ensite default-ssl
sudo: unable to execute /usr/sbin/a2ensite: Permission denied

Even when I am root, this happens. Why?

1 Reply

whenever I try to execute commands on my server I am getting this error:
 
root@xxxx:/etc/apache2/sites-enabled# sudo a2ensite default-ssl sudo: unable to execute /usr/sbin/a2ensite: Permission denied
 
Even when I am root, this happens. Why?

Check the permissions on /usr/sbin/a2ensite:

ls -l /usr/sbin/a2ensite

and make sure the file permissions are set properly…in particular that the executable bit is set in all three groups:

-rwxr-xr-x

If the permissions aren't set like I showed, change them with:

sudo chmod 0755 /usr/sbin/a2ensite

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct