Centos7.9 使用yum搭建LAMP平台

基础环境:

1)虚拟机需要联网

2)关闭防火墙和内核安全机制

[root@centos7 ~]# systemctl stop firewalld

[root@centos7 ~]# setenforce 0

一、安装http服务

1.1 安装apache 软件包

[root@centos7 ~]# yum install httpd httpd-devel -y

/var/www/html                    ###网站发布目录

/etc/httpd                        ###httpd服务的根目录

/var/log/httpd/access_log           ###存放访问日志

/var/log/httpd/error_log            ###存放错误日志

/etc/httpd/conf/httpd.conf          ###主配置文件

  

[root@centos7 ~]# egrep -v  "#|^$" /etc/httpd/conf/httpd.conf

ServerRoot "/etc/httpd"                              ###服务目录 

Listen 80                                          ###在所有IP地址上监听端口

User apache                                       ###运行服务的用户

Group apache                                      ###运行服务的用户组

ServerAdmin root@localhost                          ###管理员邮箱

ServerName www.example.com:80                     ###设置网站域名

DocumentRoot "/var/www/html"                      ###网站发布目录

ErrorLog "logs/error_log"                             ###错误日志文件

LogLevel warn                                      ###日志级别

CustomLog "logs/access_log" combined                 ###正常访问日志

AddDefaultCharset UTF-8                             ###网页默认字符集

1.2 启动apache服务

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值