You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by steveG <li...@delebrum.com> on 2003/01/20 16:37:04 UTC

[users@httpd] Apache v1.3.27 error - httpd dead but pid file exists

Hi..

I have a strange problem that just seemed to happen out of nowhere.. I have attempted to delete the *.pid file and also deleted the
httpd from the subsys and then tried to restart apache.  Nothing seems to help.  Below is what the status sais and also what the
error log from apache sais..  Does anyone have any further suggestions/thoughts.

RedHat v7.3
Apache version 1.3.27 
mysql  Ver 11.18 Distrib 3.23.54
php 4.1.2


[root@localhost /]# /etc/rc.d/init.d/httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd:                                            [  OK  ]
[root@localhost /]# /etc/rc.d/init.d/httpd status
httpd dead but pid file exists



[Mon Jan 20 00:02:06 2003] [error] Cannot remove module mod_ssl.c: not found in module list

[Mon Jan 20 00:02:06 2003] [error] Cannot remove module mod_roaming.c: not found in module list

[Mon Jan 20 00:02:06 2003] [error] Cannot remove module mod_dav.c: not found in module list

[Mon Jan 20 00:02:06 2003] [error] Cannot remove module mod_php4.c: not found in module list

[Mon Jan 20 00:02:06 2003] [alert] (2)No such file or directory: getpwuid: couldn't determine user name from uid 4294967295, you
probably need to modify the User directive

[Mon Jan 20 00:02:06 2003] [alert] (2)No such file or directory: getpwuid: couldn't determine user name from uid 4294967295, you
probably need to modify the User directive

[Mon Jan 20 00:02:06 2003] [alert] (2)No such file or directory: getpwuid: couldn't determine user name from uid 4294967295, you
probably need to modify the User directive

[Mon Jan 20 00:02:06 2003] [alert] (2)No such file or directory: getpwuid: couldn't determine user name from uid 4294967295, you
probably need to modify the User directive

[Mon Jan 20 00:02:06 2003] [alert] (2)No such file or directory: getpwuid: couldn't determine user name from uid 4294967295, you
probably need to modify the User directive

[Mon Jan 20 00:02:06 2003] [alert] (2)No such file or directory: getpwuid: couldn't determine user name from uid 4294967295, you
probably need to modify the User directive
[Mon Jan 20 00:02:06 2003] [notice] Apache configured -- resuming normal operations

[Mon Jan 20 00:02:06 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

[Mon Jan 20 00:02:06 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)

[Mon Jan 20 00:02:06 2003] [alert] Child 13876 returned a Fatal error... 

Apache is exiting!

--steveG 



---------------------------------------------------------------------
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] how to rotate log files

Posted by Eric Renouf <er...@opticominc.com>.
Check out the documentation on log rotation at
http://httpd.apache.org/docs/logs.html#rotation, I use cronolog myself and
it works quite well.

Cheers,
Eric

----- Original Message -----
From: "Xiongfei Wang" <wa...@arches.uga.edu>
To: "Apache-List" <us...@httpd.apache.org>
Sent: Wednesday, January 22, 2003 8:44 AM
Subject: [users@httpd] how to rotate log files


> I have redat 7.3 server with a apache web server running on it. i also
> have several virtual host on it
>
> the conf of one of them is:
>
> ------------------------------------------
> ############## VIRTUAL HOST IS APIDB-DEV ################
> <VirtualHost 126.100.45.25>
>         ServerName cryptodb-dev.ctegd.uga.edu
>         ServerAdmin jkissing@uga.edu
>         DocumentRoot "/var/www/crto-dev/html"
>         ErrorLog /var/log/httpd/crto-dev/error_log
>         CustomLog /var/log/httpd/crto-dev/access_log common
> <Directory "/var/www/crto-dev/html">
> Options Includes FollowSymLinks
> AllowOverride Limit AuthConfig
> Order allow,deny
> Allow from all
> </Directory>
>
> </VirtualHost>
> --------------------------------------------------
>
> The log file will be in /var/log/httpd/crto-dev/access_log
> because the access_log file is geting to big, i want to use following
> stategy to do deal with it.
> first week: all log info are written to access_log
> second week: move access_log to access_log1,
> third weed: move access_log1 to access+log2. move access_log toaccess_log1
> and so on...
>
> how can i acheive this gaol, do have to use crontab?
> Thanks
> J.P.
>
>
>
> ---------------------------------------------------------------------
> 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] how to rotate log files

