apache 2.4无法安装mod_rpaf

  1. apache2.4已经有了mod_remoteip.so 但手头事情太多,没时间仔细研究,Directadmin无法正常加载,先行编译mod_rpaf达到要求
  2. 编译时提示的错误
  3. [root@server mod_rpaf-0.6]# apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
  4. /var/www/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/include/apache  -I/usr/include/apache   -I/usr/include/apache   -c -o mod_rpaf-2.0.lo mod_rpaf-2.0.c && touch mod_rpaf-2.0.slo
  5. mod_rpaf-2.0.c: In function 'rpaf_cleanup':
  6. mod_rpaf-2.0.c:150: error: 'conn_rec' has no member named 'remote_ip'
  7. mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_addr'
  8. mod_rpaf-2.0.c:151: warning: implicit declaration of function 'inet_addr'
  9. mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_ip'
  10. mod_rpaf-2.0.c: In function 'change_remote_ip':
  11. mod_rpaf-2.0.c:164: error: 'conn_rec' has no member named 'remote_ip'
  12. mod_rpaf-2.0.c:183: error: 'conn_rec' has no member named 'remote_ip'
  13. mod_rpaf-2.0.c:186: error: 'conn_rec' has no member named 'remote_ip'
  14. mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_addr'
  15. mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_ip'
  16. apxs:Error: Command failed with rc=65536
  17. .
  1. 解决办法:
  2. wget http://mirror.trouble-free.net/sources/mod_rpaf-0.6.tar.gz
  3. tar xzvf mod_rpaf-0.6.tar.gz
  4. cd mod_rpaf-0.6
  5. git clone git://gist.github.com/2716030.git
  6. patch < 2716030/mod_rpaf-2.0.c.patch
  7. apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c

Nginx下openssl颁发SSL证书

  1. Nginxopenssl颁发SSL证书
  2.  
  3. 1) rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
  4. 2) yum install nginx php-fpm.x86_64 -y
  5. 3) cd /etc/nginx/conf.d
  6. 4) openssl genrsa -des3 -out baiqiuyi.com.key 2048 #创建私钥 (没密码 openssl genrsa -out baiqiuyi.com.key 2048)
  7. 5) openssl req -new -key baiqiuyi.com.key -out baiqiuyi.com.csr #证书签名
  8. 6) openssl x509 -req -days 365 -in baiqiuyi.com.csr -signkey baiqiuyi.com.key -out baiqiuyi.com.crt #用私钥及证书签名颁发证书
  9. 7) #添加至nginx配置文件
  10. ssl on;
  11. ssl_certificate /etc/nginx/conf.d/baiqiuyi.com.crt;
  12. ssl_certificate_key /etc/nginx/conf.d/baiqiuyi.com.key;
  13. 8) openssl rsa -in baiqiuyi.com.key  -out nopasswd.baiqiuyi.com.key #移除密码,如果不希望Nginx重启需要输入密码则使用这个key
  14. #nginx配置文件
  15. server {
  16.     listen       80;
  17.     listen       443;
  18. #
  19. ssl on;
  20. ssl_certificate /etc/nginx/conf.d/baiqiuyi.com.crt;
  21. #ssl_certificate_key /etc/nginx/conf.d/baiqiuyi.com.key;
  22. ssl_certificate_key /etc/nginx/conf.d/nopasswd.baiqiuyi.com.key;
  23.     server_name  localhost;
  24.     location / {
  25.         root   /usr/share/nginx/html;
  26.         index  index.php index.html index.htm;
  27.     }
  28.     location ~ \.php$ {
  29.         root          /usr/share/nginx/html;
  30.         fastcgi_pass   127.0.0.1:9000;
  31.         fastcgi_index  index.php;
  32.         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  33.         include        fastcgi_params;
  34.     }
  35. }
1 1