Berkeley CSUA MOTD:Entry 27432
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

2003/2/16 [Computer/SW/WWW/Server] UID:27432 Activity:high
2/15    Is there a way to record who, or at least which machine, have visited
        my web pages on soda, other than relying on them signing a guest book?
        Thanks.
        \_ er... the web logs?  /var/log/httpd/access.log*
           \_ Thanks!  What's the exact format of the lines?  What man page
              should I read?  There's none for apache.
              \_ 1). Read through /usr/local/apache/conf/httpd.conf , at least
                 the parts about LogFormat and CustomLog directives, and the
                 comments around there.
                 2). For further explanation, look up the particular directives
                 in Apache docs (at http://apache.org)
                  \_ We've switched to apache 2. the config file is now:
                     /usr/local/etc/apache/httpd.conf
                     /usr/local/etc/apache2/httpd.conf
                     and the access log is here:
                     /var/log/apache/access.log
                 \_ man www. we've switched to apache2, these files
                    are all old. The correct paths are in "man www" -www
                    \_ erm.  /var/log/httpd is a symlink to /var/log/apache.
                 \_ Or, if you just want the answer:
                    http://httpd.apache.org/docs/logs.html#combined
        \_ as an alternative, write a cgi script that's called using
           server-side includes from from the web page, that records
           REMOTE_ADDR, and other interesting environment variables in
           a separate data file.
           \_ at one point there was something that correlated the IP
              address of the people visiting your page with a csua
              username (based on lastlogin info).
2025/05/25 [General] UID:1000 Activity:popular
5/25    

You may also be interested in these entries...
2010/4/19-5/10 [Computer/SW/Security, Computer/SW/WWW/Server] UID:53791 Activity:nil
4/18    http://Apache.org hacked:
        http://www.theinquirer.net/inquirer/news/1601103/apache-hacked
	...
2010/4/22-5/10 [Computer/SW/Languages/Misc] UID:53797 Activity:nil
4/22    In Linux is there an easy way to rename the scripts in /etc/rc?.d ?
        For example I want to set all the /etc/rc?.d/S91apache to S100apache
        so that it'll run the ramdisk BEFORE going to apache.
        \_ Sure, just move them.
           \_ I mean is there a script that will rename all of them
              for me? Like: setrc apache2 0 0 1 1 1 1
	...
2010/1/22-30 [Computer/HW/Laptop, Computer/SW/OS/OsX] UID:53655 Activity:high
1/22    looking to buy a new development laptop
        needs ssdrive, >6 hr possible batt life, and runs linux reasonably
        Anyone have a recommendation? Thx.
        \_ thinkpad t23 w ssdrive and battery inplace of drive bay
        \_ Ever wondered what RICHARD STALLMAN uses for a laptop?  Well,
           wonder no more!
	...
2010/1/12-29 [Computer/SW/Apps/Media] UID:53627 Activity:kinda low
1/12    How do I get a job NOT related to internet DNS social network cloud
        twitter GOOG EC2 amazon API ???
        \_ A CS job not related to API?
        \_ Chip design, or maybe software that does chip design. What is
           your major? How about game developer?
        \_ DNS? DNS? What era ado you live in? I agree that social network
	...
2009/12/7-2010/1/3 [Computer/HW/Memory, Computer/HW] UID:53574 Activity:nil
12/7    How many TCP retransmits are too many? Here is what I get:
            3594143433 segments received
            3760174421 segments send out
            3801829561 segments retransmited
        \_ rephrase. you can never have too much money. or too little.
           what is, is.
	...
2009/5/7-14 [Computer/SW/WWW/Server] UID:52963 Activity:nil
5/7     I am trying to reproduce a customer bug where their apache header
        has the content-encoding as the last line in the header.
        My test platform is running apache2.2 on ubuntu. Is there a way
        to do this ?i I have already read the apache 2.0 docs and
        I dont see anything obvious ? page is txt/html
	...
2009/3/8-17 [Computer/SW/Unix] UID:52685 Activity:kinda low
3/8     I'm reading about an old exploit where someone used a buffer overflow
        in a printer daemon to get "daemon privileges," which allowed them
        to use another exploit on the mail delivery program to get root.  I'm
        not sure what daemon privileges are.  Is there some set of priveleges
        that most daemons run on that is higher than user but lower than root?
        What are they?  I've never heard this before.
	...
2008/10/14-20 [Computer/SW/Languages/Misc, Computer/SW/Languages/Web] UID:51527 Activity:nil
10/14   2 apache 2.0.52 servers running on Linux boxes.  Identical httpd.conf
        files (except for ServerName).  But on one, if a CGI script takes
        longer than 300 seconds, it times out.  The other, not.  Why is that?
        \_ Perhaps network equipment configuration. Or try comparing settings
           in /proc/sys/net.
           \_ I ran /sbin/sysctl -a | grep tcp, all settings are the same.
	...
2008/9/3 [Computer/SW/Unix] UID:51030 Activity:nil
9/3     Okay, my sed and awk skills are obviously not up to par here.
        I want to only see the "500's" in my apache error log, how do I
        do that? I want to see the whole line, not just the 500 error code.
        Never mind, grep " 500 " is close enough.
	...
Cache (8192 bytes)
httpd.apache.org/docs/logs.html#combined
Piped Logs * 10 Virtual Hosts * 11 Other Log Files + 12 PID File + 13 Script Log + 14 Rewrite Log Security Warning Anyone who can write to the directory where Apache is writing a log file can almost certainly gain access to the uid that the server is started as, which is normally root. Do NOT give people write access to the directory the logs are stored in without being aware of the consequences; In addition, log files may contain information supplied directly by the client, without escaping. Therefore, it is possible for malicious clients to insert control-characters in the log files, so care must be taken in dealing with raw logs. Error Log Related Directives 16 ErrorLog 17 LogLevel The server error log, whose name and location is set by the 18 ErrorLog directive, is the most important log file. This is the place where Apache httpd will send diagnostic information and record any errors that it encounters in processing requests. It is the first place to look when a problem occurs with starting the server or with the operation of the server, since it will often contain details of what went wrong and how to fix it. On unix systems it is also possible to have the server send errors to syslog or 19 pipe them to a program. The format of the error log is relatively free-form and descriptive. But there is certain information that is contained in most error log entries. The second entry lists the severity of the error being reported. The 20 LogLevel directive is used to control the types of errors that are sent to the error log by restricting the severity level. The third entry gives the IP address of the client that generated the error. Beyond that is the message itself, which in this case indicates that the server has been configured to deny the client access. The server reports the file-system path (as opposed to the web path) of the requested document. A very wide variety of different messages can appear in the error log. The error log will also contain debugging output from CGI scripts. Any information written to stderr by a CGI script will be copied directly to the error log. It is not possible to customize the error log by adding or removing information. However, error log entries dealing with particular requests have corresponding entries in the 21 access log. For example, the above example entry corresponds to an access log entry with status code 403. Since it is possible to customize the access log, you can obtain more information about error conditions using that log file. During testing, it is often useful to continuously monitor the error log for any problems. On unix systems, you can accomplish this using: tail -f error_log Access Log Related Modules 22 mod_log_config Related Directives 23 CustomLog 24 LogFormat 25 SetEnvIf The server access log records all requests processed by the server. The location and content of the access log are controlled by the 26 CustomLog directive. The 27 LogFormat directive can be used to simplify the selection of the contents of the logs. This section describes how to configure the server to record information in the access log. Of course, storing the information in the access log is only the start of log management. The next step is to analyze this information to produce useful statistics. Log analysis in general is beyond the scope of this document, and not really part of the job of the web server itself. For more information about this topic, and for applications which perform log analysis, check the 28 Open Directory or 29 Yahoo. Various versions of Apache httpd have used other modules and directives to control access logging, including mod_log_referer, mod_log_agent, and the TransferLog directive. The CustomLog directive now subsumes the functionality of all the older directives. The format is specified using a 30 format string that looks much like a C-style printf format string. For a complete list of the possible contents of the format string, see the 31 mod_log_config documentation. Common Log Format A typical configuration for the access log might look as follows. LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog logs/access_log common This defines the nickname common and associates it with a particular log format string. The format string consists of percent directives, each of which tell the server to log a particular piece of information. Literal characters may also be placed in the format string and will be copied directly into the log output. The quote character must be escaped by placing a back-slash before it to prevent it from being interpreted as the end of the format string. The format string may also contain the special control characters "\n" for new-line and "\t" for tab. The CustomLog directive sets up a new log file using the defined nickname. The filename for the access log is relative to the 32 ServerRoot unless it begins with a slash. The above configuration will write log entries in a format known as the Common Log Format (CLF). This standard format can be produced by many different web servers and read by many log analysis programs. If 33 HostnameLookups is set to On, then the server will try to determine the hostname and log it in place of the IP address. However, this configuration is not recommended since it can significantly slow the server. Instead, it is best to use a log post-processor such as 34 logresolve to determine the hostnames. The IP address reported here is not necessarily the address of the machine at which the user is sitting. If a proxy server exists between the user and the server, this address will be the address of the proxy, rather than the originating machine. In this case, the information that is not available is the RFC 1413 identity of the client determined by identd on the clients machine. This information is highly unreliable and should almost never be used except on tightly controlled internal networks. Apache httpd will not even attempt to determine this information unless 35 IdentityCheck is set to On. The same value is typically provided to CGI scripts in the REMOTE_USER environment variable. If the status code for the request (see below) is 401, then this value should not be trusted because the user is not yet authenticated. If the document is not password protected, this entry will be "-" just like the previous one. The format is: day/month/year:hour:minute:second zone day = 2*digit month = 3*letter year = 4*digit hour = 2*digit minute = 2*digit second = 2*digit zone = (+' | -') 4*digit It is possible to have the time displayed in another format by specifying %{format}t in the log format string, where format is as in strftime from the C standard library. The request line contains a great deal of useful information. It is also possible to log one or more parts of the request line independently. For example, the format string "%m %U%q %H" will log the method, path, query-string, and protocol, resulting in exactly the same output as "%r". This information is very valuable, because it reveals whether the request resulted in a successful response (codes beginning in 2), a redirection (codes beginning in 3), an error caused by the client (codes beginning in 4), or an error in the server (codes beginning in 5). The full list of possible status codes can be found in the 36 HTTP specification (RFC2616 section 10). If no content was returned to the client, this value will be "-". Combined Log Format Another commonly used format string is called the Combined Log Format. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined CustomLog log/acces_log combined This format is exactly the same as the Common Log Format, with the addition of two more fields. Each of the additional fields uses the percent-directive %{header}i, where header can be any HTTP request header. This gives the site that the client reports having been referred from. This is the identifying information that the client browser reports about itself. Multiple Access Logs Multiple access logs can be created simply by specifying multiple CustomLog directives in the configuration file. For example, the following directives will create three access logs....
Cache (1423 bytes)
apache.org
The Apache Software Foundation provides support for the Apache community of open-source software projects. The Apache projects are characterized by a collaborative, consensus based development process, an open and pragmatic software license, and a desire to create high quality software that leads the way in its field. We consider ourselves not simply a group of projects sharing a server, but rather a community of developers and users. Software Patents Kill Innovation We are protesting against attempts to legalise software patents in Europe. For ASF developers and users alike, this directive would mean legal uncertainty: a patent minefield. HTTP Server has been the leading web server platform since 1996. Founded as a collaborative effort aimed at creating a robust, commercial grade, standards-compliant, and feature-rich HTTP server, we are thrilled that the worldwide Internet community has embraced open source as a viable model for software product development. Our achievement is testament to the benefits of the process of open source software development itself. Maven is a Java project management and project comprehension tool. In a nutshell Maven aims to make the developer's life easier by providing a well defined project structure, well defined development processes to follow, and a coherent body of documentation that keeps your developers and clients apprised of what's happening with your project.