In my rented VPS server and am using Apache2. I created an index.html file in the folder /var/www/html/. This .html file is correctly displayed when opening my new webpage. However, I want to transfer my project from VS Code to my folder, thus replace the original index.html file with my big index.html file that I made in VS code.
My issues are the following:
I can only open and edit the index.html file by using sudo vim /var/www/html/index.html This file will then be displayed on my website.
If I insert an index.html file from WinSCP or use vim index.html in
/var/www/html/ I edit a different html file that is not being
displayed on my website.I cant see the index.html file from sudo vim /var/www/html/index.html in WinSCP.
--> Also this happens when adding a html file with winSCP: sudo chmod 644 /var/www/html/index.html chmod: cannot access '/var/www/html/index.html': No such file or directory
My files over WinSCP were in the relative path, but for Apache they need to be in the real path. So what I did to fix this was:
This command moves the stuff from the relative path to the real path of
/var/www/html/.