本文主要是介绍linux中Apach服务器构建,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
linux中Apach服务器构建
- 1.Apache的作用
- 2.Apache的安装
- 3.Apache的启用
- 4.Apache的基本信息
- 5.Apache的基本配置
1.Apache的作用
- Apache是使用最广泛的Web服务器软件。Apache是由Apache Software Foundation开发和维护的,它是一个免费提供的开源软件,它占全球所有网络服务器的67%。
- 在web被访问时通常使用 http:// 的方式
- http:// 被称为超文本传输协议,是互联网上应用最为广泛的一种网络协议。
- http:// 超文本传输协议提供软件: Apache(百度)、 nginx(QQ)、 stgw(腾讯) 、jfe(京东)、 Tengine(淘宝)
2.Apache的安装
dnf install httpd.x86_64 -y
3.Apache的启用
systemctl enable --now httpd
开启服务并设定服务位开机启动
命令 | 功能 |
---|---|
firewall-cmd --list-all | 查看火墙信息 |
firewall-cmd --permanent --add-service=http | 在火墙中永久开启http访问 |
firewall-cmd --permanent --add-service=https | 在火墙中永久开启https访问 |
firewall-cmd --reload | 刷新火墙使设定生效 |
4.Apache的基本信息
-
服务名称: httpd
-
配置文件:
/etc/httpd/conf/httpd.conf (主配置文件)
/etc/httpd/conf.d/.conf* (子配置文件) -
默认发布目录: /var/www/html
-
默认发布文件: index.html
-
默认端口:
80 (http)
443 (https) -
用户: apache
-
日志: /etc/httpd/logs
5.Apache的基本配置
1.Apache端口修改
vim /etc/httpd/conf/httpd.conf
2.默认发布文件
vim /etc/httpd/conf/httpd.conf
3.默认发布目录
vim /etc/httpd/conf/httpd.conf
这篇关于linux中Apach服务器构建的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!