強大的一鍵部署網站架構工具Oneinstack

Oneinstack

1、Oneinstack的特性:


持續不斷更新,支持交互、無人值守安裝
源碼編譯安裝,大多數源碼是最新stable版,並從官方網址下載
提供多個數據庫版本(MySQL-8.0, MySQL-5.7, MySQL-5.6, MySQL-5.5, MariaDB-10.4,MariaDB-10.3,MariaDB-10.2,MariaDB-5.5,Percona-8.0, Percona-5.7, Percona-5.6, Percona-5.5,AliSQL-5.6,PostgreSQL, MongoDB)
提供多個PHP版本(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和nginx waf功能
提供多個Apache版本(Apache-2.4,Apache-2.2)
提供多個Tomcat版本(Tomcat-9,Tomcat-8,Tomcat-7,Tomcat-6)
提供多個JDK版本(JDK-11.0,JDK-1.8,JDK-1.7,JDK-1.6)
根據自己需求安裝PHP緩存加速器,提供ZendOPcache、xcache、apcu、eAccelerator。及php加解密工具ionCube、ZendGuardLoader
根據自己需求安裝Pureftpd、phpMyAdmin
根據自己需求安裝Memcached、Redis
jemalloc優化MySQL、Nginx
提供添加虛擬主機腳本
提供Nginx/Tengine/OpenResty/Apache、PHP、Redis、Memcached、phpMyAdmin升級腳本
提供本地備、遠程(rsync)、阿里雲OSS、騰訊雲COS、又拍雲、七牛雲、亞馬遜S3和Dropbox備份腳本
提供CentOS 6、7下HHVM安裝

2、Oneinstack開源軟件版本


在這裏插入圖片描述
在之前幾乎隔一段時間部署LNMP/LAMP網站架構,有時候nginx mysql php需要裝半個小時,尤其是源碼編譯安裝更加長久,在安裝的過程中稍有不留意就會配錯導致服務網站無法正常運行。 後來自己慢慢開始寫一鍵安裝部署腳本如下:
在這裏插入圖片描述
這個腳本也是曾經費煙,費精力,費時間,加上思路構想,加上編寫,在測試一共下來浪費了太多的時間,缺點是還不能靈活性的選擇軟件版本。放在不同的操作系統中出現不穩定現象導致最後部署失敗的局面也真是讓人頭疼。 今天介紹的這個工具是一個強大的shell腳本。 部署如下:

3、Oneinstack的部署安裝


推薦又拍雲CDN下載,包含源碼
http://mirrors.linuxeye.com/oneinstack-full.tar.gz
http://mirrors.linuxeye.com/oneinstack-full-beta.tar.gz #beta版本


國外線路(Linode Fremont,10M/s),包含源碼
http://mirrors.linuxeye.com/oneinstack-full.tar.gz


Dropbox,包含源碼
https://www.dropbox.com/s/iampc7prd9y7cqf/oneinstack-full.tar.gz


sourceforge,包含源碼
http://downloads.sourceforge.net/project/oneinstack/oneinstack-full.tar.gz


歐洲線路,包含源碼
https://mirrors.dtops.cc/linuxeye/oneinstack-full.tar.gz


不包含源碼,建議僅國外主機下載
http://mirrors.linuxeye.com/oneinstack.tar.gz

3.1、下載oneinstack

[root@yankerp ~]# wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz
--2020-06-07 09:34:44--  http://mirrors.linuxeye.com/oneinstack-full.tar.gz
Resolving mirrors.linuxeye.com (mirrors.linuxeye.com)... 223.85.20.154, 183.236.31.250, 2409:8c54:b000:704:4cb3:fbff:fe07:e72d, ...
Connecting to mirrors.linuxeye.com (mirrors.linuxeye.com)|223.85.20.154|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 325082415 (310M) [application/octet-stream]
Saving to: ‘oneinstack-full.tar.gz’

100%[=============================================================================================================================================>] 325,082,415 2.27MB/s   in 3m 50s 

2020-06-07 09:38:35 (1.35 MB/s) - ‘oneinstack-full.tar.gz’ saved [325082415/325082415]

3.2、解壓安裝

[root@yankerp ~]# tar zxf oneinstack-full.tar.gz 
[root@yankerp ~]# cd  oneinstack
[root@yankerp oneinstack]# ll
total 264
-rwxr-xr-x. 1 root root  5865 May 30 23:31 addons.sh
-rwxr-xr-x. 1 root root 24795 May 30 23:31 backup_setup.sh
-rwxr-xr-x. 1 root root 11347 May 30 23:31 backup.sh
drwxr-xr-x. 2 root root  4096 May 30 23:31 config
drwxr-xr-x. 2 root root  4096 May 30 23:31 include
drwxr-xr-x. 2 root root  4096 May 30 23:31 init.d
-rwxr-xr-x. 1 root root 50927 May 30 23:31 install.sh
-rw-r--r--. 1 root root 11358 May 30 23:31 LICENSE
-rw-r--r--. 1 root root  2569 May 30 23:31 options.conf
-rwxr-xr-x. 1 root root  7760 May 30 23:31 pureftpd_vhost.sh
-rw-r--r--. 1 root root  4936 May 30 23:31 README.md
-rwxr-xr-x. 1 root root  4938 May 30 23:31 reset_db_root_password.sh
drwxr-xr-x. 2 root root  4096 May 30 23:31 src
drwxr-xr-x. 2 root root  4096 May 30 23:31 tools
-rwxr-xr-x. 1 root root 30445 May 30 23:31 uninstall.sh
-rwxr-xr-x. 1 root root  5782 May 30 23:31 upgrade.sh
-rw-r--r--. 1 root root  2044 May 30 23:31 versions.txt
-rwxr-xr-x. 1 root root 53382 May 30 23:31 vhost.sh
[root@yankerp oneinstack]# 

3.3、運行install.sh

Please input SSH port(Default: 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.4
	 6. Install MariaDB-10.3
	 7. Install MariaDB-10.2
	 8. Install MariaDB-5.5
	 9. Install Percona-8.0
	10. Install Percona-5.7
	11. Install Percona-5.6
	12. Install Percona-5.5
	13. Install AliSQL-5.6
	14. Install PostgreSQL
	15. Install MongoDB
Please input a number:(Default 2 press Enter) 2
Please input the root password of MySQL(default: 5vVS1ruk): pwd123

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) 1

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
	8. Install php-7.3
	9. Install php-7.4
Please input a number:(Default 7 press Enter) 5

Do you want to install opcode cache of the PHP? [y/n]: y
Please select a opcode cache of the PHP:
	1. Install Zend OPcache
	3. Install APCU
Please input a number:(Default 1 press Enter) 1

Please select PHP extensions:
	 0. Do not install
	 1. Install zendguardloader(PHP<=5.6)
	 2. Install ioncube
	 3. Install sourceguardian(PHP<=7.2)
	 4. Install imagick
	 5. Install gmagick
	 6. Install fileinfo
	 7. Install imap
	 8. Install ldap
	 9. Install phalcon(PHP>=5.5)
	10. Install yaf(PHP>=7.0)
	11. Install redis
	12. Install memcached
	13. Install memcache
	14. Install mongodb
	15. Install swoole
	16. Install xdebug(PHP>=5.5)
Please input numbers:(Default '4 11 12' press Enter) 0

Do you want to install Pure-FTPd? [y/n]: n

Do you want to install phpMyAdmin? [y/n]: y

Do you want to install redis-server? [y/n]: n

Do you want to install memcached-server? [y/n]: n

Do you want to install HHVM? [y/n]: n

官網解釋圖:

在這裏插入圖片描述

3.4、安裝過程圖:

在這裏插入圖片描述
安裝完成後,會提示是否重新啓動服務器,選 YES即可。

4、驗證訪問

4.1、訪問php測試頁

打開瀏覽器輸入:http://IP地址/phpinfo.php出現以下界面
在這裏插入圖片描述

4.2、訪問ocp頁面

打開瀏覽器輸入http://IP地址/ocp.php出現以下界面:
在這裏插入圖片描述

4.3、訪問xprober監控檢測頁面

打開瀏覽器輸入:http://IP地址/xprober.php出現以下界面:
在這裏插入圖片描述

4.3.1、驗證xprober監控檢測

使用ab壓力測試工具,模擬2000個併發用戶數對此服務器發送10000個請求,查看xprober後臺cpu佔用信息。

[root@yankerp ~]# ab -n 10000 -c 2000 192.168.31.196/xprober.php
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.31.196 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests

在這裏插入圖片描述

4.4、驗證MySQL數據庫密碼

[root@yankerp ~]# mysql -uroot -ppwd123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.30-log MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.21 sec)

在這裏插入圖片描述
MySQL數據庫密碼來源:
在這裏插入圖片描述

4.5、驗證phpMyAdmin

打開瀏覽器輸入:http://IP地址/phpMyAdmin/出現以下界面:
在這裏插入圖片描述
登錄成功後即可對MySQL數據庫進行增刪改查操作。
在這裏插入圖片描述

5、服務配置路徑


Nginx conf文件路徑:/usr/local/nginx/conf/nginx.conf
PHP conf 文件路徑:/usr/local/php/etc/php-fpm.conf
MySQL conf 文件路徑:/etc/my.cnf
網頁根目錄路徑:/data/wwwroot/default/ 有php源碼網頁可以丟在此目錄下

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章