The change process is relatively simple. You only need to modify the apache2 configuration file.
sudo gedit /etc/apache2/sites-enabled/000-default
Find the DocumentRoot field in the document, and then modify the directory where you want to place the web page file. Then save and restart the apache service:
sudo service apache2 restart
so that the website default directory is modified.
Connecting to phpmyadmin
During the installation process, users may also configure phpmyadmin. At this time, you can directly move the entire phpmyadmin folder to the default directory of the website you modified. This will give you access to phpmyadmin.
If the home directory is set to /home/web/, by default this directory has no permission to access, it will prompt
You don't have permission to access /index.php on this server.
Open //etc/apache2/apache2.conf, Add to
<Directory /home/web/> Options Indexes FollowSymLinks AllowOverride None Allow from all </Directory>
Note, modify the access permissions of the root directory
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
sudo service apache2 restart