设为首页 收藏本站
查看: 773|回复: 0

[经验分享] apache ssl

[复制链接]

尚未签到

发表于 2016-12-29 08:35:14 | 显示全部楼层 |阅读模式
  

  今天回来发现apache不能启动了,郁闷,报的错误是mod_ssl无法加载,我把#LoadModule ssl_module modules/mod_ssl.so加截ssl的地方注释掉就好了。以前都配置好了的,今天怎么会不行了呢?我又重新把mod_ssl编译了一下,
  cd /apache的解压目录/modules/ssl
  [iyunv@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
  wget  http://www.apache.org/dist/httpd/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
  [iyunv@BlackGhost misc]# /usr/local/apache/bin/apachectl configtest
  Syntax OK

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-320819-1-1.html 上篇帖子: 【汇总】apache 下篇帖子: Apache tomcat
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表