Ubuntu下apache2启动、停止、重启、配置
Linux系統為Ubuntu
一、Start Apache 2 Server /啟動apache服務
# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start
二、 Restart Apache 2 Server /重啟apache服務
# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart
三、Stop Apache 2 Server /停止apache服務
# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop
?配置
1、在./etc/ 找到hosts文件,在hosts里面添加域名指向虛擬機IP地址 如
192.168.**.** ? ?video.xxx.com(命令行下ifconfig查看)
2、創建自己的根目錄:
例如
子目錄
sudo mkdir video?
3、在video目錄下創建自己的主頁
sudo vi index.html4.進入./etc/apache2/sites-available復制默認文件:
sudo cp 000-default.conf video.conf5.修改vide.conf ?
sudo vi video.conf將DocumentRoot 后面的目錄改為/wwwroot/video
在ServerAdmin上一行加入
ServerName video.imooc.com
6.修改apache2.conf
增加
?
7.建立軟連接
進入/etc/apache2/sites-enabled 目錄下打開命令行工具
8.重啟Apache2:
/etc/init.d/apache2 restart9.在瀏覽器輸入video.xxx.com 會出現你創建的index.html內容
?
參考http://blog.csdn.net/lsmrsun/article/details/51593926
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的Ubuntu下apache2启动、停止、重启、配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: flask中 app.run(host=
- 下一篇: Rails IDE 有很多选择,但是具体