delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/11/25/01:45:58

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: =?ISO-8859-1?Q?Ren=E9_Berber?= <r DOT berber AT computer DOT org>
Subject: Re: trouble running Apache 1.3.33-2 as a service
Date: Tue, 25 Nov 2008 00:45:04 -0600
Lines: 93
Message-ID: <ggg6t3$hq6$1@ger.gmane.org>
References: <F7C38DDE00AA4DCF9B100FB2BF658A27 AT p43400e>
Mime-Version: 1.0
User-Agent: Thunderbird 2.0.0.18 (Windows/20081105)
In-Reply-To: <F7C38DDE00AA4DCF9B100FB2BF658A27@p43400e>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

David Christensen wrote:

> I have a fresh install of Cygwin on Windows XP Professional SP3,
> including Apache.
>=20
> I have created a Windows account "www" and updated /etc/passwd:
>=20
> $ mkpasswd -l | grep www >> /etc/passwd

This is usually done with "mkpasswd -l -u www >> /etc/passwd" and making
sure you don't already have a line for that user.

> I have edited /etc/apache/httpd.conf:
>=20
[snip]
> 324c324
> < #User nobody
> ---
>> User www

Danger Will Robinson! Windows requires certain privileges for a user to
be able to change a process owner... I would do things different: use
cygrunsrv to start Apache as user www, and comment out the User config
line (as it was originally).

[snip]
> I can successfully start Apache via apachectl:

This is really not interesting... you need it running as a Windows service.

> $ apachectl start
> /usr/sbin/apachectl start: httpd started
>=20
> "apachectl status" does not work, even if I attempt to enable it in
> httpd.conf:

You have to configure Apache to enable this option.

[snip]
> "apachectl stop" does not stop Apache, and displays a mangled error
> message:
>=20
> $ apachectl stop
> ?) not runninghectl stop: httpd (pid 2628
>=20
> I can kill Apache if I choose the right PID:
>=20
> $ ps -a | grep httpd
>      2628       1    2628       2628    0  500 21:21:48 /usr/sbin/httpd
>      1984    2628    2628       1984    0  500 21:35:40 /usr/sbin/httpd
>      3956       0       0       3956    0  500   Dec 31 /usr/sbin/httpd
>=20
> $ kill 2628
>=20
> I would like to have Apache automatically start at system boot and stop
> and system shutdown, and have attempted to follow the instructions given
> in:
>=20
>     /usr/share/doc/Cygwin/apache-1.3.33.README
>=20
> I installed Apache as follows:
>=20
>    $ cygrunsrv.exe -I httpd -d "CYGWIN httpd" -p /usr/sbin/httpd -a -F

As I said before, I would add the "-u www" option at least, probably "-s
? -y tcpip -o" (I don't remember which signals are used with Apache).
You are using -F with Apache, is that "foreground"? I prefer to run
daemons as daemons using "-x /path/to/apache.pid".

> "Services" shows:
>=20
> 	Name:			CYGWIN httpd
> 	Description:	<blank>
> 	Status:		<blank>
> 	Startup Type:	automatic
> 	Log on as:		Local System

Use "cygrunsrv -VQ httpd", is Account LocalSystem? or it has a space
like you show?

> Attempting to start the service:
[snip]

I might be wrong since I don't use Apache under Cygwin, but I would try
w/o the change of owner.
--=20
Ren=E9 Berber


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019