780

0

OneinStack - PHP/JAVA 部署工具

本脚本使用shell编写,为了快速部署 (生产环境下的Linux、Nginx LEMP/ Tengine LAMP/ OpenResty、MySQL/MariaDB/Percona、PHP、JAVA),适用于CentOS 7~8(LNMP包括LNMPAredhat LTMP,AlmaLinux,Rocky), Debian 9 ~ 11, Ubuntu 16 ~ 21, Fedora 27+ of 64.

该脚本使用shell编写,以快速部署LEMP/LAMP/LNMP/LNMPA/LTMP(Linux、Nginx/Tengine/OpenResty、MySQL在生产环境中/MariaDB/Percona、PHP、JAVA),适用于CentOS 7、8(包括redhat、AlmaLinux、Rocky)、Debian 9、11、Ubuntu 16~21、Fedora 27+64。

脚本属性:

  • 持续更新,提供Shell交互和自动安装
  • 源码编译安装,最稳定的源码是最新版本,官网下载
  • 一些安全优化
  • 提供多个数据库版本(MySQL-8.0、MySQL-5.7、MySQL-5.6、MySQL-5.5、MariaDB-10.5、MariaDB-10.4、MariaDB-10.3、MariaDB-5.5、Percona-8.0、Percona-5.7、Percona-5.6 , Percona-5.5, PostgreSQL, MongoDB)
  • 提供多个 PHP 版本(PHP-8.1、PHP-8.0、PHP-7.4、PHP-7.3、PHP-7.2、PHP-7.1、PHP-7.0、PHP-5.6、PHP-5.5、PHP-5.4、PHP-5.3)
  • 提供 Nginx、Tengine、OpenResty、Apache 和 ngx_lua_waf
  • 提供多个Tomcat版本(Tomcat-10、Tomcat-9、Tomcat-8、Tomcat-7)
  • 提供多个JDK版本(OpenJDK-8、OpenJDK-11)
  • 根据自己的需要安装PHP Cache Accelerator,提供ZendOPcache、xcache、apcu、eAccelerator。和 php 扩展,包括 ZendGuardLoader,ionCube,SourceGuardian,imagick,gmagick,fileinfo,imap,ldap,calendar,phalcon,yaf,yar,redis,memcached,memcache,mongodb,swoole,xdebug
  • 根据自己的需要安装Nodejs、Pureftpd、phpMyAdmin
  • 根据自己的需要安装memcached、redis
  • Jemalloc 优化 MySQL、Nginx
  • 提供添加虚拟主机脚本,包括 Let's Encrypt SSL 证书
  • 提供Nginx/Tengine/OpenResty/Apache/Tomcat、MySQL/MariaDB/Percona、PHP、Redis、Memcached、phpMyAdmin升级脚本
  • 提供本地、远程(服务器间rsync)、阿里云OSS、Qcloud COS、UPYUN、QINIU、Amazon S3、Google Drive和Dropbox备份脚本

安装

为您的发行版安装依赖项,下载源代码并运行安装脚本。

CentOS/红帽

yum -y install wget screen

Debian/Ubuntu

apt-get -y install wget screen

下载源代码并安装

wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz
tar xzf oneinstack-full.tar.gz
cd oneinstack

如果在安装过程中断开连接,可以执行命令 screen -r oneinstack重新连接到安装窗口

screen -S oneinstack

如果需要修改目录(安装、数据存储、Nginx日志),options.conf在运行install.sh之前修改文件

./install.sh

如何安装另一个 PHP 版本

~/oneinstack/install.sh --mphp_ver 54

如何添加扩展

~/oneinstack/addons.sh

如何添加虚拟主机

~/oneinstack/vhost.sh

如何删除虚拟主机

~/oneinstack/vhost.sh --del

如何添加 FTP 虚拟用户

~/oneinstack/pureftpd_vhost.sh

如何备份

~/oneinstack/backup_setup.sh    // Backup parameters
~/oneinstack/backup.sh    // Perform the backup immediately
crontab -l    // Can be added to scheduled tasks, such as automatic backups every day 1:00
  0 1 * * * cd ~/oneinstack/backup.sh  > /dev/null 2>&1 &

如何管理服务

Nginx/Tengine/OpenResty:

systemctl {start|stop|status|restart|reload} nginx

MySQL/MariaDB/Percona:

systemctl {start|stop|restart|reload|status} mysqld

PostgreSQL:

systemctl {start|stop|restart|status} postgresql

MongoDB:

systemctl {start|stop|status|restart|reload} mongod

PHP:

systemctl {start|stop|restart|reload|status} php-fpm

Apache:

systemctl {start|restart|stop} httpd

Tomcat:

systemctl {start|stop|status|restart} tomcat

Pure-FTPd:

systemctl {start|stop|restart|status} pureftpd

redis:

systemctl {start|stop|status|restart|reload} redis-server

memcached:

systemctl {start|stop|status|restart|reload} memcached

如何升级

~/oneinstack/upgrade.sh

如何卸载

~/oneinstack/uninstall.sh

安装

如需反馈、问题以及关注项目进度: Telegram Group OneinStack