Ubuntu – How to Edit Apache2.conf | Permission Denied – Amazon AWS (EC2)

.htaccessamazon ec2Apache2permissionsserver

I'm trying upload the edited apache2.conf but getting File Permission Denied Error.

Status: Starting upload of O:\Users\Circle Radius\SRPL\apache2.conf
Command:    cd "/etc/apache2"
Response:   New directory is: "/etc/apache2"
Command:    put "O:\Users\Circle Radius\SRPL\apache2.conf" "apache2.conf"
Error:  /etc/apache2/apache2.conf: open for write: permission denied
Error:  File transfer failed

Best Answer

Based on the communication in comments, it is visible you use account which do not have proper permissions to write in /etc

The better and more secure way to accomplish your task is:

  1. Upload the file (via ordinary user) in /var/tmp
  2. Login to the terminal
  3. Become root: sudo su -
  4. Make a backup of the original file:

    cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_original
    
  5. Copy the new file:

    cp /var/tmp/apache2.conf /etc/apache2/apache2.conf
    
  6. Restart apache

Related Question