Getting root
su root
Var enter under / / www directory
cd /var/www
Create a directory
mkdir -m 777 myhtml // myhtml为自己创建的文件名
Upload We want to replace the html page
- Here I am using FileZilla application
Modify the configuration file
Into the / etc / apache2 directory
vim sites-available
Open the 000-default.conf
Positioning the line DocumentRoot / var / www / html
this change DocumentRoot / var / www /myhtmlmark> (here changed the anterior chamber to create a folder name)
Then exit to the directory / etc / apache2 / under
into the mods-enabled directory
Open dir.conf file
will change DirectoryIndex behind Main.html (here you upload HTML), as shown:
Finally, we need to change the permissions to upload HTML
- Method 1: FileZilla select File Right
Second way:
chmod 777 Main.Html
Apache2 restart
sudo /etc/init.d/apache2 restart
End
Reference: https://www.jianshu.com/p/9b8fa4e0bdbc