How to install apache2 server under Ubuntu

12-26-2022

This article mainly explains how to install the apache2 server under Ubuntu, interested friends may wish to take a look. The method described in this article is simple, quick and practical. Let the editor take you to learn how to install the apache2 server under Ubuntu!

Installation

sudo

Modify port

vim /etc/apache2/apache2.conf 

vim /etc/apache2/sites-enabled/000-default.conf

Change the default 80 to the port you need. I changed it to 8000.

Modify the specified server home directory (static web container)

vim /etc/apache2/sites-enabled/000- default.conf

Change the path behind the DocumentRoot inside to specify your own directory, mine is /usr/share/apache2/html
(new here Created the html folder and modified the permissions: chmod 777 html users can read, write and upload files)

Restart the apache2 service

.d/apache2 restart


Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us