CentOS安装Apache 整ssl
2013-01-22 16:12
417 查看
CentOS安装Apache 整ssl
1. 安装Openssl要使Apache支持SSL,需要首先安装Openssl支持。推荐下载安装openssl-0.9.8k.tar.gz
下载Openssl:http://www.openssl.org/source/
tar -zxf openssl-0.9.8k.tar.gz //解压安装包
cd openssl-0.9.8k //进入已经解压的安装包
./config //配置安装。推荐使用默认配置
make && make install //编译及安装
openssl默认将被安装到/usr/local/ssl
2.安装Apache
1)去官网下载:下载httpd-2.2.6.tar 包
./configure --prefix=/usr/local/apache --enable-so --enable-ssl --with-ssl=/usr/local/ssl --enable-mods-shared=all
//配置安装。推荐动态编译模块
make && make install
动态编译Apache模块,便于模块的加载管理。Apache 将被安装到/usr/local/apache
3. Apache 2.2.* 的配置
打开apache安装目录下conf目录中的httpd.conf文件,找到
#LoadModule ssl_module modules/mod_ssl.so
#Include conf/extra/httpd_ssl.conf
删除行首的配置语句注释符号“#”
保存退出。
打开apache安装目录下conf/extra目录中的httpd-ssl.conf文件
在配置文件中查找以下配置语句
SSLCertificateFile conf/ssl.crt/server.crt 将服务器证书配置到该路径下
SSLCertificateKeyFile conf/ssl.key/server.key 将服务器证书私钥配置到该路径下
#SSLCertificateChainFile conf/ssl.crt/ca.crt 删除行首的“#”号注释符,并将中级CA证书配置到该路径下
保存退出,并重启Apache。重启方式:
进入Apache安装目录下的bin目录,运行如下命令
./apachectl -k stop
./apachectl -k start
编译安装时存在问题:
编译的时候出现问题:
1.mod_deflate has been requested but can not be built due to prerequisite failures(ubuntu centent)
如果在安装apache的时候入到 error: mod_deflate has been requested but can not be builtdue to prerequisite failures的错误,那是没有安装zlib包。centos下可以采用yum install zlib-devel, ubuntu下可以采用apt-get install zlib1g-dev.
2.(出现AH00557:
httpd: apr_sockaddr_info_get() failed for Chunk3这个问题,解决办法, vi /usr/local/apache/conf/httpd.conf 找到#ServerName www.example.com:80 这行,把注释拿掉,然后改成ServerName
localhost:80)
启动apache
service httpd start
(出现httpd:
unrecognized service这个问题,解决办法
#cd /usr/local/apache/bin/
#cp apachectl /etc/rc.d/init.d/httpd
#vi /etc/rc.d/init.d/httpd
在#!/bin/sh这行下增加
# chkconfig: 2345 50 90
# description:Activates/Deactivates Apache Web Server)
3.
cannot restore segment prot after reloc问题
在linux上安装有些东西时会出现 Permission denied 的情况:以下就是解决它的办法之一编辑/etc/selinux/config,找到这段:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
保存,关闭。
......
编辑/etc/sysconfig/selinux,找到:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
如果SELINUX已经是 SELINUX=disabled,那么就不用改了,否则就把SELINUX=enforcing 注释掉,新加一行:
SELINUX=disabled
保存,退出。
如果你碰到其他类似提示:
cannot restore segment prot after reloc: Permission denied
哪应该是SELinux的问题,可以考虑把它关闭。
-------------------------------------------------------------------------------------
郁闷的是.我把SELinux关闭后还是不行.于是到google上search.发现这个很有用.
在你保证SElinux 被disable后.还执行下
chcon -t texrel_shlib_t
如: chcon -t texrel_shlib_t /路径/路径/名字.so (这个文件视具体执行文件.)
4.yum被锁定无法使用:
rm -rf /var/run/yum.pid
然后再执行:
CentOS的软件安装工具不是apt-get 是yum
# yum -y install gcc
===============
最好一起把g++也装上
# yum -y install gcc gcc-c++ libstdc++-devel
相关文章推荐
- CentOS 4.4 编译安装 apache 2.2.4(mod_ssl)+php 5.2.1 wi
- centos6.4 x64位系统 安装apache+ssl+svn vipyhd著作,大家都学习学习吧
- CentOS 下编译安装 Apache 并配置 SSL 模块以支持 HTTPS
- 在CentOS5.2+apache2.2下安装配置mod_ssl
- 在CentOS5.2+apache2.2下安装配置mod_ssl
- CentOS下Apache安装SSL
- win iis6.0 、iis7.0 centos apache ssl 证书安装
- 在CentOS5.2+apache2.2下安装配置mod_ssl
- Centos7下Apache详细安装配置及证书申请SSL配置介绍
- CentOS 6.0 系统 LAMP(Apache+MySQL+PHP)安装步骤
- CentOS上安装LAMP之Apache环境及安装过程报错解决方案(纯净系统环境)
- CentOS 6.2编译安装Apache2.4.1+MySQL5.5.21+PHP5.3.10(2)
- Centos7下安装apache过程总结
- CentOS7下源码安装Apache2.4.9
- centos服务器全新安装php,apache环境
- CentOS中,安装Apache+PHP+Mongo DB+Redis DB
- CentOS 下安装 Apache 和 PHP 并开启 mcrypt 扩展
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境
- Centos 6.5 yum 安装Apache软件
- CentOS6.6 Apache2.4+tomcat7 安装配置