Posted by Jacob Coby <jc...@listingbook.com>.
> I am not sure what will line do, will it stop the apache server?

No, it just tells Apache to let go of the old log files and start a new set.

-Jacob


---------------------------------------------------------------------
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] how to rotate log files

Posted by Xiongfei Wang <wa...@arches.uga.edu>.
Thanks

I add an entry to /etc/logrotate.d/apache

 "/var/log/httpd/crotodb/access.log" {
           rotate 5
           weekly
           postrotate
                 killall -HUP httpd # line 1
           endscript
       }

I am not sure what will line do, will it stop the apache server?

Thanks




On Wed, 22 Jan 2003, Jacob Coby wrote:

> > The log file will be in /var/log/httpd/crto-dev/access_log
> > because the access_log file is geting to big, i want to use following
> > stategy to do deal with it.
> > first week: all log info are written to access_log
> > second week: move access_log to access_log1,
> > third weed: move access_log1 to access+log2. move access_log toaccess_log1
> > and so on...
> >
> > how can i acheive this gaol, do have to use crontab?
> 
> This is exactly how logrotate works.  You can also have it compress them or
> do any other thing you want it to.  Redhat 7.3 already has the crontab setup
> for logrotate, you just need to add a httpd entry in /etc/logrotate.d
> 
> -Jacob
> 
> 
> ---------------------------------------------------------------------
> 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] problem with configure MySQL for authentication

Posted by Xiongfei Wang <wa...@arches.uga.edu>.
my .htacess has
-------------------------
AuthType Basic
AuthName "perkdb-dev"
#Auth_MySQL on
AuthMySQLHost localhost
AuthMySQLUser httpd
AuthMySQLPassword httpd1830
AuthMySQLDB registeredusers
AuthMySQLUserTable perkdbdevusers
AuthMySQLNameField username
#AuthMySQLGroupField user_group
AuthMySQLPasswordField passwd
-----------------------------------

MySql table


mysql> select * from perkdbdevusers
    -> ;
+----------+----------+
| username | passwd   |
+----------+----------+
| jianping | erdtrgfe |
| chichi   | erdtrgfe |
+----------+----------+
2 rows in set (0.00 sec)


when i try to login using user chichi and provide the password erdtrgfe, i
i failed and following msg in error log:

error log file:
[Mon Feb  3 22:09:15 2003] [error] user chichi: password mismatch: /

What is wrong here and how i can fix the problem?

Thanks







On Mon, 3 Feb 2003, Leander Jedamus wrote:

> Hi!
> 
> Try this one:
> ----8<----8<----8<----8<----8<----8<----8<----8<----
> AuthName "password for ..."
> AuthType Basic
> AuthMySQLHost db_hostname
> AuthMySQLUser db_user
> AuthMySQLPassword your_password_here
> AuthMySQLDB db_name
> AuthMySQLUserTable table_name
> AuthMySQLGroupTable table_name2
> AuthMySQLNameField user_name
> AuthMySQLGroupField user_group
> AuthMySQLPasswordField user_passwd
> require valid-user
> ----8<----8<----8<----8<----8<----8<----8<----8<----
> 
> Bis dann,
> Leander Jedamus
> Am Montag, 3. Februar 2003 15:39 schrieb Xiongfei Wang:
> > I have redhat 7.3 server wiht apache 1.3.23 running on it. i want to use
> > my sql for user athentication. I did it following the instruction from
> > p196 to p212 in Kabi's Apache Server 2 bible.  After I added
> >
> > ---------------------------------------------------------------
> > # Using mysql database for authrization and authentication
> > Auth_MySQL_Info db_hostname db_username db_password
> > Auth_MySQL_General_DB database_name
> > -----------------------------------------------------
> >
> > to httpd.conf and retarted the httpd i got error msg:
> >
> > -------------------------------------------------------
> > [root@mango mysqlsrc]# service httpd restart
> > Stopping httpd:                                            [  OK  ]
> > Starting httpd: Syntax error on line 100 of /etc/httpd/conf/httpd.conf:
> > Invalid command 'Auth_MySQL_Info', perhaps mis-spelled or defined by a
> > module not included in the server configuration [FAILED]
> > --------------------------------------------------------------------------
> >
> > It says Auth_MySQL_Info is an invalid command, but i copy it from kabir's
> > book.
> >
> > What is the reason, and how can i fix this problem?
> >
> > Thanks
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 


