這個東西其實我很早以前就據說了,可是一直沒有去嘗試使用,我一直使用的是lnmp一鍵安裝包,可是lnmp一鍵安裝包是安裝java環境的,oneinstack更強大一點php
https://oneinstack.com/
java
首先使用vagrant建立一個虛擬機,若是不會使用vagrant,那麼就在個人博客裏面搜索vagrant這個關鍵詞就行了 vagrant box add ubuntu/xenial64
vagrant init ubuntu/xenial64
vagrant up
vagrant ssh
其實具體的操做和docker-machine差很少啦,就是它是針對虛擬機而不是容器而已node
其實oneinstack源碼存儲在不少地方,國內阿里雲和又拍雲,國外Linode和sourceforge都有,因此不存在說我使用國外的服務器的時候下載源碼很慢,或者使用國內服務器的時候下載源碼很慢的問題,真的很良心,我是從又拍雲下載的 wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz
通常下載速度就是滿速下載了 下載完成以後解壓 tar -zxvf oneinstack-full.tar.gz
以後執行安裝腳本 sudo ./install.sh
linux
####################################################################### # OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+ # # For more information please visit https://oneinstack.com # ####################################################################### Please input SSH port(Default: 22): 22 Do you want to enable iptables? [y/n]: n Do you want to install Web server? [y/n]: y Please select Nginx server: 1. Install Nginx 2. Install Tengine 3. Install OpenResty 4. Do not install Please input a number:(Default 1 press Enter) 1 Please select Apache server: 1. Install Apache-2.4 2. Install Apache-2.2 3. Do not install Please input a number:(Default 3 press Enter) 3 Please select tomcat server: 1. Install Tomcat-9 2. Install Tomcat-8 3. Install Tomcat-7 4. Install Tomcat-6 5. Do not install Please input a number:(Default 5 press Enter) 5 Do you want to install Database? [y/n]: y Please select a version of the Database: 1. Install MySQL-8.0 2. Install MySQL-5.7 3. Install MySQL-5.6 4. Install MySQL-5.5 5. Install MariaDB-10.2 6. Install MariaDB-10.1 7. Install MariaDB-10.0 8. Install MariaDB-5.5 9. Install Percona-5.7 10. Install Percona-5.6 11. Install Percona-5.5 12. Install AliSQL-5.6 13. Install PostgreSQL 14. Install MongoDB Please input a number:(Default 2 press Enter) 3 Please input the root password of MySQL(default: VHnnHFMN): woyaoxuehuilinux Please choose installation of the database: 1. Install database from binary package. 2. Install database from source package. Please input a number:(Default 1 press Enter) 2 Do you want to install PHP? [y/n]: y Please select a version of the PHP: 1. Install php-5.3 2. Install php-5.4 3. Install php-5.5 4. Install php-5.6 5. Install php-7.0 6. Install php-7.1 7. Install php-7.2 Please input a number:(Default 5 press Enter) 7 Do you want to install opcode cache of the PHP? [y/n]: y Do you want to install ionCube? [y/n]: n Do you want to install ImageMagick or GraphicsMagick? [y/n]: n Do you want to install Pure-FTPd? [y/n]: n Do you want to install phpMyAdmin? [y/n]: n Do you want to install redis? [y/n]: n Do you want to install memcached? [y/n]: n Do you want to install HHVM? [y/n]: n
總之這個腳本的可選擇性不少,並且和lnmmp一鍵安裝包相比可選擇性不少,用這個來部署web環境真的很方便 可是我的以爲,這些不是它最牛逼的地方,它最牛逼的地方是它的一些小腳本web
環境部署好了總得管理這個環境吧,好比網站備份,ftp帳號管理什麼的,沒錯它均可以作到 有時候在安裝的時候沒有考慮到,漏裝了php的一些擴展,或者在安裝的時候你沒有選擇安裝ftp,phpmyadmin等組件的時候,你能夠執行下面這個腳本 ./addons.sh
來添加一些組件 在配置虛擬主機的時候很麻煩不想寫配置文件的時候,你能夠執行下面這個腳本 ./vhost.sh
當你想刪除虛擬主機的時候,能夠這麼作 ./vhost.sh del
想給ftp服務添加帳號的時候,你能夠這麼作 ./pureftpd_vhost.sh
固然網站備份很重要,你能夠執行下面這個腳原本備份網站 ./backup_setup.sh
oneinstack支持把網站備份到本地青雲又拍雲阿里雲還有遠程服務器上 固然安裝方便更新也方便,只要執行下面這個腳本就能夠了 ./upgrade.sh
那麼卸載呢? ./uninstall.sh
除了上面,還有一個更牛逼的功能,看下面這個網址你就知道了 https://oneinstack.com/auto
redis
歡迎關注Bboysoul的博客www.bboysoul.com Have Fundocker