WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Can't edit nginx index.html  (Read 2911 times)

Offline nbctcp

  • Newbie
  • *
  • Posts: 6
Can't edit nginx index.html
« on: June 14, 2018, 09:58:19 AM »
I try to edit /usr/local/nginx/html/index.html, but it said Read ony file system.
How to modify it

tq

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Can't edit nginx index.html
« Reply #1 on: June 14, 2018, 10:14:24 AM »
Code: [Select]
$ sudo cp /tmp/tcloop/nginx/usr/local/nginx/html/index.html /usr/local/nginx/html
$ sudo vi /usr/local/nginx/html/index.html

Offline nbctcp

  • Newbie
  • *
  • Posts: 6
Re: Can't edit nginx index.html
« Reply #2 on: June 14, 2018, 12:26:44 PM »
almost correct but after restart the changes gone
any idea?
tq

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: Can't edit nginx index.html
« Reply #3 on: June 14, 2018, 12:59:54 PM »
Hi nbctcp
almost correct but after restart the changes gone
any idea?
tq
Yes, add the line:
Code: [Select]
usr/local/nginx/html/index.htmlexactly as spelled to your  /opt/filetool.lst  file and run a backup before rebooting.

Offline nbctcp

  • Newbie
  • *
  • Posts: 6
Re: Can't edit nginx index.html
« Reply #4 on: June 14, 2018, 01:15:38 PM »
SOLVED
small correction
these the steps

# cp /tmp/tcloop/nginx/usr/local/nginx/html/index.html /usr/local/nginx/html
# vi /usr/local/nginx/html/index.html
# echo '/usr/local/nginx/html/index.html' >> /opt/.filetool.lst
# filetool.sh -b

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: Can't edit nginx index.html
« Reply #5 on: June 14, 2018, 01:24:16 PM »
Hi nbctcp
SOLVED
small correction
these the steps

# cp /tmp/tcloop/nginx/usr/local/nginx/html/index.html /usr/local/nginx/html
# vi /usr/local/nginx/html/index.html
# echo '/usr/local/nginx/html/index.html' >> /opt/.filetool.lst
# filetool.sh -b
No, the leading slash should be omitted.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Can't edit nginx index.html
« Reply #6 on: June 14, 2018, 02:01:14 PM »
Eventually you will want to have your website in a separate directory tree. Keep configuration files in /usr/local/etc, executables in /usr/local/bin, and data files somewhere else altogether such as /srv, /var, or something like this. This isn't Windows, so you can actually keep your system properly organized.

Offline nbctcp

  • Newbie
  • *
  • Posts: 6
Re: Can't edit nginx index.html
« Reply #7 on: June 14, 2018, 08:58:23 PM »
Hi nbctcp
SOLVED
small correction
these the steps

# cp /tmp/tcloop/nginx/usr/local/nginx/html/index.html /usr/local/nginx/html
# vi /usr/local/nginx/html/index.html
# echo '/usr/local/nginx/html/index.html' >> /opt/.filetool.lst
# filetool.sh -b
No, the leading slash should be omitted.
Just tested
the result will be the same with leading slash or without
/usr/local/nginx/html/index.html
but I must type
filetool.sh -b
otherwise /opt/.filetool.lst won't be persist

tq