Win7如何部署apache服务器(包括SSL设置)

部署普通站点

1、首先下载apache24版本,下载地址为http://pan.baidu.com/s/1pLmvDgB;

2、解压到你的电脑本地目录,如D:\Apache24(下文配置都会以当前目录作为参考说明)

3、修改D:\Apache24\conf\目录下的httpd.conf文件
      主要修改点在以下几个方面:(前面的#去掉)
       Listen 8080;
 
       ServerName 127.0.0.1:8080;
 
       ServerRoot "D:/Apache24"
 
       DocumentRoot "d:/Apache24/htdocs"
 
      <Directory "d:/Apache24/htdocs">
 
      <IfModule dir_module>
          DirectoryIndex index.html--指定网站的主页文件
      </IfModule>
 
        <Directory "d:/Apache24/cgi-bin">
                 AllowOverride None
                 Options None
                 Require all granted
         </Directory>
 
        Include conf/extra/httpd-vhosts.conf
4、修改D:\Apache24\conf\extra目录下的httpd-vhosts.conf
<VirtualHost *:8080>
    ServerAdmin  webmaster@dummy-host.example.com
    DocumentRoot "d:/Apache24/htdocs/" --放置站点目录
    ServerName dummy-host.example.com
    ServerAlias szpc1928.morningstar.com
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
5、可以把站点放置在d:/Apache24/htdocs/就可以访问了
 
部署SSL站点 
  (1)可以按照以下步骤去生成服务器私钥和签署证书
 (2)本地配置
 修改D:\Apache24\conf\extra下的httpd-ssl.conf文件
DocumentRoot: --修改成放置站点的目录;
SSLCertificateFile "d:/Apache24/conf/server.crt";
SSLCertificateKeyFile "d:/Apache24/conf/server.key"
<Directory "d:/Apache24/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
输入以下地址就可以访问了
 
当然这里边可能还有些注意的地方没有指出,可以在cmd目录下进入到apache目录
D:\Apache24\bin,然后执行apache启动命令httpd -k start,如果启动不成功会报出相关错误,
可以根据错误提示排查问题.
 
 
 

 

转载于:https://www.cnblogs.com/cby-love/p/5573709.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值