天天看點

在cygwin上運作apache2

cygwin上運作linux軟體是很友善啦,不過像httpd這樣的背景守護程序,還需要一些幫助才行。

安裝cygwin時選中apache httpd。

安裝cygserver。(好像叫cygrunserver)

執行/usr/bin/cygserver-config。會在windows的服務中生成CYGWIN cygserver

$ /usr/bin/cygserver-config
Generating /etc/cygserver.conf file
Warning: 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) yes
The 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 configuration
file /etc/cygserver.conf. Please read the inline information in that
file carefully. The best option for the start is to just leave it alone.
Basic Cygserver configuration finished. Have fun!           

啟動cygserver

$ net start cygserver
CYGWIN cygserver 服務正在啟動 .
CYGWIN cygserver 服務已經啟動成功。           

配置/etc/apache2/httpd.conf并啟動apache

$ /usr/sbin/apachectl2 -k start           

如果未啟動cygserver直接啟動apache,會發生下面錯誤。

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

繼續閱讀