编译安装php5.6
  1. 下载 http://cn2.php.net/distributions/php-5.6.5.tar.gz,tar -xvzf

  2. ./configure -prefix=/usr/local/php -with-apxs2=/usr/local/apache/bin/apxs -enable-fpm  -with-curl  -with-openssl  -enable-mbregex  -with-mysql  -with-mysqli  -with-mysql-sock  -enable-pdo  -with-pdo-mysql  -with-pdo-sqlite  -enable-mysqlnd  -with-gd  -enable-gd-native-ttf  -enable-exif  -with-jpeg-dir=/usr/local/jpeg  -with-png-dir=/usr/local/png  -with-freetype-dir=/usr/local/freetype  -enable-gd-jis-conv  -with-gettext  -with-zlib  -enable-zip  -with-bz2  -disable-fileinfo  -enable-xmlreader  -enable-xmlwriter  -with-xmlrpc  -enable-mbstring  -enable-inline-optimization -enable-sockets  -with-mcrypt -with-mhash -enable-pcntl

  3. make&make install

安装mysql
  1. 添加mysql源rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

  2. 可以修改vim /etc/yum.repos.d/mysql-community.repo源,改变默认安装的mysql版本。比如要安装5.6版本,将5.7源的enabled=1改成enabled=0。然后再将5.6源的enabled=0改成enabled=1即可

  3. 安装yum install mysql-community-server

  4. 启动mysql-serverservice mysqld start

  5. 登录mysqlmysql -u root -p,初始密码为空,直接回车

  6. 修改密码:

    1. use mysql
    2. UPDATE user SET password=password("123321") WHERE user='root';
    3. 刷新权限FLUSH PRIVILEGES;
  7. 添加远程链接权限:grant all privileges on *.* to 'myuser'@'%' identified by 'mypassword' with grant option;

  8. 查看配置文件find / -name my.cnf

  9. mysql5.7会自动生成密码并保存到/var/log/mysqld.log中,可通过grep 'temporary password' /var/log/mysqld.log查看,并通过命令SET PASSWORD = PASSWORD('Yong531315ZZ@#'); 更改密码

安装vsftpd (FTP服务器)
  1. yum安装vsftpdyum install -y vsftpd
  2. 修改vsftpd的配置文件vim /etc/vsftpd/vsftpd.conf
  3. 不允许匿名访问 anonymous_enable=NO
  4. 允许使用本地帐户进行FTP用户登录验证local_enable=YES
  5. 使用户不能离开主目录
    1
    2
    3
    
    chroot_local_user=YES   
    chroot_list_enable=YES
    chroot_list_file=/etc/vsftpd/chroot_list
    
  6. 配置文件最后添加allow_writeable_chroot=YES
  7. 如果/etc/vsftpd/chroot_list不存在,则需要创建该文件
  8. 设定支持ASCII模式的上传和下载功能。ascii_upload_enable=YES ascii_download_enable=YES
  9. 重启vsftpdsystemctl restart vsftpd.service
  10. 新建FTP用户useradd -d /var/ftp/public_root -g ftp -s /sbin/nologin ftpuser
  11. 修改该FTP用户密码passwd ftpuser
参考:CentOS 7 安装 FTP 服务
配置文件最佳实践
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ftpd_banner=Welcome to blah FTP service.
chroot_local_user=YES
listen=NO
listen_ipv6=YES

allow_writeable_chroot=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

pasv_enable=YES
pasv_min_port=port port_number
pasv_max_port=port_number
pasv_promiscuous=NO
pasv_address
vsFTPd的553 Could not create file 错误
Tips
  1. yum 查看安装的软件yum list installed | grep nginx
  2. yum 列出远程仓库里的软件yum list | grep mysql
  3. centos安装完成后,运行yum update -y进行更新、修复
  4. 修改目录用户归属chown -R nobody:nobody 目录名称