“安装Apache”的版本间的差异

来自姬鸿昌的知识库
跳到导航 跳到搜索
第3行: 第3行:
 
*#*官网 https://httpd.apache.org/[[文件:Apache安装文件名说明.png|无|缩略图]]
 
*#*官网 https://httpd.apache.org/[[文件:Apache安装文件名说明.png|无|缩略图]]
 
*#*确认已经安装对应的编译环境[[文件:编译环境版本对照.png|无|缩略图]][[文件:控制面板编译环境.png|无|缩略图|900x900px|替代=]]
 
*#*确认已经安装对应的编译环境[[文件:编译环境版本对照.png|无|缩略图]][[文件:控制面板编译环境.png|无|缩略图|900x900px|替代=]]
 +
*#修改 httpd.conf
 +
配置 Apache 主程序根目录
 +
<syntaxhighlight lang="apacheconf">
 +
Define SRVROOT "E:/record/2022/8/9/httpd-2.4.54-o111p-x86-vs17/Apache24"
 +
ServerRoot "${SRVROOT}"
 +
</syntaxhighlight>
  
  
修改 httpd.conf
+
配置监听端口
 
<syntaxhighlight lang="apacheconf">
 
<syntaxhighlight lang="apacheconf">
Define SRVROOT "E:/record/2022/8/9/httpd-2.4.54-o111p-x86-vs17/Apache24"
+
#Listen 12.34.56.78:80
ServerRoot "${SRVROOT}"
+
Listen 80
 +
</syntaxhighlight>
 +
 
 +
配置服务器根目录<syntaxhighlight lang="apacheconf">
 +
DocumentRoot "${SRVROOT}/htdocs"
 +
</syntaxhighlight>
 +
 
 +
配置服务器根目录下子目录的访问权限<syntaxhighlight lang="apacheconf">
 +
<Directory "${SRVROOT}/htdocs">
 +
    ...
 +
</Directory>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
 +
安装 Apache 到服务,'''<u><big>以管理员身份运行</big></u>''':<syntaxhighlight lang="powershell">
 +
E:\record\2022\8\9\httpd-2.4.54-o111p-x86-vs17\Apache24\bin>httpd.exe -k install -n "Apache24"
 +
</syntaxhighlight>
 +
附从服务中卸载:<syntaxhighlight lang="powershell">
 +
E:\record\2022\8\9\httpd-2.4.54-o111p-x86-vs17\Apache24\bin>httpd.exe -k uninstall -n "Apache24"
 +
</syntaxhighlight>
  
 
*Apache 的目录结构说明
 
*Apache 的目录结构说明
 
*Httpd.exe 的详细应用
 
*Httpd.exe 的详细应用

2022年8月9日 (二) 09:38的版本

  • 安装 Apache 软件
    1. 获取 Apache 安装软件
    2. 修改 httpd.conf

配置 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"
  • Apache 的目录结构说明
  • Httpd.exe 的详细应用