求助,apache 编译 mod sslmod ssl.so+mod

--一步,二步,三步,N步,二行脚印
张映 发表于
分类目录:
标签:, , ,
今天回来发现apache不能启动了,郁闷,报的错误是mod_ssl无法加载,我把#LoadModule ssl_module modules/mod_ssl.so加截ssl的地方注释掉就好了。以前都配置好了的,今天怎么会不行了呢?我又重新把mod_ssl编译了一下,
cd /apache的解压目录/modules/ssl
[root@BlackGhost ssl]# /usr/local/apache/bin/apxs -c -i mod_ssl.c
ssl_private.h:541:14: error: declaration for parameter 'ssl_hook_UserCheck' but no such parameter
ssl_private.h:540:14: error: declaration for parameter 'ssl_hook_Auth' but no such parameter
ssl_private.h:537:14: error: declaration for parameter 'ssl_init_ModuleKill' but no such parameter
ssl_private.h:536:14: error: declaration for parameter 'ssl_init_Child' but no such parameter
mod_ssl.c:520:1: error: expected '{' at end of input
apxs:Error: Command failed with rc=65536
上面的报错只是最下面的一部分,搞了好长时间,没搞定,决定下个新的apache重装一下,顺便把安装过程说一下
一,安装httpd-2.2.16.tar.gz
tar zxvf httpd-2.2.16.tar.gz
cd httpd-2.2.16
./configure --prefix=/usr/local/apache --enable-ssl
--enable-so
--with-ssl=/us
make && make install
1,改documentroot和&Directory "/home/zhangy/www"&,把里面的默认路径改成你的web目录。
2,加载libphp.so
我记得以前装php的时候,会自动添加好下面的东西,但是这次我只升级apache,我还没找到libphp.c文件在什么地方,没法用apxs来重新编译,还是用以前的libphp5.so吧
LoadModule php5_module
modules/libphp5.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php
如果不加上面的东西,php代码无法解悉,会直接把源码显示出来
3,修改user和group,你看一下user后面的用户,在你的系统中有没有,如果没有的话,你启动apache后,查看页面时会forbidden错误,改成你指定的用户,当然这个用户必有在你的系统中。
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
User zhangy
Group users
二,编译mod_ssl模块看看报不报错
cd /apache的解压目录/modules/ssl
/usr/local/apache/bin/apxs -c -i mod_ssl.c
make && make install
下面是安装时候显示出来的信息
Libraries have been installed in:
/usr/local/apache/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/local/apache/modules/mod_ssl.so
现在编译就没有报错了,我觉得肯定是因为我升级的原因,并且只是升级了一部分。安装的时候,我已经内建了mod_ssl所以就不用在加载了。如果加了的话,会提示module ssl_module is built-in and can't be loaded
[root@BlackGhost misc]# /usr/local/apache/bin/apachectl configtest
转载请注明作者:海底苍鹰地址:archieneusoft 的BLOG
用户名:archieneusoft
文章数:50
评论数:193
访问量:316616
注册日期:
阅读量:5863
阅读量:12276
阅读量:394724
阅读量:1085650
[匿名]楼主我在安装的时候..:
51CTO推荐博文
Apache+mod_ssl实现https服务的主要配置
本文介绍的内容并不完整,并非在apache上配置https的全过程,只是记录下一些常用的配置。希望对大家有用!以后有机会从头重装时再把记录补充完整!
httpd.conf文件配置:
如果要在一个apache服务器上同时实现多个域名服务,就要添加NameVirtualHost了!不光80端口可以,其它的端口一样可以!例如:
&IfModule mod_ssl.c&
&&& Include
conf/ssl.conf
&/IfModule&
NameVirtualHost 10.10.10.10:80
NameVirtualHost 10.10.10.10:443
使用openssl命令制作密钥和证书文件:
生成ca.key密钥:
# openssl genrsa -des3 -out ca.key -rand rand.dat 1024
创建ca.crt证书:
# openssl req -new -x509 -days 365 -key ca.key -out
ssl.conf文件配置:
Listen 443
&VirtualHost _default_:443&
//这里默认是_default_,如果用多个域名时把_default_改成IP。否则貌似不起作用!
DocumentRoot "/apache/htdocs"
ServerName domain:443
找到下面的SSLCertificateFile和SSLCertificateKeyFile把上面制作的密钥和证书路径添上。
SSLCertificateFile /apache/conf/ca.crt
SSLCertificateKeyFile /apache/conf/ca.key
在一个apache服务器上配置多个https域名服务时,把&VirtualHost _default_:443&到&/VirtualHost&这段挺长的脚本全部拷贝一份放里面就行了!记得把default改成ip并添加NameVirtualHost.
在配置apahce相关的配置文件的时候,如果配置错误,在启动时都会给出一些提示,告诉你错在哪里,那个的提示还是比较清晰的~一般都能根据它找到是哪里设置不对!
启动apache+https服务:
#/apache/bin/apachectl startssl
这里有时会要求输入密钥的密码,貌似有时也不需要!我还没找到规律,呵呵,看来安装次数还是太少了!本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)
21:16:10 19:05:48Service Unavailable
Service Unavailable
HTTP Error 503. The service is unavailable.}

我要回帖

更多关于 apache没有mod ssl.so 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信