Centmin Mod 优秀的LNMP一键安装包-适用CentOS功能丰富操作方便
常用的LNMP和LAMP一键安装包主要有lnmp.org版LNMP、OneinStack,不管你是用Apache还是Nginx,都可以使用两个一键安装包快速搭建LNMP和LAMP环境。而LNMP一键安装包国外也有不少,由于有专人维护,这些安装包总是能给我们带来性能的提升。
本文要要分享的Centmin Mod就是一个国外的优秀的LNMP一键包,帮助你快速Nginx, MariaDB, PHP-FPM等Web环境,Centmin Mod 还提供了Centmin Mod Addons,这里有开发者开发的插件,利用这些插件你可以快速安装Letsencrypt 、Nginx Brotli Compression 、KernelCare等等。
Centmin Mod提供了丰富的服务器管理入口以及Web建站管理功能,Centmin Mod平台以及Web组件升级都是基于Git环境,非常方便。不过,Centmin Mod只能应用在CentOS 6 和 7上,其它的平台暂时不接受。可以看看这些:
- 1、LAMP 一键安装包-快速安装Apache,Mysql,PHP建站环境及Apache配置SSL证书
- 2、VPS面板:十款免费好用的中文VPS主机控制面板-让VPS建站像虚拟主机一样简单
- 3、便宜VPS主机推荐:十个便宜VPS主机分享-VPS服务器建站和搭建应用服务体验
Centmin Mod 优秀的LNMP一键安装包-适用CentOS功能丰富操作方便
1、Centmin Mod官网:
- 1、官方网站:https://centminmod.com/
2、新版的Centmin Mod包含的Web组件主要有:
- Nginx 1.11.10 (https / SPDY SSL / HTTP/2 SSL + ngx_pagespeed + Lua/LuaJIT support)
- PHP-FPM 5.5.38 + PHP 5.3, 5.4, 5.5, 5.6, and PHP 7.0支持Zend OpCache
- MariaDB 10.0.x
- PHP 缓存类: Zend OpCache 7.0.5+, APC Cache 3.13, Xcache 3.2.0
- Memcached Server 1.4.34 + Memcache 3.0.8+ PHP Extension
- Libmemcached 1.0.18 + Memcached 2.2.0 php扩展
- 多线程压缩: pigz, pbzip2, lbzip2, plzip, p7zip (optional)
- CSF 防火墙
- Pure-FTPD
3、Centmin Mod 前提条件有:SELINUX 必须关闭.VPS如果是CentOS 6.x最少要求是256MB memory,CentOS 7.x 64bit 则要求到少1GB memory .安装命令如下:
1 2 3 4 | #稳定版 yum -y update; curl -O https://centminmod.com/installer.sh && chmod 0700 installer.sh && bash installer.sh #测试版 yum -y update; curl -O https://centminmod.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh |
4、执行上面的命令后,待Centmin Mod安装成功后,就会看到如下提示了。
5、同时,Centmin Mod 还会给出Memcached Server和MariaDB登录管理用户名与密码,这个信息非常重要,建议大家复制保存下来。例如:
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 26 27 28 29 30 31 32 33 | ************************************************* * Centmin Mod install completed.... ************************************************* ************************************************* * Setup memcached_*.php admin page ... ************************************************* Setup Memcached Server Admin Login Details for /usr/local/nginx/html/memcache_4dfe6b99.php current memcached username: memcacheuser current memcached password: memcachepass ************************************************* Memcached Server Admin Login: /usr/local/nginx/html/memcache_4dfe6b99.php new memcached username: memadmin0d0d0d5222 new memcached password: 33e0ea8e3693da1aef0a3dbb ************************************************* ************************************************* * memcache_4dfe6b99.php admin page installed ************************************************* ************************************************* * MariaDB Security Setup ************************************************* ------------------------------------------------------- MySQL root user password set MySQL root user added to /root/.my.cnf ------------------------------------------------------- MySQL root password: 4AHOFOUixQrxbU6x ------------------------------------------------------- ************************************************* * MariaDB Security Setup Completed ************************************************* -------------------------------------------------------- Please bookmark: -------------------------------------------------------- |
6、打开IP地址,你就可以看到Centmin Mod 默认页面了。
1、执行以下命令可以打开Centmin Mod管理命令:
1 | /usr/bin/centmin |
2、接着就可以打开如下界面了,总共有24个选项,主要有Centmin Install、Add Nginx vhost domain、 PHP /Nginx升级、XCache/ APC Cache /XCache /APC 等。(点击放大)
3、Centmin Mod 1.2.3-eva2000.08详细命令如下(最新测试版本会有Letsencrypt 证书安装等):
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 26 27 28 29 30 31 | -------------------------------------------------------- Centmin Mod 1.2.3-eva2000.08 - http://centminmod.com -------------------------------------------------------- Centmin Mod Menu -------------------------------------------------------- 1). Centmin Install 2). Add Nginx vhost domain 3). NSD setup domain name DNS 4). Nginx Upgrade / Downgrade 5). PHP Upgrade / Downgrade 6). XCache Re-install 7). APC Cache Re-install 8). XCache Install 9). APC Cache Install 10). Memcached Server Re-install 11). MariaDB 5.2, 5.5, 10, 10.1 Upgrade Sub-Menu 12). Zend OpCache Install/Re-install 13). Install ioping.sh vbtechsupport.com/1239/ 14). SELinux disable 15). Install/Re-install ImageMagick PHP Extension 16). Change SSHD Port Number 17). Multi-thread compression: pigz,pbzip2,lbzip2,p7zip etc 18). Suhosin PHP Extension install 19). Install FFMPEG and FFMPEG PHP Extension 20). NSD Re-install 21). Update - Nginx + PHP-FPM + Siege 22). Add Wordpress Nginx vhost + WP Super Cache 23). Update Centmin Mod Code Base 24). Exit -------------------------------------------------------- Enter option [ 1 - 24 ] |
4、选择Add Nginx vhost domain,然后输入你要绑定的域名,FTP用户名与密码、是否自动生成自签名证书(如果你后期想安装SSL证书的话,建议选择是)。
5、稍等一会儿,Centmin Mod 就会自动帮你添加并绑定好域名了。
6、添加网站成功后,有几个重要的信息你需要记下来,SSL证书文件、CSR、key等路径,网站路径等。如下:
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | service nginx reload nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful Reloading nginx: [ OK ] service pure-ftpd restart Stopping pure-ftpd: [ OK ] Starting pure-ftpd: [ OK ] ------------------------------------------------------------- FTP hostname : 205.185.114.133 FTP port : 21 FTP mode : FTP (explicit SSL) FTP Passive (PASV) : ensure is checked/enabled FTP username created for freehao123.info : n FTP password created for freehao123.info : freehao123 ------------------------------------------------------------- vhost for freehao123.info created successfully domain: http://freehao123.info vhost conf file for freehao123.info created: /usr/local/nginx/conf/conf.d/freehao123.info.conf vhost ssl for freehao123.info created successfully domain: https://freehao123.info vhost ssl conf file for freehao123.info created: /usr/local/nginx/conf/conf.d/freehao123.info.ssl.conf /usr/local/nginx/conf/ssl_include.conf created Self-signed SSL Certificate: /usr/local/nginx/conf/ssl/freehao123.info/freehao123.info.crt SSL Private Key: /usr/local/nginx/conf/ssl/freehao123.info/freehao123.info.key SSL CSR File: /usr/local/nginx/conf/ssl/freehao123.info/freehao123.info.csr upload files to /home/nginx/domains/freehao123.info/public vhost log files directory is /home/nginx/domains/freehao123.info/log ------------------------------------------------------------- Current vhost listing at: /usr/local/nginx/conf/conf.d/ Feb 15 14:52 845 ssl.conf Feb 15 14:52 1.1K demodomain.com.conf Feb 15 14:52 1.6K virtual.conf Feb 16 03:36 1.7K freehao123.info.conf Feb 16 03:36 3.4K freehao123.info.ssl.conf ------------------------------------------------------------- Current vhost ssl files listing at: /usr/local/nginx/conf/ssl/freehao123.info Feb 16 03:32 1.7K freehao123.info.key Feb 16 03:32 1.1K freehao123.info.csr Feb 16 03:32 1.3K freehao123.info.crt Feb 16 03:36 424 dhparam.pem ------------------------------------------------------------- Commands to remove freehao123.info rm -rf /usr/local/nginx/conf/conf.d/freehao123.info.conf rm -rf /usr/local/nginx/conf/conf.d/freehao123.info.ssl.conf rm -rf /usr/local/nginx/conf/ssl/freehao123.info/freehao123.info.crt rm -rf /usr/local/nginx/conf/ssl/freehao123.info/freehao123.info.key rm -rf /usr/local/nginx/conf/ssl/freehao123.info/freehao123.info.csr rm -rf /usr/local/nginx/conf/ssl/freehao123.info rm -rf /home/nginx/domains/freehao123.info service nginx restart |
7、新添加的网站的根目录是在/home/nginx/domains/下。
8、打开/home/nginx/domains/freehao123.info/,里面有好几个文件,其中Public是根目录,另外还有备份、日志等目录。
9、网站配置文件在usr/local/nginx/conf/conf.d/下。
10、SSL证书、密钥等在/usr/local/nginx/conf/ssl/下,如果你想安装自己的SSL证书,直接将这些文件替换就行了。参考:LNMP安装Let’s Encrypt 免费SSL证书方法:自动安装与手动配置Nginx。
1、Centmin Mod默认的没有提供PhpMyAdmin来管理MariaDB,想要安装PhpMyAdmin的话,执行以下命令:
1 2 3 4 5 6 | ./centmin.sh #升级脚本 cd /usr/local/src/centminmod/addons wget --no-check-certificate https://github.com/centminmod/phpmyadmin/raw/master/phpmyadmin.sh #下载 chmod 0700 /usr/local/src/centminmod/addons/phpmyadmin.sh #赋予权限 cd /usr/local/src/centminmod/addons/ ./phpmyadmin.sh install #开始安装 |
2、安装完成后,会有如下提示,记下PhpMyAdmin访问账号与密码。注意:此处不是数据库Root密码。
3、phpmyadmin升级脚本在:/root/tools/phpmyadmin_update.sh,配置文件在:/usr/local/nginx/conf/php_31724_mysqladmin27004.conf,如下所示:
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 26 27 28 29 30 31 32 33 34 | Create uninstall script: /root/tools/phpmyadmin_uninstall.sh --------------------------------------------------------------- --------------------------------------------------------------- Password protected 31724_mysqladmin27004 at path /usr/local/nginx/html/31724_mysqladmin27004 config.inc.php at: /usr/local/nginx/html/31724_mysqladmin27004/config.inc.php WEB url: https://hao.freehao123.com/31724_mysqladmin27004 Login with your MySQL root username / password --------------------------------------------------------------- phpmyadmin htaccess login details: Username: admin8fB8vCmK0ac= Password: nJmgkTFayFJyJPUUtVJRyfvkk= Allowed IP address: xxx.xxx.xx.xx --------------------------------------------------------------- phpmyadmin update script at: /root/tools/phpmyadmin_update.sh Add your own cron job to automatically run the update script i.e. 15 01 * * * /root/tools/phpmyadmin_update.sh --------------------------------------------------------------- phpmyadmin uninstall script at: /root/tools/phpmyadmin_uninstall.sh /root/tools/phpmyadmin_uninstall.sh --------------------------------------------------------------- SSL vhost: /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf php-fpm includes: /usr/local/nginx/conf/php_31724_mysqladmin27004.conf php-fpm pool conf: /usr/local/nginx/conf/phpfpmd/phpfpm_myadmin.conf dedicated php-fpm pool user: phpmyadmin dedicated php-fpm pool group: nginx dedicated php error log: /var/log/php_myadmin_error.log --------------------------------------------------------------- SSL vhost access log: /var/log/nginx/localhost_ssl.access.log SSL vhost error log: /var/log/nginx/localhost_ssl.error.log --------------------------------------------------------------- |
4、打开phpmyadmin页面访问地址,先输入页面访问账号与密码(忘记的话,执行:cd /usr/local/src/centminmod/addons/,然后:./phpmyadmin.sh resetpwd),然后再输入MariaDB的Root与密码,登录。
5、这是phpmyadmin管理界面,和我平时使用的都是一样的,数据库创建、管理与备份等都是没有问题的。
四、Centmin Mod升级Nginx、PHP及安装APC Xcache, Zend Opcache等扩展
1、Centmin Mod默认安装PHP是5.5,我们可以在主菜单的第4、5项中执行:Nginx 升级/降级、 PHP 升级/降级。(点击放大)
2、升级过程也比较简单,你只需要输入你要升级或降级的PHP、Nginx版本号,然后软件就会自动下载安装了。
3、PHP升级到7.0以上的需要特别注意,原本适合PHP 7以下的PHP扩展插件可能会失效。
4、安装PHP opcode caches, APC Cache, Xcache, Zend Opcache 和 Memcached等,直接通过主菜单8). XCache Install 9). APC Cache Install 12). Zend OpCache Install/Re-install 完成。
1、Centmin Mod使用起来最大的问题就是官方的参考文档都是英文的,其实Centmin Mod还提供了APC Cache, Xcache, Memcache/Memcached, ImagicK, igbinary, FFMPEG 和 Suhosin等扩展,你可以到下列目录中找到他们的配置文件修改。
1 2 3 4 5 6 7 8 9 | /etc/centminmod/php.d/apc.ini (编辑 APC 内存) /etc/centminmod/php.d/xcache.ini (编辑 Xcache 内存) /etc/centminmod/php.d/igbinary.ini /etc/centminmod/php.d/imagick.ini /etc/centminmod/php.d/memcache.ini /etc/centminmod/php.d/memcached.ini /etc/centminmod/php.d/suhosin.ini (older installs will have ffmpeg.so directory loaded via (/usr/local/lib/php.ini) /etc/centminmod/php.d/ffmpeg.ini (older installs will have suhosin.so directory loaded via (/usr/local/lib/php.ini) /etc/centminmod/php.d/zendopcache.ini (可编辑 Zend Opcache 内存) |
2、Centmin Mod第二问题就只能用在CentOS上,其它的Linux平台就不能享受Centmin Mod的便利了。另外,Centmin Mod对于7.0以上的PHP支持不是很好,自己在升级时要特别注意。
文章出自:免费资源部落 https://www.freehao123.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。
您或许对下面这些文章有兴趣: 本月吐槽辛苦排行榜
- 用好这三个脚本轻松搭建服务器状态在线监控-ServerStatus,Stat Hub,Vmstat
- VPSSIM优秀LNMP一键安装包-快速部署SSL轻松建站专为WordPress优化
- LAMP 一键安装包-快速安装Apache,Mysql,PHP建站环境及Apache配置SSL证书
- LNMP安装Let’s Encrypt 免费SSL证书方法:自动安装与手动配置Nginx
- 十款免费好用的中文VPS主机控制面板-让VPS建站像虚拟主机一样简单
- 小内存大流量的VPS主机用途实例分析-云存储,CDN加速,负载均衡,应用服务
- Kloxo-MR免费且功能强大的VPS主机控制面板-安装,使用及中文设置
- OneinStack一键PHP/JAVA/HHVM安装和超详细的VPS手动安装LNMP