yum安装LNMP服务部署

一  安装nginx 

yum install epel-release -y
yum install nginx -y
[root@localhost ~]# systemctl start nginx.service
[root@localhost ~]# systemctl status nginx.service
[root@localhost ~]# systemctl enable nginx.service

二 安装开发包

yum -y install ntp make openssl openssl-devel pcre pcre-devel libpng libpng-devel libjpeg-6b libjpeg-devel-6b freetype freetype-devel gd gd-devel zlib zlib-devel gcc gcc-c++ libXpm libXpm-devel ncurses ncurses-devel libmcrypt libmcrypt-devel libxml2 libxml2-devel imake autoconf automake screen sysstat compat-libstdc++-33 curl curl-devel

三  安装数据库

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


为root账户设置密码

[root@localhost ~]#mysql_secure_installation  #初始化MySQL

初始化数据库
Enter current password for root (enter for none):   <---输入现在的root密码,因为我们还没设置,直接回车
Set root password? [Y/n] Y                                    <---是否设定root密码,当然设置了,输入Y回车
New password:                                                      <---输入root密码,并回车,输入的过程中不会有任何显示
Re-enter new password:                                        <---再次输入root密码,并回车,输入的过程中不会有任何显示
Remove anonymous users? [Y/n] Y                      <---是否删除匿名用户,删除,输入Y回车
Disallow root login remotely? [Y/n] Y                     <---是否删禁止root用户远程登录,当然禁止,输入Y回车
Remove test database and access to it? [Y/n]      <---是否删除测试数据库test,看个人喜好
Reload privilege tables now? [Y/n] Y                    <---刷新权限,输入Y回车
最后出现:Thanks for using MySQL!
MySql密码设置完成,重新启动 MySQL:

四 安装php
 

yum -y install php php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap

安装php扩展支持mysql 

yum install  php-tidy php-common php-devel php-fpm php-mysql -y
[root@localhost ~]# systemctl start php-fpm.service
[root@localhost ~]# systemctl status php-fpm.service

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ELIAUK``

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值