---------------------------------------------------------------------
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] problem with configure MySQL for authentication

Posted by Xiongfei Wang <wa...@arches.uga.edu>.
Thanks for rerponse;
what is the directives for having plaintext as password or encryped
passwords?
Thanks


On Mon, 3 Feb 2003, Leander Jedamus wrote:

> Hi!
> 
> Try this one:
> ----8<----8<----8<----8<----8<----8<----8<----8<----
> AuthName "password for ..."
> AuthType Basic
> AuthMySQLHost db_hostname
> AuthMySQLUser db_user
> AuthMySQLPassword your_password_here
> AuthMySQLDB db_name
> AuthMySQLUserTable table_name
> AuthMySQLGroupTable table_name2
> AuthMySQLNameField user_name
> AuthMySQLGroupField user_group
> AuthMySQLPasswordField user_passwd
> require valid-user
> ----8<----8<----8<----8<----8<----8<----8<----8<----
> 
> Bis dann,
> Leander Jedamus
> Am Montag, 3. Februar 2003 15:39 schrieb Xiongfei Wang:
> > I have redhat 7.3 server wiht apache 1.3.23 running on it. i want to use
> > my sql for user athentication. I did it following the instruction from
> > p196 to p212 in Kabi's Apache Server 2 bible.  After I added
> >
> > ---------------------------------------------------------------
> > # Using mysql database for authrization and authentication
> > Auth_MySQL_Info db_hostname db_username db_password
> > Auth_MySQL_General_DB database_name
> > -----------------------------------------------------
> >
> > to httpd.conf and retarted the httpd i got error msg:
> >
> > -------------------------------------------------------
> > [root@mango mysqlsrc]# service httpd restart
> > Stopping httpd:                                            [  OK  ]
> > Starting httpd: Syntax error on line 100 of /etc/httpd/conf/httpd.conf:
> > Invalid command 'Auth_MySQL_Info', perhaps mis-spelled or defined by a
> > module not included in the server configuration [FAILED]
> > --------------------------------------------------------------------------
> >
> > It says Auth_MySQL_Info is an invalid command, but i copy it from kabir's
> > book.
> >
> > What is the reason, and how can i fix this problem?
> >
> > Thanks
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 


---------------------------------------------------------------------
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] problem with configure MySQL for authentication

Posted by Leander Jedamus <je...@Fh-Worms.DE>.
Hi!

Try this one:
----8<----8<----8<----8<----8<----8<----8<----8<----
AuthName "password for ..."
AuthType Basic
AuthMySQLHost db_hostname
AuthMySQLUser db_user
AuthMySQLPassword your_password_here
AuthMySQLDB db_name
AuthMySQLUserTable table_name
AuthMySQLGroupTable table_name2
AuthMySQLNameField user_name
AuthMySQLGroupField user_group
AuthMySQLPasswordField user_passwd
require valid-user
----8<----8<----8<----8<----8<----8<----8<----8<----

Bis dann,
Leander Jedamus
Am Montag, 3. Februar 2003 15:39 schrieb Xiongfei Wang:
> I have redhat 7.3 server wiht apache 1.3.23 running on it. i want to use
> my sql for user athentication. I did it following the instruction from
> p196 to p212 in Kabi's Apache Server 2 bible.  After I added
>
> ---------------------------------------------------------------
> # Using mysql database for authrization and authentication
> Auth_MySQL_Info db_hostname db_username db_password
> Auth_MySQL_General_DB database_name
> -----------------------------------------------------
>
> to httpd.conf and retarted the httpd i got error msg:
>
> -------------------------------------------------------
> [root@mango mysqlsrc]# service httpd restart
> Stopping httpd:                                            [  OK  ]
> Starting httpd: Syntax error on line 100 of /etc/httpd/conf/httpd.conf:
> Invalid command 'Auth_MySQL_Info', perhaps mis-spelled or defined by a
> module not included in the server configuration [FAILED]
> --------------------------------------------------------------------------
>
> It says Auth_MySQL_Info is an invalid command, but i copy it from kabir's
> book.
>
> What is the reason, and how can i fix this problem?
>
> Thanks
>
>
> ---------------------------------------------------------------------
> 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


