You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Timothy Orme <to...@genome.med.harvard.edu> on 2008/11/05 16:43:16 UTC

[users@httpd] Apache fails to start as service

Hello,

	I'm running Apache 2.2.10 on Windows 2003 EE. I have a directory aliased to a mapped network drive. I have setup a user which has permissions to access these drives, and have specified that the 
apache service should be run as that user (By changing the services "Log on" account). However, when I try and start this service, it fails. From the services MMC I receive an error message saying 
that Windows couldn't start the service due to an error code 1. When I try and start the service via the command line (httpd -k start) it fails silently. Whats strange is that if I simply run the 
command (httpd) Apache starts fine.
	
	I've tried several things to pin down what exactly is causing this issue and it seems to be that the service isn't really trying to run as the user I've specified. If I remove the directory alias to 
the network drive, I am able to start Apache as a service with no issues. I've also found several articles specifying how to set this up, but none seem to work:

	http://httpd.apache.org/docs/2.2/platform/windows.html#winsvc

	http://www.everything2.com/e2node/Connecting%2520to%2520a%2520network%2520resource%2520in%2520Apache

	Any help is greatly appreciated!

Thanks,
Tim

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache fails to start as service

Posted by André Warnier <aw...@ice-sa.com>.
Hi.

You may want to verify that Apache's logfiles are actually writeable by 
the user under which Apache runs (or should run) as a service.
If you have run Apache before from the command-line as Administrator, it 
may have created logfiles unwriteable by anyone else.
This would prevent Apache from writing the reason of the start failure 
to the logfile.
Alternatively, log off the system, login again as this Apache user, and 
then try to run it in a command window.

Williams, Dewey wrote:
> 
>> -----Original Message-----
>> From: Timothy Orme [mailto:torme@genome.med.harvard.edu]
>> Sent: Wednesday, November 05, 2008 10:43 AM
>> To: users@httpd.apache.org
>> Subject: [users@httpd] Apache fails to start as service
>>
>> Hello,
>>
>> 	I'm running Apache 2.2.10 on Windows 2003 EE. I have a directory
> aliased to a
>> mapped network drive. I have setup a user which has permissions to
> access these
>> drives, and have specified that the
>> apache service should be run as that user (By changing the services
> "Log on" account).
>> However, when I try and start this service, it fails. From the
> services MMC I receive an
>> error message saying
>> that Windows couldn't start the service due to an error code 1. When I
> try and start
>> the service via the command line (httpd -k start) it fails silently.
> Whats strange is that
>> if I simply run the
>> command (httpd) Apache starts fine.
>>
>>
>> Thanks,
>> Tim
> 
> 
> Tim,
> 
> I have had this problem for many versions of Apache (since 2.0) and it
> has yet to be resolved.  I have found that Apache will run in a Command
> Window, but not as a service.  Don't know why, have asked many Apache
> gurus here and "in the cloud" with no resolution.
> 
> If you find a solution please pass it on.
> 
> Dewey Williams
> UNC Charlotte
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache fails to start as service

Posted by Timothy Orme <to...@genome.med.harvard.edu>.
Hello Dewey,

	Well I was able to narrow down my problem and managed to find an "acceptable" workaround.

	It seems that when you map a network drive it is invisible to services regardless of permissions. This kind of makes sense, as my loose understanding of mapped network drives is that they are mapped 
at the time the user logs in. Since a service doesn't really go through a typical login on windows, I'm guessing that it just never maps these drives and therefore, trying to access a drive like "X:" 
fails. I should probably reiterate that this could be a completely wrong explanation of it, and it's really just my "best guess" as to how things work.

	My solution then was to simply reference the folders that I needed through their network share names in http.conf . For instance if I was originally mapping \\serverA\Files to X: and referencing X: 
in the http.conf, I just replaced my X: reference with \\serverA\Files. This seems to work just fine, and in my case, is a perfectly reasonable solution to this problem. When I start up  httpd now, it 
works fine as a service in the same way as from the command line.

	I'm not sure if this fixes the issue that your having (you didn't mention if it was due to mapped network drives) but if it is, hope this helps, and if you need more info just let me know.

Thanks,
Tim Orme

Williams, Dewey wrote:
> 
>> -----Original Message-----
>> From: Timothy Orme [mailto:torme@genome.med.harvard.edu]
>> Sent: Wednesday, November 05, 2008 10:43 AM
>> To: users@httpd.apache.org
>> Subject: [users@httpd] Apache fails to start as service
>>
>> Hello,
>>
>> 	I'm running Apache 2.2.10 on Windows 2003 EE. I have a directory
> aliased to a
>> mapped network drive. I have setup a user which has permissions to
> access these
>> drives, and have specified that the
>> apache service should be run as that user (By changing the services
> "Log on" account).
>> However, when I try and start this service, it fails. From the
> services MMC I receive an
>> error message saying
>> that Windows couldn't start the service due to an error code 1. When I
> try and start
>> the service via the command line (httpd -k start) it fails silently.
> Whats strange is that
>> if I simply run the
>> command (httpd) Apache starts fine.
>>
>>
>> Thanks,
>> Tim
> 
> 
> Tim,
> 
> I have had this problem for many versions of Apache (since 2.0) and it
> has yet to be resolved.  I have found that Apache will run in a Command
> Window, but not as a service.  Don't know why, have asked many Apache
> gurus here and "in the cloud" with no resolution.
> 
> If you find a solution please pass it on.
> 
> Dewey Williams
> UNC Charlotte
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache fails to start as service

Posted by "Williams, Dewey" <wi...@uncc.edu>.

> -----Original Message-----
> From: Timothy Orme [mailto:torme@genome.med.harvard.edu]
> Sent: Wednesday, November 05, 2008 10:43 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] Apache fails to start as service
> 
> Hello,
> 
> 	I'm running Apache 2.2.10 on Windows 2003 EE. I have a directory
aliased to a
> mapped network drive. I have setup a user which has permissions to
access these
> drives, and have specified that the
> apache service should be run as that user (By changing the services
"Log on" account).
> However, when I try and start this service, it fails. From the
services MMC I receive an
> error message saying
> that Windows couldn't start the service due to an error code 1. When I
try and start
> the service via the command line (httpd -k start) it fails silently.
Whats strange is that
> if I simply run the
> command (httpd) Apache starts fine.
> 
> 
> Thanks,
> Tim


Tim,

I have had this problem for many versions of Apache (since 2.0) and it
has yet to be resolved.  I have found that Apache will run in a Command
Window, but not as a service.  Don't know why, have asked many Apache
gurus here and "in the cloud" with no resolution.

If you find a solution please pass it on.

Dewey Williams
UNC Charlotte


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org