-1

I'm trying to change text using emacs but it wont change on the site. i ran command emacs /var/www/html/index.html.

on emacs the text has changed, but not on the site.

1
  • On what site? I do not see any mention of a site here.
    – David
    Apr 17, 2021 at 10:37

1 Answer 1

0

Probably you won't have write permissions for that directory and for that file. Save your changes to a directory where you do have write access like /tmp with File -> Save As..., exit Emacs and copy the file you just saved with root privileges to that location. But first check the original owner of that file so you can restore it after copying:

ls -l /var/www/html/index.html
sudo cp /tmp/index.html /var/www/html
sudo chown oldowner:oldgroup /var/www/html/index.html

For further editing, start Emacs with root privileges:

sudo emacs /var/www/html/index.html

You might want to read a tutorial of Linux file permissions and ownership to avoid unpleasant surprises with security on your web server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .