阿里云FreeBSD系统升级与安装PHP环境

系统升级

阿里云的FreeBSD系统默认安装版本是10.1,这个版本已经超出了官方的维护时间了,所以首先要进行系统的版本升级

  1. 设置当前系统版本为10.1-release,setenv UNAME_r "10.1-RELEASE"
  2. 修改update源,默认的官方源由于某些原因,慢的丧心病狂,所有我们要使用镜像源.这里推荐使用chinafreebsd的update源.

    • vi /etc/freebsd-update.conf
    • 将官方update源注释掉 #ServerName update.FreeBSD.org
    • 添加chinafreebsd的update源 ServerName update1.chinafreebsd.cn
  3. 升级系统到10.3-release

    • 获取系统升级信息 freebsd-update upgrade -r 10.3-RELEASE
    • 安装 freebsd-update install 中间可能有一些合并会有文件冲突,需要手动解决冲突,类似于git的冲突解决方法
    • 重启 reboot
    • 再次执行 freebsd-update install
  4. 执行 freebsd-version -k -u查看升级结果

安装Posgresql

当前版本的mariadb全新安装有BUG,执行有问题。所以就安装了另外一个很喜欢的数据库Postgresql
mariadb的bug已经修复了,后面会补上mariadb的安装

 pkg install postgresql95-server postgresql95-pltcl
 sysrc postgresql_enable=YES #添加自启动
 service postgresql initdb #初始化数据库
 service postgresql start  #启动数据库服务

安装PHP

    pkg install php71  php71-pdo php71-pdo_pgsql php71-openssl php71-bz2 php71-mbstring php71-xml php71-json php71-gd php71-filter php71-phar php71-calendar php71-ctype php71-curl php71-exif  php71-bcmath php71-dom php71-dba php71-fileinfo php71-iconv php71-tokenizer php71-zlib php71-session

上面是一条命令

sysrc php_fpm_enable=YES
service php-fpm start

安装nginx

    pkg install nginx
    sysrc nginx_enable=YES  #自启动
    service nginx start

配置nginx

安装Mariadb

pkg install mariadb102-server mariadb102-client
sysrc mysql_ebable=YES
cp /usr/local/share/mysql/my-medium.cnf /usr/local/etc/my.cnf
service mysql-server start
    原文作者:墨风
    原文地址: https://segmentfault.com/a/1190000009718696
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