cenos雲服務器搭建虛擬主機
---恢復內容開始---
vim基本操作
1.如果apache安裝成為Linux的服務的話,可以用以下命令操作:
service httpd start 啟動
service httpd restart 重新啟動
service httpd stop 停止服務
2. 打開文件 /etc/httpd/conf/httpd.conf, 搜索 VirtualHost example, 找到代碼如下:
# # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for requests without a known # server name. # #<VirtualHost *:80> # ServerAdmin [email protected]
3. 仿照例子, 添加一段代碼來指定某一域名的網站.
# # DocumentRoot 是網站文件存放的根目錄 # ServerName 是網站域名, 需要跟 DNS 指向的域名一致 # <VirtualHost *:80> ServerAdmin [email protected]