五.为apache安装rpaf模块,该模块用于apache做后端时获取访客真实的IP.
1.使用apxs安装模块.这里要使用此前apache编译安装后的apxs
cd /usr/local/src/
tar -zxf mod_rpaf-0.6.tar.gz
cd mod_rpaf-0.6
/usr/local/apache/bin/apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
2.编辑/usr/local/apache/conf/httpd.conf,添加模块参数,查找LoadModule php5_module modules/libphp5.so,在下方添加:
LoadModule rpaf_module modules/mod_rpaf-2.0.so
#Mod_rpaf settings
RPAFenable On
RPAFproxy_ips 127.0.0.1 [your_ips]
RPAFsethostname On
RPAFheader X-Forwarded-For
上面出现的[your_ips]请修改为你本机所监听web服务的ip.多个IP用空格空开.
六.安装ftp服务器:pure-ftpd
1.编译安装
cd /usr/local/src/
tar -zxf pure-ftpd-1.0.28.tar.gz
cd pure-ftpd-1.0.28
./configure –prefix=/usr/local/pureftpd –with-language=simplified-chinese –with-everything
make
make install
chmod u+x configuration-file/pure-config.pl
cp configuration-file/pure-config.pl /usr/local/pureftpd/sbin/
mkdir /usr/local/pureftpd/etc/
cp configuration-file/pure-ftpd.conf /usr/local/pureftpd/etc/
ln -s /usr/local/pureftpd/bin/pure-pw /usr/local/bin/
2.配置pure-ftpd,这里采用PureDB的验证方式.
vi /usr/local/pureftpd/etc/pure-ftpd.conf
查找 PureDB /etc/pureftpd.pdb 取消前面的#号并设置成PureDB/usr/local/pureftpd/etc/pureftpd.pdb
查找 PassivePortRange 取消前面的#号
其他参数根据需要进行修改
3.添加自启动.这里不创建init脚本.直接放在/etc/rc.local启动即可
echo "/usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf –daemonize" > /etc/rc.local
至此.所有安装工作结束.
如何使用这套系统
一,做好必要的安全工作
设置用户家目录/home/user,相关配置参数文件,以及访问日志等目录的权限.
chmod 711 /home
chmod 711 /usr/local/pureftpd
chmod 711 /usr/local/apache/conf/vhosts
chmod 711 /usr/local/nginx/conf/vhosts
chmod 711 /usr/local/apache/domlogs
chmod 711 /usr/local/apache/logs