Install apache2 under ubuntu18.04
Install apache2 under ubuntu18.04
1. Install (under the root directory)
Sudo apt install apache2
2. Modify the port (if there is no vim editor, use apt-get install vim to install (request from the middle, enter Y))
Vim / etc/apache2/apache2.conf
Vim / etc/apache2/sites-enabled/000-default.conf
Change the default 80 to the port you need, mine to 8088.
3. Modify the home directory of the server (static web container)
Vim / etc/apache2/sites-enabled/000-default.conf
Change the path after the DocumentRoot inside to specify your own directory. Mine is the default (/ var/www/html).
(here a new html folder is created and the permissions are modified: chmod 777 html users can read, write and upload files.)
4. Restart the apache2 service
/ etc/init.d/apache2 restart
Reference:
1. Https://blog.csdn.net/u014454538/article/details/81260143
II. Https://blog.csdn.net/adley_app/article/details/78959864