[users@httpd] problem with configure MySQL for authentication

Posted by Xiongfei Wang <wa...@arches.uga.edu>.
I have redhat 7.3 server wiht apache 1.3.23 running on it. i want to use
my sql for user athentication. I did it following the instruction from
p196 to p212 in Kabi's Apache Server 2 bible.  After I added 
 
--------------------------------------------------------------- 
# Using mysql database for authrization and authentication
Auth_MySQL_Info db_hostname db_username db_password
Auth_MySQL_General_DB database_name
-----------------------------------------------------
 
to httpd.conf and retarted the httpd i got error msg:

-------------------------------------------------------
[root@mango mysqlsrc]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: Syntax error on line 100 of /etc/httpd/conf/httpd.conf:
Invalid command 'Auth_MySQL_Info', perhaps mis-spelled or defined by a
module not included in the server configuration [FAILED]
--------------------------------------------------------------------------

It says Auth_MySQL_Info is an invalid command, but i copy it from kabir's
book.

What is the reason, and how can i fix this problem?

Thanks 


---------------------------------------------------------------------
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] how to rotate log files

Posted by Jacob Coby <jc...@listingbook.com>.
> The log file will be in /var/log/httpd/crto-dev/access_log
> because the access_log file is geting to big, i want to use following
> stategy to do deal with it.
> first week: all log info are written to access_log
> second week: move access_log to access_log1,
> third weed: move access_log1 to access+log2. move access_log toaccess_log1
> and so on...
>
> how can i acheive this gaol, do have to use crontab?

This is exactly how logrotate works.  You can also have it compress them or
do any other thing you want it to.  Redhat 7.3 already has the crontab setup
for logrotate, you just need to add a httpd entry in /etc/logrotate.d

-Jacob


---------------------------------------------------------------------
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] mod_auth_mysql

Posted by Jeff Cohen <ap...@gej-it.com>.
Download the MySQL-shared rpm package and its dependencies.
Go to http://rpmfind.net
And search for MySQL-shared

All the best,
Jeff Cohen

> -----Original Message-----
> From: Xiongfei Wang [mailto:wangxf@arches.uga.edu]
> Sent: Sunday, February 02, 2003 5:31 PM
> To: Apache-List
> Subject: [users@httpd] mod_auth_mysql
> 
> I have rehat 7.3 linux server, when i try  to install mod_auth_mysql, i
> got followine error msg,
> --------------------------------------------------------
> [root@mango mysqlsrc]# rpm -i  mod_auth_mysql-1.11-1.i386.rpm
> err: failed dependencies:
>         libmysqlclient.so.10   is needed by mod_auth_mysql-1.11-1
> -------------------------------------------------------------------
> how can i fix this problem?
> Thanks.
> J.P.
> 
> 
> ---------------------------------------------------------------------
> 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


[users@httpd] mod_auth_mysql

Posted by Xiongfei Wang <wa...@arches.uga.edu>.
I have rehat 7.3 linux server, when i try  to install mod_auth_mysql, i
got followine error msg, 
-------------------------------------------------------- 
[root@mango mysqlsrc]# rpm -i  mod_auth_mysql-1.11-1.i386.rpm
err: failed dependencies:
        libmysqlclient.so.10   is needed by mod_auth_mysql-1.11-1
-------------------------------------------------------------------
how can i fix this problem?
Thanks.
J.P.


---------------------------------------------------------------------
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] how to rotate log files

Posted by Alan Murrell <si...@yahoo.com>.
Hi,

> first week: all log info are written to access_log
> second week: move access_log to access_log1, 
> third weed: move access_log1 to access+log2. move
> access_log toaccess_log1 
> and so on...

My solution may not be immediately applicable to
yours, as my log-naming convention and location is a
little different (all my customers' logs are stored in
the same directory with a '.log' extenstion; for
example, 'customerdomain.com.log').  However, you may
be able to adapt it.  I actually rotate my Customers'
logs each month, and use the following script:

--- rotate_logs.sh ---
#!/bin/sh
logDir="/var/log/http/websites"

# Stop Apache
/etc/rc.d/init.d/httpd stop

