LNMP环境脚本包安装

来源:互联网 发布:大掌柜软件 编辑:程序博客网 时间:2024/05/17 02:35

第二次写文章。第一次写文章不是很懂规矩。图片不能贴上去。也喜欢大佬能够多多评论指点。不断学习才是进步的重点。

昨天mysql的编译最后还是没有完成。很遗憾。今天只LNMP脚本包一键安装。看看效果到此怎么样

地址https://lnmp.org/ 我下载的是1.3版本的。现在我们解压安装好 测试环境是腾讯云 centos7

[root@VM_40_120_centos ~]# cd lnmp1.3-full/
[root@VM_40_120_centos lnmp1.3-full]# ll
总用量 80
-rwxr-xr-x 1 root root 3883 10月 15 2015 addons.sh
-rw-r--r-- 1 root root 7985 5月  27 2016 ChangeLog
drwxr-xr-x 3 root root 4096 9月  14 2015 conf
drwxr-xr-x 2 root root 4096 6月  13 2016 include
drwxr-xr-x 2 root root 4096 7月   9 2015 init.d
-rwxr-xr-x 1 root root 4848 3月  17 2016 install.sh
-rw-r--r-- 1 root root  209 4月   7 2016 License
-rw-r--r-- 1 root root  287 12月 31 2015 lnmp.conf
-rwxr-xr-x 1 root root 6245 12月  4 2015 php5.2.17.sh
-rwxr-xr-x 1 root root 3788 3月  17 2016 pureftpd.sh
-rw-r--r-- 1 root root 5336 5月  27 2016 readme
drwxr-xr-x 3 root root 4096 7月   9 2015 src
drwxr-xr-x 2 root root 4096 7月   9 2015 tools
-rwxr-xr-x 1 root root 4596 2月  16 2016 uninstall.sh
-rwxr-xr-x 1 root root 2769 3月  10 2016 upgrade.sh

这是解压后的内容 然后执行install.sh脚本 

./install.sh


进入安装界面

+------------------------------------------------------------------------+
|          LNMP V1.3 for CentOS Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|        A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux       |
+------------------------------------------------------------------------+
|          For more information please visit http://www.lnmp.org         |
+------------------------------------------------------------------------+
Please setup root password of MySQL.(Default password: root)
Please enter: 

询问的是mysql设置密码 直接回车默认是root

Do you want to enable or disable the InnoDB Storage Engine?
Default enable,Enter your choice [Y/n]: Y
You will enable the InnoDB Storage Engine
===========================
You have 5 options for your DataBase install.
1: Install MySQL 5.1.73
2: Install MySQL 5.5.48 (Default)
3: Install MySQL 5.6.29
4: Install MariaDB 5.5.48
5: Install MariaDB 10.0.23
6: Install MySQL 5.7.11
Enter your choice (1, 2, 3, 4, 5 or 6): 
No input,You will install MySQL 5.5.48
===========================
You have 6 options for your PHP install.
1: Install PHP 5.2.17
2: Install PHP 5.3.29
3: Install PHP 5.4.45 (Default)
4: Install PHP 5.5.36
5: Install PHP 5.6.22
6: Install PHP 7.0.7
Enter your choice (1, 2, 3, 4, 5 or 6): 6
You will install PHP 7.0.7
===========================
You have 3 options for your Memory Allocator install.
1: Don't install Memory Allocator. (Default)
2: Install Jemalloc
3: Install TCMalloc
Enter your choice (1, 2 or 3): 
No input,You will not install Memory Allocator.


Press any key to install...or Press Ctrl+c to cancel

大部分是默认。

php是7.0版本

安装脚本包需要注意的是 1.selinux关闭掉 2.保证yum源正常 3.防火墙关闭

+------------------------------------------------------------------------+
|         For more information please visit http://www.lnmp.org          |
+------------------------------------------------------------------------+
|    lnmp status manage: lnmp {start|stop|reload|restart|kill|status}    |
+------------------------------------------------------------------------+
|  phpMyAdmin: http://IP/phpmyadmin/                                     |
|  phpinfo: http://IP/phpinfo.php                                        |
|  Prober:  http://IP/p.php                                              |
+------------------------------------------------------------------------+
|  Add VirtualHost: lnmp vhost add                                       |
+------------------------------------------------------------------------+
|  Default directory: /home/wwwroot/default                              |
+------------------------------------------------------------------------+
|  MySQL/MariaDB root password: root                          |
+------------------------------------------------------------------------+
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              http://lnmp.org              |
+-------------------------------------------+
nginx (pid 9049 9046) is running...
php-fpm is runing!
MySQL running (9581)[  确定  ]
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
Install lnmp V1.3 completed! enjoy it.

安装完成!

启动一下服务看看

这是脚本包安装的目录/etc/rc.d/init.d/下

在/home/wwwroot/下写个php页面打开。

浏览器访问 http://123.207.7.xx/test.php

成功访问。

虽然用脚本包安装成功但是毕竟不是二进制包手动配置的。配置文件路径什么都不是很清楚。所以lnmp.org官网写了配置文件地址。

LNMP相关配置文件位置
Nginx主配置(默认虚拟主机)文件:/usr/local/nginx/conf/nginx.conf
添加的虚拟主机配置文件:/usr/local/nginx/conf/vhost/域名.conf
MySQL配置文件:/etc/my.cnf
PHP配置文件:/usr/local/php/etc/php.ini
php-fpm配置文件:/usr/local/php/etc/php-fpm.conf
PureFtpd配置文件:/usr/local/pureftpd/pure-ftpd.conf 1.3及更高版本:/usr/local/pureftpd/etc/pure-ftpd.conf
PureFtpd MySQL配置文件:/usr/local/pureftpd/pureftpd-mysql.conf
Proftpd配置文件:/usr/local/proftpd/etc/proftpd.conf 1.2及之前版本为/usr/local/proftpd/proftpd.conf
Proftpd 用户配置文件:/usr/local/proftpd/etc/vhost/用户名.conf
Redis 配置文件:/usr/local/redis/etc/redis.conf

二进制包的lnmp环境还会继续尝试的。



0 0
原创粉丝点击