Heim > php教程 > php手册 > Hauptteil

wamp多站点配置,wamp站点配置

WBOY
Freigeben: 2016-06-13 08:54:46
Original
1024 Leute haben es durchsucht

wamp多站点配置,wamp站点配置

网上方法五花白门,特意记录一下,需要的朋友自行拿去就好。

需要修改的文件:httpd.conf / httpd-vhosts.conf / hosts

对应路径:

httpd.conf:wamp\bin\apache\Apache2.2.21\conf

httpd-vhosts.conf:wamp\bin\apache\Apache2.2.21\conf\extra

hosts:c\Windows\System32\drivers\etc

修改流程:

1,打开httpd.conf,约466行:#Include conf/extra/httpd-info.conf,删除#;

2,还是httpd.conf,约188行:


  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
  Deny from all

改为:


  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
  #Deny from all
  Allow from all
  #允许所有访问
  Satisfy all

3,打开httpd-vhosts.conf,在最下方空白处添加以下代码(自行修改wamp安装路径):


    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "f:/wamp/www"
    ServerName localhost
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common



    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "f:/wamp/www2"
    ServerName www2.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common

4,最后一步:打开hosts文件,在最后一行下面添加以下代码:

127.0.0.1       localhost

127.0.0.1       www2.com

重启wamp之后,localhost与www2.com即可区分开发,多站点配置成功。

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Empfehlungen
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!