logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache2 won't start as service using rotatelogs
Author
Jack



Joined: 12 Apr 2007
Posts: 3

PostPosted: Thu 12 Apr '07 22:10    Post subject: Apache2 won't start as service using rotatelogs Reply with quote

Hello,

I want to pipe my httpd errorlogs through rotatelogs.exe. When I edited my httpd.conf to do this, Apache will run fine, If I run httpd.exe directly (e.g. double click/from commandline). If I install Apache as service and try to start it, It won't start with rotatelogs.

My configuration in detail:
I downloaded Apache 2.2.4 from apachelounge.com.
I unzipped everything to this structure:
Code:

D:
\WebDev
\Webdev\Apache2 <-- Apache2 Serverroot
\Webdev\Apache2\bin\httpd.exe
\Webdev\Apache2\bin\rotatelogs.exe
\Webdev\Apache2\httpd.pid
\Webdev\Apache2\conf\httpd.conf
\Webdev\htdocs <- DocumentRoot
\Webdev\Logs\
\Webdev\Logs\errors <-- In this folder, I'd like to put alle the error.log files
\Webdev\Logs\access <-- In this folder, I'd like to put alle the access.log files

I installed VC++ Redist SP1.


Now, I edited the default httpd.conf and changed Server- and DocumentRoots and ErrorFile/AccessLog to meet my structure, added PidFile entry, because I deleted the "log" folder in ServerRoot. I saved everything and tried to run it from commandline - Apache is up and running.

I stopped the httpd and installed it as service (httpd.exe -k install).

I started the newly installed service - Apache is up and running.

Fine.

I stopped the service, edited the httpd.conf, which now will be look like
Code:

[...]
#ErrorLog D:/Webdev/Logs/errors/error.log
ErrorLog "|bin/rotatelogs.exe D:/Webdev/Logs/errors/error_%Y-%m-%d.log 86400"

# Pidfile
PidFile httpd.pid

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    CustomLog D:/Webdev/Logs/access/access.log common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog logs/access.log combined
</IfModule>
[...]

I saved everything, tried to run httpd.exe from commandline - it works.

Now I tried to start the service again - the service won't start.

Now you know my problem Smile


Regards,
Jack


P.s.: I am running everything on a Windows XP SP2 machine, patch level is 2007-04-10.

P.s2: I also tried "|D:\Webdev\Apache2\bin\rotatelogs.exe..." - same problem.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Fri 13 Apr '07 16:12    Post subject: Reply with quote

Indeed it is a little program with pain, it is also cluttering lot of processes.

Maybe you can try the alternative mod_log_rotate , see www.hexten.net/mod_log_rotate/
Back to top
Jack



Joined: 12 Apr 2007
Posts: 3

PostPosted: Fri 13 Apr '07 18:53    Post subject: Reply with quote

Quote:
Maybe you can try the alternative mod_log_rotate , see www.hexten.net/mod_log_rotate/
Imho I cannot use mod_log_rotate for error logs..., can I?

I don't understand, why Apache will run normal, but not as service. I don't understand what is different...

Month ago, this was working...
Back to top
VoodooMill



Joined: 11 Jan 2007
Posts: 60

PostPosted: Sat 14 Apr '07 0:13    Post subject: Reply with quote

Hey there Jack,

This is a problem specific to 2.2.4 and the reason I still run 2.2.3. Very Happy
Back to top
Jack



Joined: 12 Apr 2007
Posts: 3

PostPosted: Sat 14 Apr '07 16:39    Post subject: Reply with quote

Quote:
This is a problem specific to 2.2.4 and the reason I still run 2.2.3.
Hmm. Okay.

Does ApacheLounge.com offer older binaries? I only find the actual version...[/quote]
Back to top


Reply to topic   Topic: Apache2 won't start as service using rotatelogs View previous topic :: View next topic
Post new topic   Forum Index -> Apache