- apache2.4已经有了mod_remoteip.so 但手头事情太多,没时间仔细研究,Directadmin无法正常加载,先行编译mod_rpaf达到要求
- 编译时提示的错误
- [root@server mod_rpaf-0.6]# apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
- /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
- mod_rpaf-2.0.c: In function 'rpaf_cleanup':
- mod_rpaf-2.0.c:150: error: 'conn_rec' has no member named 'remote_ip'
- mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_addr'
- mod_rpaf-2.0.c:151: warning: implicit declaration of function 'inet_addr'
- mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_ip'
- mod_rpaf-2.0.c: In function 'change_remote_ip':
- mod_rpaf-2.0.c:164: error: 'conn_rec' has no member named 'remote_ip'
- mod_rpaf-2.0.c:183: error: 'conn_rec' has no member named 'remote_ip'
- mod_rpaf-2.0.c:186: error: 'conn_rec' has no member named 'remote_ip'
- mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_addr'
- mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_ip'
- apxs:Error: Command failed with rc=65536
- .
- 解决办法:
- wget http://mirror.trouble-free.net/sources/mod_rpaf-0.6.tar.gz
- tar xzvf mod_rpaf-0.6.tar.gz
- cd mod_rpaf-0.6
- git clone git://gist.github.com/2716030.git
- patch < 2716030/mod_rpaf-2.0.c.patch
- apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
- Nginx下openssl颁发SSL证书
-
- 1) rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
- 2) yum install nginx php-fpm.x86_64 -y
- 3) cd /etc/nginx/conf.d
- 4) openssl genrsa -des3 -out baiqiuyi.com.key 2048 #创建私钥 (没密码 openssl genrsa -out baiqiuyi.com.key 2048)
- 5) openssl req -new -key baiqiuyi.com.key -out baiqiuyi.com.csr #证书签名
- 6) openssl x509 -req -days 365 -in baiqiuyi.com.csr -signkey baiqiuyi.com.key -out baiqiuyi.com.crt #用私钥及证书签名颁发证书
- 7) #添加至nginx配置文件
- ssl on;
- ssl_certificate /etc/nginx/conf.d/baiqiuyi.com.crt;
- ssl_certificate_key /etc/nginx/conf.d/baiqiuyi.com.key;
- 8) openssl rsa -in baiqiuyi.com.key -out nopasswd.baiqiuyi.com.key #移除密码,如果不希望Nginx重启需要输入密码则使用这个key
- #nginx配置文件
- server {
- listen 80;
- listen 443;
- #
- ssl on;
- ssl_certificate /etc/nginx/conf.d/baiqiuyi.com.crt;
- #ssl_certificate_key /etc/nginx/conf.d/baiqiuyi.com.key;
- ssl_certificate_key /etc/nginx/conf.d/nopasswd.baiqiuyi.com.key;
- server_name localhost;
- location / {
- root /usr/share/nginx/html;
- index index.php index.html index.htm;
- }
- location ~ \.php$ {
- root /usr/share/nginx/html;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- }
1 1