您的位置:首页 > 运维架构 > Apache

PHP+apache 安装 配置(windows)(进行中)

2012-10-31 13:38 686 查看
配置主机名:

找到文件 C:\WINDOWS\system32\drivers\etc\hosts, 增加主机名配置


127.0.0.1       localhost
127.0.0.1       water.mantis.net

apache for windows地址: http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/
.If PHP is used with IIS then choose PHP 5.3 VC9 Non Thread Safe or PHP 5.2 VC6 Non Thread Safe;

.If PHP is used with IIS7 or greater and PHP 5.3+, then the VC9 binaries of PHP should be used.

.If PHP is used with Apache 1 or Apache 2 then choose PHP 5.3 VC6 or PHP 5.2 VC6.

缺省配置文件:apache_installed_dir/conf/httpd.conf

配置监听端口



Listen 80
Listen 8000
Listen 192.0.2.1:80
Listen 192.0.2.5:8000
[/code]
安装windows service命令

安装和卸载缺省名字的service(Apache2.2).


httpd.exe -k install


httpd.exe -k uninstall


安装指定名字的service

httpd.exe -k install -n "MyServiceName"


[/code]
httpd.exe -k uninstall-n "MyServiceName"



安装指定名字,指定配置文件的service


[/code]

httpd.exe -k install -n "MyServiceName"-f "c:\files\my.conf" 


测试服务的配置文件


httpd.exe -n "MyServiceName" -t


net start [service] 例如开启本地的

NET START Apache2.2


[/code]

NET STOP Apache2.2


Apache启动命令

httpd.exe -k start


httpd.exe -k start -n "
MyServiceName
"



httpd.exe -k restart -n "MyServiceName
"[/code]

httpd.exe -k stop -n "
MyServiceName
"[code]


[/code]

httpd.exe -k shutdown
-n "
MyServiceName
"

查看日志:Start - Settings - Control Panel - Administrative Tools - Event Viewer.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: