首先安装CentOS7
系统更新
[root@bogon ~]# yum update
安装PHP7.1
本系统使用remi的源 Remi, 使用的single php版本
按照文档配置好repository。
// 2018-11-13 的文档是
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum install yum-utils
# yum-config-manager --enable remi-php71
# yum update
// 确保是PHP7.1
[root@bogon ~]# yum info php
[root@bogon ~]# yum install php php-fpm php-common php-mysqlnd php-pear php-gd php-devel php-mbstring php-mcrypt php-cli php-pdo php-xml php-intl php-bcmath php-swoole php-seaslog php-redis php-zip
[root@bogon ~]# php -m
安装Nginx
安装方法参考官方提示的 Nginx
[root@bogon ~]# vi /etc/yum.repos.d/nginx.repo
输入
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
[root@bogon ~]# yum install nginx
[root@bogon ~]# service nginx start
[root@bogon ~]# iptables -I INPUT -p tcp --dport http -j ACCEPT
安装sphinx
[root@bogon ~]# yum install postgresql-libs mysql-connector-odbc
[root@bogon ~]# wget http://sphinxsearch.com/files/sphinx-2.2.11-1.rhel7.x86_64.rpm
[root@bogon ~]# rpm ivh sphinx-2.2.11-1.rhel7.x86_64.rpm
Sphinx installed!
Now create a full-text index, start the search daemon, and you're all set.
To manage indexes:
editor /etc/sphinx/sphinx.conf
To rebuild all disk indexes:
sudo -u sphinx indexer --all --rotate
To start/stop search daemon:
systemctl start/stop searchd
To query search daemon using MySQL client:
mysql -h 0 -P 9306
mysql> SELECT * FROM test1 WHERE MATCH('test');
See the manual at /usr/share/doc/sphinx-2.2.11 for details.
安装vsftp
[root@bogon ~]# yum install vsftpd
[root@bogon ~]# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.orig
[root@bogon ~]# vi /etc/vsftpd/vsftpd.conf
//修改这些值
anonymous_enable=NO
xferlog_file=/var/log/xferlog
ftpd_banner=Welcome to Weitaming FTP service.
chroot_local_user=YES
allow_writeable_chroot=YES
listen=YES
#listen_ipv6=YES //注释掉
//在vsftpd.conf最下方加入:
guest_enable=YES
guest_username=nginx
virtual_use_local_privs=YES
user_sub_token=$USER
local_root=/data/www/wtmdata/ftp/vendor/$USER
user_config_dir=/etc/vsftpd/user_conf
[root@bogon ~]# mkdir /etc/vsftpd/user_conf
//copy user_conf下的配置文件
[root@bogon ~]# vi /etc/pam.d/vsftpd
//修改里边的配置项全部注释,增加一下两行
auth required pam_userdb.so db=/data/www/wtmdata/ftp/vendor/vuser
account required pam_userdb.so db=/data/www/wtmdata/ftp/vendor/vuser
[root@bogon ~]# db_load -T -t hash -f /data/www/wtmdata/ftp/vendor/vuser.txt /data/www/wtmdata/ftp/vendor/vuser.db
[root@bogon ~]# service vsftpd restart
如果发现用户可以连接但是无法显示目录,可能是
[root@bogon ~]# vi /etc/vsftpd/vsftpd.conf在最后面加入如下:
pasv_min_port=5555
pasv_max_port=5566
如果防火墙开启,则需要开放上边的端口
[root@bogon ~]# vi /etc/sysconfig/iptables 加入如下:
-A INPUT -m state –state NEW -m tcp -p tcp –dport 5555:5566 -j ACCEPT
如果是阿里云,则需要修改相应的安全组规则