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.
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.