zoukankan      html  css  js  c++  java
  • apache 2.2安装

           下载apache2.2 http server,安装next,见到set type,选择custom类型安装,change改变安装路径,next到finsh安装完成,默认80端口,打开浏览器http://localhost,show view "it works !"成功安装。

      配置环境变量,在path变量编辑结尾加上E:PHPPHP Serverin;指向bin目录。

      启动服务:httpd -k start[shutdown][rstart]  

      查看活动端口:netstat -anb

    打安装目录,例如:E:PHPPHP Serverconf,在conf目录下可修改httpd.conf配置文件,修改端口,文件存放路径。

    更改文件存放目录例如:打开httpd.conf配置文件,找到<IfModule dir_module> tag 在后面增加如下:

    #配置虚拟目录
    <IfModule dir_module>
    #默认主页
    DirectoryIndex index.html index.htm index.php
    #映射网站的别名
    Alias /myphp "E:/myphp"
    <Directory E:/myphp>
    #访问权限配置
    Order allow,deny
    </Directory>
    </IfModule>

    并且注释#DocumentRoot "E:/PHP/PHP Server/htdocs"

    配置虚拟主机

    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf

    去掉注释,并打httpd-vhosts.conf文件,增加如下:

    <VirtualHost 127.0.0.1:80>
    DocumentRoot "E:/myphp"
    DirectoryIndex index.html index.htm index.php
    <Directory />

    options FollowSymLinks

    Allowoverride None

    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>   

     增加本地域名映射:

    打开目录:C:WindowsSystem32driversetc

    下的hosts文件,增加

    127.0.0.1      www.myphp.com

    //绑定多个站点,需要添加ServerName区分

    <VirtualHost *:80>
    DocumentRoot "E:/myphp"

    ServerName www.myphp.com

    DirectoryIndex index.html index.htm index.php

    <Directory />

    options FollowSymLinks

    Allowoverride None

    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>  

    2.

    <VirtualHost *:80>
    DocumentRoot "E:/myphp2"

    ServerName www.myphp2.com

    DirectoryIndex index.html index.htm index.php

    <Directory />

    options FollowSymLinks

    Allowoverride None

    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost> 

  • 相关阅读:
    ECMAScript5之Object学习笔记(二)
    ECMAScript5之Object学习笔记(一)
    【笔记】css 自定义select 元素的箭头样式
    【笔记】h5 页面唤起电话呼叫
    【笔记】vue-cli 打包后路径问题出错的解决方法
    【笔记】BFC 模型知识整理
    【笔记】浏览器的缓存
    【笔记】web 的回流与重绘及优化
    【js 笔记】读阮一峰老师 es6 入门笔记 —— 第二章
    【js 笔记】读阮一峰老师 es6 入门笔记 —— 第一章
  • 原文地址:https://www.cnblogs.com/Donie/p/3874164.html
Copyright © 2011-2022 走看看