Apache Http Server2.4的常用命令及安装步骤

软件: httpd-2.4.25-x86-vc11-r1.zip

常用命令:

1.httpd.exe -h  查看帮助
2.httpd.exe -k install (-n ServiceName)  注册安装该服务,取名为ServiceName,如果不加-n则默认命名
3.httpd.exe -k uninstall (-n ServiceName)  卸载删除该服务
4.sc delete ServiceName  使用windows命令删除服务
5.httpd.exe -k start (-n ServiceName)  # 也可使用windows自带的services工具,也可使用ApacheMonitor.exe。
6.httpd.exe -k restart (-n ServiceName)
7.httpd.exe -k stop|shutdown (-n ServiceName)


安装步骤:
1.将httpd.conf中的SRVROOT修改为自己的路径,要用/,不能用\,例如
Define SRVROOT "D:/Software/httpd-2.4.25-x86-vc11-r1/Apache24"

2.将httpd.conf中的Listen 修改为可用的端口号,例如
Listen 8088
ServerName localhost:8080

3.注册服务并且启动。

4.测试是否成功,输入http://localhost:端口号/

5.参考
http://jingyan.baidu.com/article/d8072ac47baf0eec95cefdca.html
http://jingyan.baidu.com/article/64d05a025cdf69de55f73be5.html
http://www.cnblogs.com/mingforyou/archive/2013/01/26/2878129.html

apache http server 2.2 安装常见问题http://blog.csdn.net/dongdong9223/article/details/64921439


配置CGI
cgi-bin的目录可以自己配置
1.ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"
2.<Directory "${SRVROOT}/cgi-bin">
    AllowOverride None
    Options +ExecCGI  
    Require all granted
</Directory>
3.AddHandler cgi-script .cgi .pl .py
4.测试python脚本
#!C:\Python27\python.exe
# -*- coding: UTF-8 -*-
print "Content-type:text/html"
print  # 必须有空行
print '<html>'
print '<head>'
print '<meta charset="utf-8">'
print '<title>asfd</title>'
print '<body><h1>hello, world</body>'
print '</head>'
print '</html>'






  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值