# Rotate the logs, and store them in a seperate
directory
for i in $logDir; do
  mv $i.log $logDir/oldlogs/$i-`date-+%F`.log
  rm -f %i.log
done

# Restart Apache
/etc/rc.d/init.d/httpd/start

# Compress old log files
for i in $logDir/oldlogs; do
  /usr/bin/gzip $i.log
done

exit 0
--- rotate_logs.sh ---

HTH.

Alan


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

---------------------------------------------------------------------
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] how to rotate log files

Posted by Gareth Kirwan <gb...@thermeoneurope.com>.
J.P asked me to see my log handler.
He's also asked to see how to rotate logs.
Here are both.
The Analysis is not in here - since it's too long and complex to show.
The processes don't affect performance drastically ( I've considerably
benchmark tested this, believe me )
It will also make directories for any site that doesn't have them yet.
The files are gzipped with the date every night.
It's still under development and testing - so don't blame me for messes - he
he

-Gareth


EXTRACTS:


httpd.conf ( mod_perl )
--------------------------------------------
PerlModule Apache::LogFile
PerlModule Apache::LogFile::Config
PerlModule Thermeon::LogAnalyse

<VirtualHost 192.168.234.201:80>
 ServerName xxx
 DocumentRoot /u/virtual/xxx

 ResourceConfig conf/Mason.conf
</VirtualHost>
======================

Mason.conf
--------------------------------------------
 PerlLogFile |Thermeon/LogRotate.pl Thermeon::LogHandle

 PerlPostReadRequestHandler Thermeon::LogHandler

# These two lines are irrelevant to your question - but I left them in to
advocate Mason ;-)
 SetHandler perl-script
 PerlHandler HTML::Mason
======================

LogHandler.pm
--------------------------------------------
package Thermeon::LogHandler;

use Apache::Constants qw(OK);

use Time::HiRes qw(gettimeofday tv_interval);
use POSIX;
use strict;

my %formats = (
	'image'	=>	\&image_format,
	'page'	=>	\&page_format,
	'file'	=>	\&file_format
	);

my %types = (
	'html'	=>	'page',
	'js'	=>	'file',
	'css'	=>	'file',
	'jpg'	=>	'image',
	'gif'	=>	'image',
	'png'	=>	'image'
	);

my %files = (
	'image' =>	'image_log',
	'page'	=>	'page_log',
	'file'	=>	'file_log'
	);

sub handler ($$) {
	my $this = shift;
	my $class = ref $this || $this;

	my $r = shift || Apache->request();
	my $self = { } ;

	$self->{_start}		= [gettimeofday];
	$self->{_date}		= strftime('%Y%m%dT%H%M', localtime);
	$self->{_request}	= $r;
	$r->uri =~ /\.([^.]+)$/;
	$self->{_ext}		= $1 || "html";
	$self->{_filetype}	= $types{$self->{_ext}};

	$self->{_format}	= $formats{$self->{_filetype}};

	bless $self, $class;

	$r->pnotes('LOG', $self);

 	return OK;
	}

sub DESTROY {
	my $self = shift;
	my $r = $self->{_request} ;

	$self->{_interval} = tv_interval($self->{_start});

	my $entry = $self->{_format}->($self);

	$entry .= $r->status if ($r->status !~ /200|304|302/);

	if ( iRef($r) ){
		print Thermeon::LogHandle $r->get_server_name."/referer_log*".join ('|',
							$self->{_date},
							$r->uri,
							$r->headers_in->get('Referer')
							);
	print Thermeon::LogHandle $r->get_server_name."/agent_log*".join ('|',
						$self->{_date},
						$r->connection->remote_ip,
						$r->headers_in->get('Accept-Encoding'),
						$r->headers_in->get('Accept-Language'),
						$r->headers_in->get('User-agent')
						);
		}

	print Thermeon::LogHandle $r->get_server_name."/".$files{
$self->{_filetype} } ."*$entry";
	}

sub image_format () {
	my $self = shift;

	my $r = $self->{_request};
	my $h = $r->hostname;
	my $rf = $r->headers_in->get('Referer');

	warn $r->uri." was requested from [$rf] by ".$r->connection->remote_ip if
( iRef($r) );

	return join('|',
			$self->{_date},
			$r->connection->remote_ip,
			$r->uri,
			iRef($r)
			);
	}

