在ubuntu18.04下安裝apache2
一、安裝(在根目錄下)html
sudo apt install apache2
二、修改端口(若沒有vim編輯器,使用apt-get install vim 安裝(中間出來請求,輸入Y))web
vim /etc/apache2/apache2.confapache
vim /etc/apache2/sites-enabled/000-default.confubuntu
把默認的80 改爲本身須要的端口 個人改爲了8088vim
三、修改制定服務器主目錄(靜態web容器)服務器
vim /etc/apache2/sites-enabled/000-default.conf app
把裏面的DocumentRoot 後面的路徑改爲指定本身的目錄 個人是默認(/var/www/html)
(這裏新建立了html文件夾 而且修改了一下權限: chmod 777 html 用戶均可以讀寫 上傳文件)
四、重啓apache2服務編輯器
/etc/init.d/apache2 restartide
參考:
1、 https://blog.csdn.net/u014454538/article/details/81260143
2、 https://blog.csdn.net/adley_app/article/details/78959864.net