index.html does not execute.
It is located
var/www/html/index.html
This file worked, but I renamed it to test another file I named index.html. After I renamed it back to index.html the web page will not execute. Why and what can I do to fix that?
3 Replies
✓ Best Answer
What error are you getting? What do the logs have to say? Did the permissions/ownership change? Did you restart your web server after the rename (to clear the server cache). Did you blow your browser cache?
-- sw
This site can’t be reached
warrgames.net refused to connect.
How do I look at the logs?
Don't know about permissions/ownership change. What would cause that?
I did not restart web server after the rename. How do I do that?
Clearing the cache did not fix it.
Note, if you don't use apache2(8), little of this will apply to you…
How do I look at the logs?
Typically, they're in /var/log…apache2.access & apache2.error…could be in a subdirectory though… You look at apache2.access for "normal" things & apache2.error for "exceptional" things.
Don't know about permissions/ownership change. What would cause that?
This can happen sometimes (the circumstances would be pretty obtuse to you) if you did the rename/copy as root.
I did not restart web server after the rename. How do I do that?
sudo systemctl restart apache2
Clearing the cache did not fix it.
That was a shot in the dark…but necessary what you do anything wrt your site. I've been burned by this many, many times.
-- sw
P.S. *.html files don't "execute". The web server "serves" them and the web browser "renders" them. *.php files are "interpreted" by either the apache2(8) plugin or php-fpm(8). The results of the interpretation are sent back to the web server to be served to the browser for rendering. If a *.html file has Javascript code in it, that code is interpreted by the Javascript interpreter that is part of the browser (or not depending on if you have JavaScript enabled/disabled in your browser) after the browser receives the served page.