centos7配置lanmp

xiaoxiao2021-02-28  68

mysql

mariadb安装

yum -y install mysql yum -y install mariadb-server mariadb yum -y install mysql-devel 这会安装mariaDB,mariaDB使用命令 安装后提示can’t connect to local mysql server through socket ‘/var/*/‘的原因 这时候是msyql没有开启:使用下面的命令即可

systemctl start mariadb #启动MariaDB systemctl stop mariadb #停止MariaDB systemctl restart mariadb #重启MariaDB systemctl enable mariadb #设置开机启动

安装mysql需要提交包资源

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 安装mysql-community

配置允许远程连接 grant all privileges on . to ‘root’@’%’ identified by ‘sheng199021guo’ with grant option;

apache

yum -y install httpd chkconfig httpd on service httpd start

nginx

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm yum install nginx service nginx start 启动nginx服务 systemctl start nginx.service 设置开机自启 systemctl enable nginx.service 停止开机自启 systemctl disable nginx.service 查看服务当前状态 systemctl status nginx.service 重新启动服务 systemctl restart nginx.service 查看所有已启动的服务 systemctl list-units –type=service

php

yum install php php-moudel 默认安装5.4版本,可以通过添加源来升级到更高版本

运行php时出现class pdo not found yum -y install php-pdo

需要配置文件

find / -name xxxx.conf

转载请注明原文地址: https://www.6miu.com/read-75027.html

最新回复(0)