Aliyun Centos 7 LNMP安装(最新版LNMP-test18580)

5 篇文章 0 订阅
5 篇文章 0 订阅

systemctl status firewalld.service    ##查看防火墙
systemctl stop firewalld.service      ##停止防火墙
systemctl disable firewalld.service   ##开机自启服务 删除

###Nginx#######安装篇############
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum list nginx
yum -y install nginx

systemctl start nginx.service
systemctl enable nginx.service

###Nginx#######测试篇######################
用windows浏览器    测试  
http://http://39.107.105.231/(阿里云IP)    
看到:
    Welcome to nginx!  
表示:
    Nginx安装成功了
###########################################

=======接》》着》》安装》》PHP》》=================================================》》》》


###Php56#######安装篇############
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum -y install php56w php56w-fpm php56w-opcache php56w-mysql php56w-gd libjpeg* php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mbstring php56w-bcmath

systemctl start php-fpm.service
systemctl enable php-fpm.service

vim /etc/nginx/conf.d/default.conf

:set nu  #####开启行数   
###将30行-36行  前面 # 去掉   
###将 第31行  "html"  改成  /usr/share/nginx/html
###将 第34行  "/scripts"  改成  $document_root

   location ~ \.php$ {
       root           /usr/share/nginx/html;
       fastcgi_pass   127.0.0.1:9000;
       fastcgi_index  index.php;
       fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
       include        fastcgi_params;
    }

:wq! ##退出保存

systemctl restart nginx.service
systemctl restart php-fpm.service

vim /usr/share/nginx/html/index.php  
###编辑如下代码   测试环境脚本
<?php  
   echo phpinfo();  
?>


###Nginx关联php脚本#######测试篇######################
用windows浏览器    测试  
http://39.107.105.231/index.php (阿里云IP)    
看到:
    PHP Version 5.6.36
表示:
    Nginx关联php成功了,也就是PHP安装成功了!
#####################################################

=========接》》着》》安装》》MySQL》》=================================================》》》》

###Mysql#######安装篇############
rpm -qa|grep mariadb    #查看阿里云默认安装的mariadb数据库   版本号:如:mariadb-libs-5.5.56-2.el7.x86_64
rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64   ##卸载mariadb-libs-5.5.56-2.el7.x86_64包  (rpm -e --nodeps 后面跟是上个命令查询结果)

rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64


rpm -ivh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum list mysql-community-server
yum -y install mysql-community-server

systemctl start mysqld.service   
systemctl enable mysqld.service  

mysql_secure_installation     ###初始化  mysql系统数据(安装系统数据库)

##提示:   Enter current password for root (enter for none):  
空密码,回车

##提示:  Set root password? [Y/n]
y,回车

##提示:  New password:
输入数据库密码,如:zha123456    (两次重复密码)

##提示:  Remove anonymous users? [Y/n]
y,回车  

##提示:  Disallow root login remotely? [Y/n]
y,回车  

##提示:  Remove test database and access to it? [Y/n]
y,回车  

##提示:  Reload privilege tables now? [Y/n]
y,回车  

###提示: 看到:
Thanks for using MySQL!


mysql -h localhost -u root -p
Enter password:********   test18580

mysql>
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'test18580' WITH  GRANT OPTION;      ##开启mysql远程访问权限
mysql>flush privileges;     ##刷新权限
mysql>exit;

systemctl stop firewalld.service

###MySQL#######测试篇######################
###提示: 阿里云 安全组 克隆规则  
允许    自定义 TCP    3306/3306    地址段访问    0.0.0.0/0     System created rule.
用Navicat for MySQL    新建连接测试  
表示:
    Navicat for MySQL 连接阿里云Ip数据库,
    外网访问正常,ok!!
#####################################################》》over!!!

博主网址:www.imdam.com it博客之家

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值