LAMP - CentOS7+Apache2.4+MySQL8+PHP7.3环境搭建

作者&投稿:鄣韦 (若有异议请与网页底部的电邮联系)
~ yum -y install epel-release

yum -y install yum-utils

yum update

yum -y install httpd

systemctl enable httpd

systemctl start httpd

firewall-cmd --permanent --zone=public --add-service=http

firewall-cmd --permanent --zone=public --add-service=https

firewall-cmd --reload

# 隐藏版本号

vim /etc/httpd/conf.d/secure.conf

TraceEnable off

ServerSignature Off

ServerTokens Prod

# 配置vhost

vim /etc/httpd/conf.d/vhosts.conf

DocumentRoot "/var/www/html"

ServerName example.com

ServerAlias www.example.com

ErrorLog "logs/example.com-error_log"

CustomLog "logs/example.com-access_log" combined

yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

yum install certbot python2-certbot-apache

certbot --apache

systemctl restart httpd

# 安装MySQL8 YUM源

rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm

yum install mysql-community-server

systemctl enable mysqld

systemctl start mysqld

# 查看自动生成的MySQL密码

grep "password" /var/log/mysqld.log

# 登录MySQL后修改密码

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';

# 刷新MySQL权限表

FLUSH PRIVILEGES;

yum-config-manager --disable remi-php54

yum-config-manager --enable remi-php73

yum -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-opcache php-redis php-soap

# 隐藏php版本号

vim /etc/php.ini

expose_php = off

系统参数设置

# 文件打开数设置

ulimit -n 65535

vim /etc/security/limits.d/nofile.conf

* soft nofile 65535

* hard nofile 65535

# 内核网络优化

vim /etc/sysctl.conf

# 启用timewait 快速回收

net.ipv4.tcp_tw_recycle = 1


大悟县18664135847: linux中centos7怎么yum安装lamp环境 -
段残乌拉: 安装Lamp环境.1. 安装apahce yum install httpd 可能会用到的:systemctl start httpd.service #启动apache systemctl stop httpd.service #停止apache systemctl restart httpd.service #重启apache systemctl enable httpd.service #设置apache开机启动2...

大悟县18664135847: centos7 装lamp环境 怎么解决 -
段残乌拉: 工具/原料 CentOS 7 电脑 方法/步骤 LAMP环境即为Linux、Apache、MySQL、PHP的简称 首先确保你的yum仓库配置正确,我直接使用163的yum源,切换至root用户,使用命令# cd /etc/yum.repos.d/进入对应文件夹,将下载好的163yum源放在...

大悟县18664135847: CentOS7服务器LAMP配置,怎么在CentOS上安装LAMP _
段残乌拉: 一、配置防火墙,开启80端口、3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙.1、关闭firewall:systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动2、安装...

大悟县18664135847: linux中centos7怎么安装lamp环境 -
段残乌拉: 首先为了搭建一个稳定的lamp的练习环境,确保你的虚拟机可以连网,这里我们使用的yum安装,它可以帮助我们解决软件自己的依赖关系.我还在后面加了postgresql数据库如果不需要的话可以去掉和postgresql的参数.命令如下 yum -y install ...

大悟县18664135847: centos 7 lamp环境搭建完毕后访问不了php文件(空白页面)(html可以) -
段残乌拉: 先在head里面写一点内容: <meta charset="UTF-8"> <title>test</title>再试着在body内容里面写上点内容比如:<div><h1>这是一个test页面</h1></div>

大悟县18664135847: centos 什么是LAMP环境? -
段残乌拉: L 是 类linux 系统.redhat , centos , ubuntu 等系统 ! A 是 apache,是web服务器!如IIS M 是 mysql 是数据库.P 是PHP 是编译引擎.

大悟县18664135847: 如何在centos上搭建lamp后有什么用法 -
段残乌拉: 如果你说的是安装的位置的话你可以看一下 阿里云系统的结构, 我觉得挺不错了.如果是在单硬盘上安装的话, 可以用lvm 创建一个分区 /data 如果是两个硬盘的话 更好, 一个安装系统, 另一个挂载/data/server/apache/data/server/mysql/data/server/php /data/www # 放网站程序 当然, 上面说的也不是必须的, 你可以放到你觉得可以的地方,只有分区够大.

大悟县18664135847: CentOS上安装LAMP应该怎样卸载 -
段残乌拉: 这要看你是怎么安装的 如果是yum安装的:yum remove apache mysql php 如果是rpm安装的:rpm -e apache rpm -e mysql rpm -e php 如果是编译安装的:直接删除你编译的那个文件夹就行了,如:rm -rf /usr/local/mysql

大悟县18664135847: 怎样在centos7上安装apache -
段残乌拉: yum -y install httpd httpd-devel gcc gcc-c++ libstdc++-devel autoconf automake libtool systemctl start httpd.service systemctl enable httpd.service firewall-cmd --permanent --add-service http systemctl restart firewalld.service

大悟县18664135847: centos 7 lamp环境搭建完后可以做什么 -
段残乌拉: 关于基础和服务器的服务可以百度《Linux就该这样学》,书籍不错,但目前只有电子挡的,希望可以帮到你...

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网