LAMP环境yum安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34193883/article/details/74007617

LAMP/LNMP

安装前准备

service iptables stop #关闭防火墙

##selinux关闭selinux
setenforce 0    #临时关闭selinux
getenforce #查看selinux的状态

vim /etc/selinux/config #编辑配置文件,永久关闭

SELINUX=disabled
#SELINUXTYPE=targeted

安装apache也就是httpd

yum install -y httpd

service httpd start #开启apache
service httpd stop #停止运行apache
service httpd restart   #重启apache

安装php

yum install -y php php-fpm php-mysql php-mysqli php-pdo php-gd #安装php以及相关扩展

service php-fpm start   #开启
service php-fpm stop    #关闭
service php-fpm restart #重启

安装mysql

yum install -y mysql mysql-server mysql-devel   #安装mysql客户端 服务端 和开发支持库

/usr/bin/mysqladmin -u root password 'new-password'

service mysqld start 
service mysqld stop
service mysqld restart

nginx

yum install -y nginx    #安装

service nginx start
service nginx stop
service nginx restart   

最后一条命令搞定

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 nginx mysql mysql-server mysql-devel  php php-mysql gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap php-fpm

安装lnmp只需要再单独安装nginx就可以了

yum install -y nginx

猜你喜欢

转载自blog.csdn.net/qq_34193883/article/details/74007617