[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please help: JServ logging not solved yet



On Wed, 12 Apr 2000, Stefan Gybas wrote:

> So why don't you use log()?
I tried to explain this into the mail to Eric Ravelomanants.
May be it is bad design???
 
> > System.out(): nowhere (???? is this normal ???)
> 
> Yes, it has always been this way.
If this was intended by the developers, does this make sense???
 
> > System.err(): nowhere (? formerly it was going to /var/log/apache/error.log
> >               but now it doesn't 8-(((((((((((( )
> 
> This is because jserv is now started in manual mode (i.e. not from Apache),
> if you want stderr to go to Apache's error log just set ApJServManual to
> off in /etc/jserv/jserv.conf, stop jserv ("/etc/init.d/jserv stop") and
> restart Apache ("/etc/init.d/apache restart").
Hmmm, I tried this (sie my appended config-files) but just got:

/var/log/apache/error.log:
ApacheJServ/1.1: Exception creating the server socket: java.net.BindException: Address already in use

/var/log/jserv.log:
[12/04/2000 11:57:47:544 CEST] ApacheJServ/1.1: Exception creating the server socket: java.net.BindException: Address already in use
[12/04/2000 12:13:39:820 GMT+02:00] logging: log(This was printed using the log-method)

May be something else is wrong there.

Kind regards

          Andreas.

# This is the main server configuration file. See URL http://www.apache.org/
# for instructions.

# Do NOT simply read the instructions in here without understanding
# what they do, if you are unsure consult the online docs. You have been
# warned.  

# Originally by Rob McCool

# Shared Object Module Loading:
# To be able to use the functionality of a module which was built
# as a shared object you have to place corresponding `LoadModule'
# lines at this location so the directives contained in it are
# actually available _before_ they are used. 
# Example:

# ServerType is either inetd, or standalone.

ServerType standalone

# If you are running from inetd, go to "ServerAdmin".

# Port: The port the standalone listens to. For ports < 1023, you will
# need httpd to be run as root initially.
Port 80

# HostnameLookups: Log the names of clients or just their IP numbers
#   e.g.   www.apache.org (on) or 204.62.129.132 (off)
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on.

HostnameLookups off

# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.  

# User/Group: The name (or #number) of the user/group to run httpd as.
#  On SCO (ODT 3) use User nouser and Group nogroup
#  On HPUX you may not be able to use shared memory as nobody, and the
#  suggested workaround is to create a user www and use that user.

User www-data
Group www-data

# ServerAdmin: Your address, where problems with the server should be
# e-mailed.
ServerAdmin tillea@rki.de

# ServerRoot: The directory the server's config, error, and log files
# are kept in.
# NOTE!  If you intend to place this on a NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation,
# you will save yourself a lot of trouble.

ServerRoot /etc/apache

# BindAddress: You can support virtual hosts with this option. This option
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the VirtualHost directive.

BindAddress *


# The Debian package of Apache loads every feature as shared modules.
# Please keep this LoadModule: line here, it is needed for installation.
# LoadModule vhost_alias_module /usr/lib/apache/1.3/mod_vhost_alias.so
# LoadModule env_module /usr/lib/apache/1.3/mod_env.so
LoadModule config_log_module /usr/lib/apache/1.3/mod_log_config.so
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
# LoadModule mime_magic_module /usr/lib/apache/1.3/mod_mime_magic.so
LoadModule mime_module /usr/lib/apache/1.3/mod_mime.so
LoadModule negotiation_module /usr/lib/apache/1.3/mod_negotiation.so
# LoadModule status_module /usr/lib/apache/1.3/mod_status.so
# LoadModule info_module /usr/lib/apache/1.3/mod_info.so
# LoadModule includes_module /usr/lib/apache/1.3/mod_include.so
LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
# LoadModule asis_module /usr/lib/apache/1.3/mod_asis.so
# LoadModule imap_module /usr/lib/apache/1.3/mod_imap.so
# LoadModule action_module /usr/lib/apache/1.3/mod_actions.so
# LoadModule speling_module /usr/lib/apache/1.3/mod_speling.so
LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
# LoadModule proxy_module /usr/lib/apache/1.3/libproxy.so
LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
LoadModule access_module /usr/lib/apache/1.3/mod_access.so
LoadModule auth_module /usr/lib/apache/1.3/mod_auth.so
# LoadModule anon_auth_module /usr/lib/apache/1.3/mod_auth_anon.so
# LoadModule dbm_auth_module /usr/lib/apache/1.3/mod_auth_dbm.so
# LoadModule db_auth_module /usr/lib/apache/1.3/mod_auth_db.so
# LoadModule digest_module /usr/lib/apache/1.3/mod_digest.so
# LoadModule cern_meta_module /usr/lib/apache/1.3/mod_cern_meta.so
LoadModule expires_module /usr/lib/apache/1.3/mod_expires.so
# LoadModule headers_module /usr/lib/apache/1.3/mod_headers.so
# LoadModule usertrack_module /usr/lib/apache/1.3/mod_usertrack.so
LoadModule unique_id_module /usr/lib/apache/1.3/mod_unique_id.so
LoadModule setenvif_module /usr/lib/apache/1.3/mod_setenvif.so
# LoadModule sys_auth_module /usr/lib/apache/1.3/mod_auth_sys.so
# LoadModule put_module /usr/lib/apache/1.3/mod_put.so
LoadModule jserv_module /usr/lib/apache/1.3/mod_jserv.so
# LoadModule throttle_module /usr/lib/apache/1.3/mod_throttle.so
# LoadModule auth_ldap_module /usr/lib/apache/1.3/auth_ldap.so
# LoadModule allowdev_module /usr/lib/apache/1.3/mod_allowdev.so
# LoadModule pgsql_auth_module /usr/lib/apache/1.3/mod_auth_pgsql.so
# LoadModule cvs_module /usr/lib/apache/1.3/mod_cvs.so
# LoadModule define_module /usr/lib/apache/1.3/mod_define.so
# LoadModule eaccess_module /usr/lib/apache/1.3/mod_eaccess.so
# LoadModule roaming_module /usr/lib/apache/1.3/mod_roaming.so


# ErrorLog: The location of the error log file. If this does not start
# with /, ServerRoot is prepended to it.

ErrorLog /var/log/apache/error.log

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

#### LogLevel warn
LogLevel notice

# 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\" %T %v" full
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# The location of the access logfile (Common Logfile Format).
# If this does not start with /, ServerRoot is prepended to it.

CustomLog /var/log/apache/access.log common

# If you would like to have an agent and referer logfile uncomment the
# following directives.

#CustomLog logs/referer_log referer
#CustomLog logs/agent_log agent

# If you prefer a single logfile with access, agent and referer information
# (Combined Logfile Format) you can use the following directive.

#CustomLog logs/access_log combined

# PidFile: The file the server should log its pid to
PidFile /var/run/apache.pid

# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know because
# this file is created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
# ScoreBoardFile logs/apache_runtime_status

# The LockFile directive sets the path to the lockfile used when Apache
# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
# its default value. The main reason for changing it is if the logs
# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
# DISK. The PID of the main server process is automatically appended to
# the filename. 
#
LockFile /var/run/apache.lock

# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e. use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you 
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.

#ServerName new.host.name

# UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a url that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name.  With this setting off, Apache will
# use the hostname:port that the client supplied, when possible.  This
# also affects SERVER_NAME and SERVER_PORT in CGIs.
UseCanonicalName on

# CacheNegotiatedDocs: By default, Apache sends Pragma: no-cache with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.

#CacheNegotiatedDocs

# Timeout: The number of seconds before receives and sends time out

Timeout 300

# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.

KeepAlive On

# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We reccomend you leave this number high, for maximum performance.

MaxKeepAliveRequests 100

# KeepAliveTimeout: Number of seconds to wait for the next request

KeepAliveTimeout 15

# Server-pool size regulation.  Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).

# It does this by periodically checking how many servers are waiting
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
# spares die off.  These values are probably OK for most sites ---

MinSpareServers 5
MaxSpareServers 10

# Number of servers to start --- should be a reasonable ballpark figure.

StartServers 5

# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# Unix with it as it spirals down...

MaxClients 150

# MaxRequestsPerChild: the number of requests each child process is
#  allowed to process before the child dies.
#  The child will exit so as to avoid problems after prolonged use when
#  Apache (and maybe the libraries it uses) leak.  On most systems, this
#  isn't really needed, but a few (such as Solaris) do have notable leaks
#  in the libraries.

MaxRequestsPerChild 30


# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the VirtualHost command

#Listen 3000
#Listen 12.34.56.78:80

# VirtualHost: Allows the daemon to respond to requests for more than one
# server address, if your server machine is configured to accept IP packets
# for multiple addresses. This can be accomplished with the ifconfig 
# alias flag, or through kernel patches like VIF.

# Any httpd.conf or srm.conf directive may go into a VirtualHost command.
# See also the BindAddress entry.
 
#<VirtualHost host.some_domain.com>
#ServerAdmin webmaster@host.some_domain.com
#DocumentRoot /var/www/host.some_domain.com
#ServerName host.some_domain.com
#ErrorLog /var/log/apache/host.some_domain.com-error.log
#TransferLog /var/log/apache/host.some_domain.com-access.log
#</VirtualHost>


<IfModule mod_jserv.c>
# The following line is for apacheconfig - DO NOT REMOVE!
# ApJServLogFile DISABLED
ApJServLogFile /var/log/jservinfo.log
Include /etc/jserv/jserv.conf
</IfModule>
###############################################################################
#                     Apache JServ Configuration File                         #
###############################################################################

# Whether Apache must start Apache JServ or not (On=Manual Off=Autostart)
# Syntax: ApJServManual [on/off]
# Default: "Off"
# ApJServManual on
ApJServManual Off

# Properties filename for Apache JServ in Automatic Mode. 
# In manual mode this directive is ignored
# Syntax: ApJServProperties [filename]
# Default: "./conf/jserv.properties"
ApJServProperties /etc/jserv/jserv.properties

# Log file for this module operation relative to Apache root directory.
# Set the name of the trace/log file.  To avoid possible confusion about
# the location of this file, an absolute pathname is recommended.
# 
# This log file is different than the log file that is in the
# jserv.properties file. This is the log file for the C portion of Apache
# JServ.
# 
# On Unix, this file must have write permissions by the owner of the JVM
# process. In other words, if you are running Apache JServ in manual mode
# and Apache is running as user nobody, then the file must have its
# permissions set so that that user can write to it.
# Syntax: ApJServLogFile [filename] 
# Default: "./logs/mod_jserv.log"
# Note: when set to "DISABLED", the log will be redirected to Apache error log
# Debian note: DO NOT SET THIS OPTION HERE - use /etc/apache/httpd.conf!
#ApJServLogFile DISABLED

# Log Level for this module
# Syntax: ApJServLogLevel [debug|info|notice|warn|error|crit|alert|emerg]
# Default: info    (unless compiled w/ JSERV_DEBUG, in which case it's debug)
#### ApJServLogLevel notice
## und ich hätte es auch gern auf info!
ApJServLogLevel info

# Protocol used by this host to connect to Apache JServ
# (see documentation for more details on available protocols)
# Syntax: ApJServDefaultProtocol [name]
# Default: "ajpv12"
ApJServDefaultProtocol ajpv12

# Default host on which Apache JServ is running
# Syntax: ApJServDefaultHost [hostname]
# Default: "localhost"
#ApJServDefaultHost java.apache.org

# Default port that Apache JServ is listening to
# Syntax: ApJServDefaultPort [number]
# Default: protocol-dependant (for ajpv12 protocol this is "8007")
ApJServDefaultPort 8007

# The amount of time to give to the JVM to start up as well
# as the amount of time to wait to ping the JVM to see if it
# is alive. Slow or heavily loaded machines might want to 
# increase this value.
# Default: 10 seconds
# ApJServVMTimeout 10

# Passes parameter and value to specified protocol.
# Syntax: ApJServProtocolParameter [name] [parameter] [value]
# Default: NONE
# Note: Currently no protocols handle this. Introduced for future protocols.

# Apache JServ secret key file relative to Apache root directory.
# Syntax: ApJServSecretKey [filename]
# Default: "./conf/jserv.secret.key"
# Warning: if authentication is DISABLED, everyone on this machine (not just
# this module) may connect to your servlet engine and execute servlet 
# bypassing web server restrictions. See the documentation for more information
ApJServSecretKey /etc/jserv/jserv.secret.key

# Mount point for Servlet zones
# (see documentation for more information on servlet zones)
# Syntax: ApJServMount [name] [jserv-url]
# Default: NONE
# Note: [name] is the name of the Apache URI path to mount jserv-url on
#       [jserv-url] is something like "protocol://host:port/zone"
#  If protocol, host or port are not specified, the values from 
#  "ApJServDefaultProtocol", "ApJServDefaultHost" or "ApJServDefaultPort" 
#  will be used. 
#  If zone is not specified, the zone name will be the first subdirectory of
#  the called servlet.
# Example: "ApJServMount /servlets /myServlets"
#  if user requests "http://host/servlets/TestServlet";
#  the servlet "TestServlet" in zone "myServlets" on default host
#  thru default protocol on defaul port will be requested
# Example: "ApJServMount /servlets ajpv12://localhost:8007"
#  if user requests "http://host/servlets/myServlets/TestServlet";
#  the servlet "TestServlet" in zone "myServlets" will be requested
# Example: "ApJServMount /servlets ajpv12://jserv.mydomain.com:15643/myServlets"
#  if user requests "http://host/servlets/TestServlet"; the servlet 
#  "TestServlet" in zone "myServlets" on host "jserv.mydomain.com" using 
#  "ajpv12" protocol on port "15643" will be executed
ApJServMount /servlets /root
ApJServMount /servlet /root

# Whether <VirtualHost> inherits base host mount points or not
# Syntax: ApJServMountCopy [on/off]
# Default: "On"
# Note: This directive is meaninful only when virtual hosts are being used
ApJServMountCopy on

# Executes a servlet passing filename with proper extension in PATH_TRANSLATED 
# property of servlet request.
# Syntax: ApJServAction [extension] [servlet-uri]
# Defaults: NONE
# Notes: This is used for external tools.
#ApJServAction .jsp /servlets/org.gjt.jsp.JSPServlet
#ApJServAction .gsp /servlets/com.bitmechanic.gsp.GspServlet
#ApJServAction .jhtml /servlets/org.apache.servlet.ssi.SSI
#ApJServAction .xml /servlets/org.apache.cocoon.Cocoon

# Enable the Apache JServ status handler with the URL of 
# "http://servername/jserv/"; (note the trailing slash!)
# Change the "deny" directive to restrict access to this status page.
<Location /jserv/>
  SetHandler jserv-status
  
  order deny,allow
  deny from all
  allow from localhost
</Location>

############################## W A R N I N G ##################################
# Remember to disable or otherwise protect the execution of the Apache JServ  #
# Status Handler (see right above) on a production environment since this may #
# give untrusted users the ability to obtain restricted information on your   #
# servlets and their initialization arguments such as JDBC passwords and      #
# other important information. The Apache JServ Status Handler should be      #
# accessible only by system administrators.                                   #
###############################################################################

Reply to: