【消費電子實驗室-2014/1/23】LINUX系統作為服務器平臺,以安全穩定著稱。但是,在LINUX系統下如何添加網站呢?今天,消費電子實驗室就為小伙伴介紹一下具體方法,希望對您有所幫助。 以下配置的路徑以標準環境路徑為準,如果您另行安裝,請根據實際安裝路徑配置。 1、cd /server/httpd/conf/vhosts/ 進入綁定域名所在目錄, 2、vim test.conf 建立一個配置文件,test可以自己命名; 3、點擊字母“i”開始編輯文件,輸入內容: DocumentRoot /alidata/www/phpwind ServerName localhost ServerAlias localhost Options -Indexes FollowSymLinks AllowOverride all Order allow,deny Allow from all RewriteEngine On RewriteRule ^(.*)-htm-(.*)$ $1.php?$2 RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 ErrorLog "/alidata/log/httpd/phpwind-error.log" CustomLog "/alidata/log/httpd/access/phpwind.log" common 其中: ServerName www.test.com 綁定的網站域名 ServerAlias test.com 綁定的網站別名(您如果有多個域名添加在這里) DirectoryIndex index.html index.php index.htm 設置默認首頁 DocumentRoot /alidata/www/test 和 Directory "/alidata/www/test" 都是指定網站的目錄,需要一致。 按“esc”退出編輯模式,輸入“:wq”保存退出。 4、輸入命令:/alidata/server/httpd/bin/apachectl restart 重啟apache測試。 5、測試網站。請在瀏覽器中輸入域名,測試設置。 |
網站介紹 廣告業務 歡迎投稿 招聘信息 聯系我們 友情鏈接 法律顧問 網站地圖
CopyRight 2012消費電子實驗室 版權所有 京ICP備12048044號-4號
電話:13701384402 郵編:100040 郵箱:BICQ6688@QQ.COM