How to Edit Apache2.conf | Permission Denied - Amazon AWS (EC2)
13,305
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:
- Upload the file (via ordinary user) in
/var/tmp
- Login to the terminal
- Become root:
sudo su -
Make a backup of the original file:
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_original
Copy the new file:
cp /var/tmp/apache2.conf /etc/apache2/apache2.conf
Restart apache
Related videos on Youtube
![Arpit Mittal](https://lh5.googleusercontent.com/-0irGpXoZ2oY/AAAAAAAAAAI/AAAAAAAAABQ/zBVB7K7MkoA/photo.jpg?sz=256)
Author by
Arpit Mittal
Updated on September 18, 2022Comments
-
Arpit Mittal almost 2 years
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
-
Romeo Ninov about 7 yearsDirectories /etc and below are owned by root. Are you authenticated with root when upload the config?
-
Alok Yadav about 7 yearsYou need to be root in order to edit or move anything in
/etc/
as @RomeoNinov commented above , you could try to upload that config in your home directory first and later try to move using sudo mv -
Arpit Mittal about 7 years@RomeoNinov I'm accessing it using User - "ubuntu" is there any command which can help me grant the permission for this user so that i can update my apache2.conf directly from FTP
-
Romeo Ninov about 7 years@ArpitMittal, copy the file to /var/tmp and then via command line move it to the proper place. Do not play with permission in /etc
-
Arpit Mittal about 7 years@RomeoNinov Thank you so much for you help.. :)
-
-
Buddhiprakash Kumawat about 4 yearsIf you don't want to upper process then i suggest you that you can edit this file in nano or vi editor and can edit it. // nano /etc/apache2/apache2.conf
-
luisdev about 3 yearsRestart Apache using: $ sudo service apache2 restart