Get the App
SLTechnology News&Howtos  ›  Servers  › 

Install apache2 under ubuntu18.04

Shulou Source: shulou.com Published: 2022-06-02 23:44:24 09月22日 Update

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

Tags: Files directories ports services containers folders servers permissions root users editors paths static references input Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Tech Info macOS Microsoft vpn