在cygwin上运行apache2

来源:互联网 发布:mac战网该服务器 编辑:程序博客网 时间:2024/06/03 21:45

cygwin上运行linux软件是很方便啦,不过像httpd这样的后台守护进程,还需要一些帮助才行。

安装cygwin时选中apache httpd。
安装cygserver。(好像叫cygrunserver)
执行/usr/bin/cygserver-config。会在windows的服务中生成CYGWIN cygserver

$ /usr/bin/cygserver-configGenerating /etc/cygserver.conf fileWarning: The following function requires administrator privileges!Do you want to install cygserver as service?(Say "no" if it's already installed as service) (yes/no) yesThe service has been installed under LocalSystem account.To start it, call `net start cygserver' or `cygrunsrv -S cygserver'.Further configuration options are available by editing the configurationfile /etc/cygserver.conf. Please read the inline information in thatfile carefully. The best option for the start is to just leave it alone.Basic Cygserver configuration finished. Have fun!

启动cygserver

$ net start cygserverCYGWIN cygserver 服务正在启动 .CYGWIN cygserver 服务已经启动成功。

配置/etc/apache2/httpd.conf并启动apache

$ /usr/sbin/apachectl2 -k start

如果未启动cygserver直接启动apache,会发生下面错误。

/usr/sbin/apachectl2: line 78: 3088 Bad system call