sub page_format () {
	my $self = shift;

	my $r = $self->{_request};
	my $h = $r->hostname;

	return join('|',
			$self->{_date},
			$r->connection->remote_ip,
			$r->uri,
			$r->connection->user,
			$r->bytes_sent,
			int( $r->bytes_sent / $self->{_interval} ),
			iRef($r),
			);
	}

sub file_format () {
	my $self = shift;

	my $r = $self->{_request};
	my $h = $r->hostname;
	my $rf = $r->headers_in->get('Referer');

		warn $r->uri." was requested from [$rf] by ".$r->connection->remote_ip if
( iRef($r) );

		return join('|',
				$self->{_date},
				$r->connection->remote_ip,
				$r->uri,
				$r->bytes_sent,
				int( $r->bytes_sent / $self->{_interval} ),
				iRef($r)
				);
		}

	sub iRef ($) {
		my $r = shift;
		my $h = $r->hostname;
		my $rf = $r->headers_in->get('Referer');
		return "<$rf" unless ( $rf =~ m|^https?://\Q$h\E| );
		return undef;
		}
1;
======================

LogRotate.pl
--------------------------------------------
#'!/usr/bin/perl

use strict;
use POSIX;

my $log_dir = "/etc/httpd/logs";

my $today = strftime('%Y%m%d', localtime);

while (<STDIN>){
	s/^([^\*]+)\*//;

	makeSafe($1);

	open(LOGFILE, ">>${log_dir}/$1");
	print LOGFILE $_;
	close LOGFILE;
	}

sub makeSafe ($){
	my $file = shift;
	my $time;

	makeFile($file) if (! -f "${log_dir}/$file");

	open (FILE, "<${log_dir}/$file");
	{
	 local $/ = "T";
	 $time = <FILE>;
	}
	close FILE;
	return 1 unless ($time);
	if ($time ne "${today}T"){
		rename("${log_dir}/$file", "${log_dir}/$file.old");
		defined (my $pid = fork) or warn "Can't fork: $!";
		if ($pid == 0){
			use Thermeon::LogAnalyse;
			Analyse("${log_dir}/$file");
			exit(0);
			}
		}
	return 1;
	}

sub makeFile ($){
	my $file = shift;
	my $dir = $log_dir;
	while ( $file =~ s#(.+?)/## ){
		mkdir "$dir/$1";
		$dir .= "/$1";
		}
	return 1;
	}

exit(0);
======================

LogAnalyse.pm
--------------------------------------------
package Thermeon::LogAnalyse;

use Exporter;
@ISA = ('Exporter');
@EXPORT_OK = ('Analyse');
@EXPORT = ('Analyse');

use strict;
use Compress::Zlib;

sub Analyse {
	my ($dir, $file) = shift =~ m#^(.+)/(.+)#;
	my %requests;
	my $x;

	open (STDIN, "<$dir/${file}.old") or die "Open IN $! $dir/${file}";
	while (<>){
		$requests{$x++} = [split /\|/, $_];
		}
	close STDIN;

	my ($date) = $requests{0}->[0] =~ /^([^T]+)T/;
	my $gz_file = "$dir/${file}_${date}.gz";
	my $gz = gzopen($gz_file, "wb9") or die "open OUT $! $gz_file";
	map {
		$gz->gzwrite( join "|", @{$requests{$_}} );
		} sort {$a<=>$b} keys %requests;
	$gz->gzclose;

	unlink "$dir/$file.old";
	}
======================

> -----Original Message-----
> From: Xiongfei Wang [mailto:wangxf@arches.uga.edu]

> I have redat 7.3 server with a apache web server running on it. i also
> have several virtual host on it
>
> the conf of one of them is:
>
> ------------------------------------------
> ############## VIRTUAL HOST IS APIDB-DEV ################
> <VirtualHost 126.100.45.25>
>         ServerName cryptodb-dev.ctegd.uga.edu
>         ServerAdmin jkissing@uga.edu
>         DocumentRoot "/var/www/crto-dev/html"
>         ErrorLog /var/log/httpd/crto-dev/error_log
>         CustomLog /var/log/httpd/crto-dev/access_log common
> <Directory "/var/www/crto-dev/html">
> Options Includes FollowSymLinks
> AllowOverride Limit AuthConfig
> Order allow,deny
> Allow from all
> </Directory>
>
> </VirtualHost>
> --------------------------------------------------
>
> The log file will be in /var/log/httpd/crto-dev/access_log
> because the access_log file is geting to big, i want to use following
> stategy to do deal with it.
> first week: all log info are written to access_log
> second week: move access_log to access_log1,
> third weed: move access_log1 to access+log2. move access_log
> toaccess_log1
> and so on...
>
> how can i acheive this gaol, do have to use crontab?
> Thanks
> J.P.
>
>
>
> ---------------------------------------------------------------------
> 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


[users@httpd] how to rotate log files

Posted by Xiongfei Wang <wa...@arches.uga.edu>.
I have redat 7.3 server with a apache web server running on it. i also
have several virtual host on it

the conf of one of them is:

------------------------------------------
############## VIRTUAL HOST IS APIDB-DEV ################
<VirtualHost 126.100.45.25>
        ServerName cryptodb-dev.ctegd.uga.edu
        ServerAdmin jkissing@uga.edu
        DocumentRoot "/var/www/crto-dev/html"
        ErrorLog /var/log/httpd/crto-dev/error_log
        CustomLog /var/log/httpd/crto-dev/access_log common
<Directory "/var/www/crto-dev/html">
Options Includes FollowSymLinks
AllowOverride Limit AuthConfig
Order allow,deny
Allow from all
</Directory>

</VirtualHost>
--------------------------------------------------

The log file will be in /var/log/httpd/crto-dev/access_log
because the access_log file is geting to big, i want to use following
stategy to do deal with it.
first week: all log info are written to access_log
second week: move access_log to access_log1, 
third weed: move access_log1 to access+log2. move access_log toaccess_log1 
and so on...

how can i acheive this gaol, do have to use crontab?
Thanks
J.P.



---------------------------------------------------------------------
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 v1.3.27 error - httpd dead but pid file exists

Posted by Rich Bowen <rb...@rcbowen.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 20 Jan 2003, steveG wrote:

> Hi..
>
> I have a strange problem that just seemed to happen out of nowhere.. I have attempted to delete the *.pid file and also deleted the
> httpd from the subsys and then tried to restart apache.  Nothing seems to help.  Below is what the status sais and also what the
> error log from apache sais..  Does anyone have any further suggestions/thoughts.

I did not see any response to your query, so I thought I'd give a couple
suggestions.

>
> RedHat v7.3
> Apache version 1.3.27
> mysql  Ver 11.18 Distrib 3.23.54
> php 4.1.2
>
>
> [root@localhost /]# /etc/rc.d/init.d/httpd restart
> Stopping httpd:                                            [FAILED]
> Starting httpd:                                            [  OK  ]
> [root@localhost /]# /etc/rc.d/init.d/httpd status
> httpd dead but pid file exists

Try removing the pid file before you restart. When the pid file exists,
Apache can think that it is already running. However, given the error
messaegs below, sounds like something else is wrong.

> [Mon Jan 20 00:02:06 2003] [error] Cannot remove module mod_ssl.c: not found in module list
< And more lines like that >

You have a ClearModuleList directive, apparently, but it is getting
confused. Perhaps the error lies in this next line ...

> [Mon Jan 20 00:02:06 2003] [alert] (2)No such file or directory: getpwuid: couldn't determine user name from uid 4294967295, you
> probably need to modify the User directive

In your configuration file, you will find a directive "User", which
points to a user account which Apache will run as. This should be set to
some unprivileged user, such as 'nobody', or 'apache', or 'www' (all
popular choices). You appear to have it set to something else, such as
"#-1" for example, which does not correspond to a user account on your
system. Hunt down the User directive in your config file, read the docs
on the User directive, at
http://httpd.apache.org/docs/mod/core.html#user and set it to something
appropriate.

HTH

- -- 
Pilgrim, how you journey on the road you chose
To find out where the winds die and where the stories go
 --Pilgrim (Enya - A Day Without Rain)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6

iD8DBQE+Lpl0XP03+sx4yJMRAqNEAKDVkDgfgPYOXsP6ic5zduFwH3K77wCeNY+7
gllo5ALs66pgCEHVbtVayvI=
=F5cR
-----END PGP SIGNATURE-----



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