This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: trouble running Apache 1.3.33-2 as a service


I wrote:
> $ mkpasswd -l | grep www >> /etc/passwd

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

Thank you for your help.  :-)

I checked before doing the incantation.  The result was the same in my
simple case (yours is probably better/safer):

$ mkpasswd -l | grep www
www:unused_by_nt/2000/xp:1006:513:www,U-A64X23800P\www,S-1-5-21-44853972
3-688789
844-839522115-1006:/home/www:/bin/bash

$ mkpasswd -l -u www
www:unused_by_nt/2000/xp:1006:513:www,U-A64X23800P\www,S-1-5-21-44853972
3-688789
844-839522115-1006:/home/www:/bin/bash

$ grep www /etc/passwd
www:unused_by_nt/2000/xp:1006:513:www,U-A64X23800P\www,S-1-5-21-44853972
3-688789
844-839522115-1006:/home/www:/bin/bash


I wrote:
> I have edited /etc/apache/httpd.conf:
...
> User www

René Berber wrote::
> 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).

Change reverted, but Apache still refuses to start:

$ vi /etc/apache/httpd.conf

$ egrep '^[#\w]*User' /etc/apache/httpd.conf
#User nobody

$ net start httpd
The CYGWIN httpd service is starting.
The CYGWIN httpd service could not be started.

The service did not report an error.

More help is available by typing NET HELPMSG 3534.


I wrote:
> "apachectl status" does not work, even if I attempt to enable it in
> httpd.conf:

René Berber wrote::
> You have to configure Apache to enable this option.

I'll try again:

$ vi /etc/apache/httpd.conf

$ grep -A 7 "Location /server-status" /etc/apache/httpd.conf
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 192.168.0.0/255.255.0.0
    Allow from .holgerdanske.com
</Location>

$ apachectl start
/usr/sbin/apachectl start: httpd started

$ apachectl status

             Apache Server Status for a64x23800p.holgerdanske.com

   Server Version: Apache/1.3.33 (Cygwin)
   Server Built: Sep 16 2005 18:06:48
     _________________________________________________________________

   Current Time: Tuesday, 25-Nov-2008 17:35:18 PST
   Restart Time: Tuesday, 25-Nov-2008 17:35:13 PST
   Parent Server Generation: 0
   Server uptime: 5 seconds
   1 requests currently being processed, 0 idle servers
W...............................................................
................................................................
................................................................
................................................................

   Scoreboard Key:
   "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
   "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
   "L" Logging, "G" Gracefully finishing, "." Open slot with no current
   process

Success!  :-)  I must have screwed up on the previous attempt...


Stop still fails:

$ apachectl stop
?) not runninghectl stop: httpd (pid 3740

$ ps -a | grep httpd
     3740       1    3740       3740    0  500 17:46:01 /usr/sbin/httpd
     3024    3740    3740       3024    0  500 17:46:02 /usr/sbin/httpd


René Berber wrote::
> You are using -F with Apache, is that "foreground"? I prefer to run
> daemons as daemons using "-x /path/to/apache.pid".

I'm just trying to RTFM and follow the instructions so that Cygwin
Apache starts when the system boots:

$ less /usr/share/doc/Cygwin/apache-1.3.33.README
...
Starting the daemon:

You can start the daemon either as a Windows service or as a Cygwin
background
process.

Use cygrunsrv to install Apache as Windows service:

 # Install HTTPD that starts automatically after system bring up:
 $ cygrunsrv.exe -I httpd -d "CYGWIN httpd" -p /usr/sbin/httpd -a -F

 # Install HTTPD that starts manually after system bringup:
 $ cygrunsrv.exe -I httpd -d "CYGWIN httpd" -p /usr/sbin/httpd -a -F -t
manual

The -F option is needed to run the daemon in foreground.
...


René Berber wrote:
> Use "cygrunsrv -VQ httpd", is Account LocalSystem? or it has a space
> like you show?

$ cygrunsrv -VQ httpd
Service             : httpd
Display name        : CYGWIN httpd
Current State       : Stopped
Command             : /usr/sbin/httpd -F
stdin path          : /dev/null
stdout path         : /var/log/httpd.log
stderr path         : /var/log/httpd.log
Process Type        : Own Process
Startup             : Automatic
Account             : LocalSystem


Any other suggestions?


TIA,

David


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]