2

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
d a i s y
  • 5,411
  • 9
  • 41
  • 59
Arpit Mittal
  • 29
  • 2
  • 2
  • 6
  • 2
    Directories /etc and below are owned by root. Are you authenticated with root when upload the config? – Romeo Ninov Apr 24 '17 at 07:31
  • 2
    You 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 – Alok Yadav Apr 24 '17 at 07:33
  • @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 – Arpit Mittal Apr 24 '17 at 08:49
  • @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 – Romeo Ninov Apr 24 '17 at 08:50
  • @RomeoNinov Thank you so much for you help.. :) – Arpit Mittal Apr 24 '17 at 08:53

2 Answers2

3

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

d a i s y
  • 5,411
  • 9
  • 41
  • 59
Romeo Ninov
  • 699
  • 6
  • 12
0

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

<Directory /var/www/html/>
   Options FollowSymLinks
   AllowOverride All
</Directory>
vanadium
  • 82,909
  • 6
  • 116
  • 186
  • If 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 – Buddhiprakash Kumawat Apr 15 '20 at 10:20