“安装Apache”的版本间的差异
跳到导航
跳到搜索
Jihongchang(讨论 | 贡献) |
Jihongchang(讨论 | 贡献) |
||
(未显示同一用户的2个中间版本) | |||
第1行: | 第1行: | ||
* 安装 Apache 软件 | * 安装 Apache 软件 | ||
*#获取 Apache 安装软件 | *#获取 Apache 安装软件 | ||
− | *#*官网 https://httpd.apache.org/[[文件:Apache安装文件名说明.png|无|缩略图]] | + | *#*官网 https://httpd.apache.org/[[文件:Apache安装文件名说明.png|无|缩略图]]'''<big>注意:Apache 与之后的 PHP 必须同为32位或64位版本</big>''' |
*#*确认已经安装对应的编译环境[[文件:编译环境版本对照.png|无|缩略图]][[文件:控制面板编译环境.png|无|缩略图|900x900px|替代=]] | *#*确认已经安装对应的编译环境[[文件:编译环境版本对照.png|无|缩略图]][[文件:控制面板编译环境.png|无|缩略图|900x900px|替代=]] | ||
*#修改 httpd.conf | *#修改 httpd.conf | ||
第41行: | 第41行: | ||
*Httpd.exe 的详细应用 | *Httpd.exe 的详细应用 | ||
*#服务器进程:运行之后才能够工作[[文件:Httpd.exe进程.png|无|缩略图]] | *#服务器进程:运行之后才能够工作[[文件:Httpd.exe进程.png|无|缩略图]] | ||
− | *#查看使用的模块:httpd -M[[文件:查看使用的模块.png|无|缩略图|600x600像素]] | + | *#用来查看 Apache 具有哪些功能以及配置文件是否有错:httpd 或者 httpd.exe(文件所在目录) |
+ | *##查看使用的模块:httpd -M[[文件:查看使用的模块.png|无|缩略图|600x600像素]] | ||
+ | *##验证配置文件是否有效:httpd -t[[文件:Httpd验证配置文件是否有效.png|无|缩略图|450x450像素]] |
2022年8月9日 (二) 17:38的最新版本
- 安装 Apache 软件
- 获取 Apache 安装软件
- 官网 https://httpd.apache.org/注意:Apache 与之后的 PHP 必须同为32位或64位版本
- 确认已经安装对应的编译环境
- 修改 httpd.conf
- 获取 Apache 安装软件
配置 Apache 主程序根目录
Define SRVROOT "E:/record/2022/8/9/httpd-2.4.54-o111p-x86-vs17/Apache24"
ServerRoot "${SRVROOT}"
配置监听端口
#Listen 12.34.56.78:80
Listen 80
配置服务器根目录
DocumentRoot "${SRVROOT}/htdocs"
配置服务器根目录下子目录的访问权限
<Directory "${SRVROOT}/htdocs">
...
</Directory>
安装 Apache 到服务,以管理员身份运行:
E:\record\2022\8\9\httpd-2.4.54-o111p-x86-vs17\Apache24\bin>httpd.exe -k install -n "Apache24"
附从服务中卸载:
E:\record\2022\8\9\httpd-2.4.54-o111p-x86-vs17\Apache24\bin>httpd.exe -k uninstall -n "Apache24"
此时可以运行 GUI 程序 ApacheMonitor.exe 控制 Apache服务 start、stop
访问 http://localhost 测试是否安装成功
- Apache 的目录结构说明
- Httpd.exe 的详细应用
- 服务器进程:运行之后才能够工作
- 用来查看 Apache 具有哪些功能以及配置文件是否有错:httpd 或者 httpd.exe(文件所在目录)
- 查看使用的模块:httpd -M
- 验证配置文件是否有效:httpd -t