最近自己要折騰下web服務器的事,順便就記錄一些配置過程
先上環境:
先更新下系統
sudo pacman -Syu
安裝apache
sudo pacman -S apache
查看apache 是否安裝成功
apachectl -v
或者
httpd -v
我的顯示如下:
Server version: Apache/2.4.25 (Unix)
Server built: Dec 20 2016 13:02:22
設置開機啟動
sudo systemctl enable httpd
sudo systemctl restart httpd
查看apacheh是否在運行
sudo systemctl status httpd
設置apache啟動文件
在httpd.conf文件里找到以下信息:
DirectoryIndex index.html
這兒的index.html就是啟動文件了,你也可以改成你自己的文件
ps,順便說下,啟動目錄也在這個文件里
在該文件里查找DocumentRoot,可看到啟動目錄
pps,配置文件httpd.conf在哪里呢?
sudo find / -name httpd.conf搜下得之
效果如何?
我在index.html里寫了點東西,打開瀏覽器 輸入
如圖:
note:
referrence:https://forum.manjaro.org/t/install-apache-mariadb-php-lamp-2016/1243