1. 程式人生 > >Apache多站點配置

Apache多站點配置

完成整個站點配置需要設定三個檔案:
1.httpd.conf:

DocumentRoot "D:/Documents/web_ft_cc"
<Directory "D:/Documents/web_ft_cc">//此處對應站點檔案的地址
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
# # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options Indexes FollowSymLinks Includes ExecCGI #
# AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> <Directory "D:/Documents/fuotuo_com"
>//第二個站點檔案的地址 # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options Indexes FollowSymLinks Includes ExecCGI # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory>

2.httpd-vhosts.conf檔案中增加新站點相關資訊:

<VirtualHost *:80>
    ServerAdmin [email protected].example.com
    DocumentRoot "D:/Documents/web_ft_cc"//對應站點檔案位置
    ServerName www1.weft.cc //站點名
    ErrorLog "logs/www1.weft.cc-error.log"
    CustomLog "logs/www1.weft.cc-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email protected].example.com
    DocumentRoot "D:/Documents/fuotuo_com"//站點位置
    ServerName www1.fuotuo.com//站點名
    ErrorLog "logs/www1.fuotuo.com-error.log"
    CustomLog "logs/www1.fuotuo.com-access.log" common
</VirtualHost>

3.在自己的檔案中的windows/system32/drivers/etc裡的hosts檔案:增加內容如下:

127.0.0.1   www1.weft.cc  //站點一的訪問地址
127.0.0.1   www1.fuotuo.com //站點二的訪問地址

相關推薦

apache站點配置中ServerName/ServerAlias

round rtu 訪問 back serve alias HR nor 一個 ServerName: 是服務的名字,只能填寫一個域名ServerAlias: servername的別名,使一個服務可以綁定多個域名,用空格隔開DocumentRoot /www/

Windows下Apache 站點配置與虛擬域名

修改httpd-vhosts.conf配置檔案 <VirtualHost *:80> ServerName localhost ServerAlias localhost DocumentRoot "${INSTALL_DIR}/www" <Direct

Windows下Apache 站點配置

修改httpd-vhosts.conf配置檔案 <VirtualHost *:80> ServerName localhost ServerAlias localhost DocumentRoot "${INSTALL_DIR}/www"

apache 站點配置

測試環境 win 7 ,apache 2.2安裝版 1、安裝完 apache 後 2、用記事本開啟apache安裝目錄conf目錄httpd.conf檔案 3、找到如下程式碼: <Directory /> Options FollowSymLinks A

(Ubuntu/Centos)apache站點配置

前言: 情景一:平時在我們開發的時候,一般專案都只存放在 localhost 指定的根目錄下,當有好幾個專案的時候,只能在根目錄下以不同的資料夾區分,特別的不方便。 情景二:平時在看教學視訊的時候,總是看到那些老師在單機下使用不同的域名,訪問的卻是本地的專案

apache站點配置+配置+反向代理

一、Apache多站點配置   這種方法是配置不同的地址訪問不同的資料夾的配置   1:修改本機的hosts檔案,如下:     示例:   127.0.0.1 localhost   127.0.0.1 www.dede.com   12

Apache站點配置

完成整個站點配置需要設定三個檔案: 1.httpd.conf: DocumentRoot "D:/Documents/web_ft_cc" <Directory "D:/Documents/web_ft_cc">//此處對應站點檔案的地址

最新apache域名站點配置

設置 list director option file rtu directory virt host httpd.conf===> Listen 80 Listen 9001 ServerName 123.123.123.123:80 用IP地址作為

linux下配置apache站點訪問-小案例

通過 但是 路徑 多個項目 綁定 配置 nmp .com vid 一級域名(baidu.com)也叫作頂級域名,註冊一級域名是需要付費的。 而二級域名(image.baidu.com)是一級域名的延伸,所以只要購買了一級域名,二級域名是可以任意配置的。 其實(www

apache 站點j簡單配置

conf comm .com local toml con ... pac 文件 apache 多站點配置 Include conf/extra/httpd-vhosts.conf? ?開啟? ? ? ?主配置文件裏去掉註銷 vim /usr/local/apache2/c

Apache Centos站點配置

Apache Centos多站點配置 centos 中apache配置檔案路徑為/etc/httpd/conf/httpd.conf 最後一行為"IncludeOptional conf.d/*.conf",會自動載入/etc/httpd/conf.d/下的所有conf檔案 。 所以只需

Apache本機不同埠站點配置:httpd-vhosts.conf

環境:Apache2.2.9,Resin-3.1.6,Win Server 2003 1.解壓Resin至任意目錄,我的是D:; 2. 安裝Apache,具體操作下一步、下一步即可,其中要配置的地方是需要你填寫網站名等資訊,這裡可以不用管它,全部填寫localhost,預設埠

Apache之——虛擬主機站點配置的兩種實現方案

Apache中配置多主機多站點,可以通過兩種方式實現: 將同一個域名的不同埠對映到不同的虛擬主機,不同埠對映到不同的站點;將同一個埠對映成不同的域名,不同的域名對映到不同的站點。我們只需要修改相應的配置檔案即可。 一、準備工作 1、修改系統 hosts檔案 我是在我自己的

CentOS7配置Apache站點VirtualHost

//建立兩個網站的目錄結構及測試用頁面檔案 # mkdir /www/test1 # echo "test1" > /www/test1/index.html # mkdir /www/test

Apache在windows下站點配置

Apache多站點配置   這種方法是配置不同的地址訪問不同的資料夾的配置   1:修改本機的hosts檔案,如下:     示例:   127.0.0.1 localhost   127.0.0.1 www.dede.com127.0

nginx站點配置

cnblogs director real 數據 doc cor file all 設置 主配置文件 nginx.conf: user www; worker_processes 2; error_log /var/log/nginx/error.log; pid /va

wamp 站點配置

wamp 多站點配置 apache 中的檔案 httpd-vhosts.conf # Virtual Hosts # <VirtualHost *:80> ServerName localhost DocumentRoot D:\Work\WIFI\ES

Homestead 站點配置以及 vagrant 簡單命令

homestead的多站點配置 sites: - map: homestead.test to: /home/vagrant/Code/Laravel/public - map: sample.test # <--- 這裡 to: /hom

WAMPSERVER伺服器站點配置

step1: wamp\bin\apache\apache2.4.9\conf\https.conf 在https.conf檔案中解除一下程式碼的註釋,即去掉前面的#: LoadModule rewrite_module modules/mod_rewrite.so 提

phpstudy站點配置教程

                phpstudy為php整合環境包,一個環境不能可能只設置一個網站。如果要在phpstudy中的www目錄,設定多個網站,根據不同域名訪問網站,需要phpstudy進行設定。 1、執行phpstu