Install httpd and mod_ssl on linux
来源:互联网 发布:淘宝怎么开店步骤图解 编辑:程序博客网 时间:2024/05/17 07:53
一、安装httpd
yum install httpd
二、安装mod_ssl
http://dev.antoinesolutions.com/apache-server/mod_ssl
1. yum install mod_ssl
事实上做了上面那步后没有修改另外的文件。
三、安装好httpd后,配置自己的服务器
1.在conf.d文件夹下自己建了一个vhost.conf,内容如下:
我的服务器启动是在localhost:8080
ProxyRequests OffProxyVia On<Proxy *> Order deny,allow Allow from all AddDefaultCharset Windows-31J</Proxy><VirtualHost *:443> ProxyPreserveHost On ServerName myServerName:443 ## Play Application ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ErrorLog logs/ssl_error_log TransferLog logs/ssl_access_log LogLevel warn SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW SSLCertificateFile 证书(.crt)路径 SSLCertificateKeyFile 密钥文件(.key)路径 SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 LogFormat "%t %v %h %l %u \"%r\" %>s %b \"%{Referer}i -> %U\" \"%{User-Agent}i\"" custom CustomLog logs/ssl_access_log custom env=!nolog CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=!nolog SetEnvIf Request_URI "\.(gif)|(jpg)|(png)|(css)|(js)$" nolog SetEnvIf Request_URI "favicon\.ico" nolog</VirtualHost>2.重启httpd:/etc/init.d/httpd restart
访问自己的网站,发现如果加上https会正常访问自己的网站,如果是http会默认到apache的test 页面
修改/etc/httpd/conf文件夹下httpd.conf文件,加上下面内容,将http访问强制转到https
RewriteEngine onRewriteCond %{HTTPS} !=onRewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]重启httpd,OK,搞定!!!!
0 0
- Install httpd and mod_ssl on linux
- install apache-httpd on linux
- HTTPD SSL mod_ssl mod_nss
- MySQL Install and Config on Linux.
- Install and configure Jboss 7 on Linux
- Install Pdf2htmlEX on Amazon Linux and Ubuntu
- 011-install httpd-2.4 on CentOS 6
- how to install apache, PHP and MySQL on Linux
- how to install apache, PHP and MySQL on Linux 2
- how to install apache, PHP and MySQL on Linux 3
- How to build and install Open vSwitch on a linux
- How to Configure, Install and Use libnefilter_queue on Linux
- How to Configure, Install and Use libnefilter_queue on Linux
- install and config bind9(named) on linux server
- Install and configure SVN server on the linux
- 171201 How to install Chrome and SurfEasy on Linux
- install oracle on linux
- install oracle8i on linux
- 完美散列函数(一)
- 二年级语文上册多音字同音字形近字复习练习(北师大版)
- STM32CAN过滤器的作用
- Qt添加右键菜单
- linux下3TB硬盘的分区问题
- Install httpd and mod_ssl on linux
- 一切在慢慢中蜕变
- test(software)
- cocos2dx之文本渲染(CCLabelAtlas,CCLableBMFont,CCLabelTTF)
- ubuntu创建桌面快捷方式具体步骤!!!
- hdu 1050 Moving Tables(贪心算法---区间覆盖,重叠数)
- 3D游戏引擎的Web化
- 使用perl批量卸载软件
- MyEclipse根据数据库反向生成实体类