Win7如何部署apache服务器(包括SSL设置)
2016-06-10 15:20
495 查看
部署普通站点
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/就可以访问了
http://localhost/index.html
部署SSL站点
(1)可以按照以下步骤去生成服务器私钥和签署证书
http://dufei.blog.51cto.com/382644/90532/
(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>
输入以下地址就可以访问了
https://localhost/index.html
当然这里边可能还有些注意的地方没有指出,可以在cmd目录下进入到apache目录
D:\Apache24\bin,然后执行apache启动命令httpd -k start,如果启动不成功会报出相关错误,
可以根据错误提示排查问题.
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/就可以访问了
http://localhost/index.html
部署SSL站点
(1)可以按照以下步骤去生成服务器私钥和签署证书
http://dufei.blog.51cto.com/382644/90532/
(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>
输入以下地址就可以访问了
https://localhost/index.html
当然这里边可能还有些注意的地方没有指出,可以在cmd目录下进入到apache目录
D:\Apache24\bin,然后执行apache启动命令httpd -k start,如果启动不成功会报出相关错误,
可以根据错误提示排查问题.
相关文章推荐
- linux下SVN+apache搭建
- Mac 10.10.4下配置apache
- Ubuntu下搭建LAMP环境
- Apache+Python+Web例程
- apache服务器的安装与使用
- Apache 配置里面使用 Win32DisableAcceptEx ,Apache 启动不了
- windows下Apache 内存耗尽假死显现
- CentOS6.7上编译安装Apache2.2和Apache2.4
- 完美企业后台管理项目架构,apache shiro,bootstrap,spring,springMVC,mybatis,github,gradle
- 基于mysql的hive安装配置(apache-hive-2.0.1-bin.tar.gz)
- 安装apacheZeppelin
- Eclipse使用Maven创建普通Java工程时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
- Win7本地运行apache+php, php响应缓慢-千古大坑
- apache Subversion 首页
- 各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT
- Apache Flink:Session Window
- 开源的许可证GPL、LGPL、BSD、Apache 2.0的通俗解释
- Apache通过rewrite限制某个目录---模块
- Apache 禁止指定user_agent---模块
- Apache禁止解析php---模块