| Subcribe via RSS

Managing and parsing your Apache logs

Май 31st, 2010 | No Comments | Posted in Apache, modules

Takeaway: Apache server logs contain a wealth of information about the visitors to your site. We show you a few basic tips and tricks for managing and parsing those log files to find the wheat in an ocean of chaff.

Okay, I promise this will be the last from me on Apache logs—at least for a while. But, a natural conclusion to my previous articles on how to use Apache logging is to answer the question: Once you’ve got the logs, how do you extract useful data from them?

More »

Tags:

Apache log file analyzer

Май 30th, 2010 | No Comments | Posted in Apache, modules

. It can analyze Apache log files in Combined and Common formats and give you information about your site’s visitors: activity statistics, accessed files, paths through the site, information about referring pages, search engines, browsers, operating systems, and more. View the WebLog Expert sample report to get the general idea of the variety of information about your site’s usage it can provide.         

More »

Tags:

Module Rewrite

Май 29th, 2010 | No Comments | Posted in Apache, modules

Welcome to mod_rewrite , voodoo of URL manipulation.

This document describes how one can use Apache’s mod_rewrite to solve typical URL based problems webmasters are usually confronted with in practice. The Apache module mod_rewrite is a module which provides a powerful way to do URL manipulations. With it you can nearly do all types of URL manipulations you ever dreamed about. The price you have to pay is to accept complexity, because mod_rewrite is not easy to understand and use for the beginner.

More »

Tags:

HowTo : NginX – The Apache Replacement – DirectAd…

Май 28th, 2010 | No Comments | Posted in Apache, modules

I’ve got the following error executing /etc/init.d/nginx.php rewrite-init

PHP Warning: PHP Startup: dbase: Unable to initialize module

PHP Warning: PHP Startup: ldap: Unable to initialize module

PHP Warning: PHP Startup: mbstring: Unable to initialize module

PHP Warning: PHP Startup: mysql: Unable to initialize module

More »

Tags:

Secure Database Access using PHP4, Apache, suexec,…

Май 27th, 2010 | No Comments | Posted in Apache, modules

The web server runs as its own user id, www-data. When a UNIX process runs another process, the child runs as the same user ID as the calling process. UNIX has a permissions flag on executable files called the setuid bit. If an executable is setuid, the program is run as the owner of the file, NOT as the user ID of the calling process. If a program is setuid and the owner is root, the program runs as root. Only root is able to affect the setuid bit on any file. host:~# chmod u+s program host:~# ls -l program -rwsr-xr-x 1 root root 9999 Jan 01 00:00 program* CGI is Common Gateway Interface, a standard for passing arguments and other data from the web server to other programs. It’s a protocol. It is used by the webserver to call programs run from disk, and to call interpreters built into the webserver. I use external CGI to mean the programs from disk. We use a program called suexec , which is a setuid wrapper program for external CGI. It allows a properly configured virtual hosted web site to execute CGI programs as a userid other than the one the webserver runs as. Suexec is setuid root. Anytime the webserver wants to run a CGI, it runs suexec with a parameter that indicates the path to the actual CGI program. Suexec performs a large number of tests on the CGI program to be run, making sure it is owned by the user, the directory it is in is owned by the user, it has the exact right permissions (not writable by anyone other than the owner), and many other things. Then suexec drops privileges and changes its userID to the userID of the program and runs it as that user. We require all external CGI on the server to use Suexec, which means all users that want to use CGI need a virtual host. This is because suexec is enabled by the User and Group apache config options which only work in a VirtualHost section, and cannot be specified based on Directory. ServerName username.domain.org DocumentRoot /users/username/html ScriptAlias /cgi-bin/ /var/www/htdocs/cgi-bin/username/ User username Group username TransferLog /var/log/apache/username.domain.org/access.log ErrorLog /var/log/apache/username.domain.org/error.log UserDir disabled PHP is a programming language with easy support for embedding inside HTML pages. The webserver calls a PHP interpreter which is either loaded into the webserver as a module (mod_php.so) or as an external program (command: php4). We use the mod_php loaded into the webserver for speed reasons. Any .php file on the server is interpreted by default by mod_php. Since mod_php is loaded into the apache process which runs as www-data, mod_php also runs as www-data. You can access a PostgreSQL database using PHP . To connect to the database the traditional authentication used is username and password. However, the database connection protocols are primitive and only allow plain text passwords, or identd with no password. The plain text password is not vulnerable to packet sniffers since we don’t allow remote database connections anyway. .php files in a user’s html directory are owned by that user. Since the webserver runs as www-data, the .php files need to be world-readable so the webserver, with mod_php, can read them. If you want to use a database using .php, you are going to need to store the plain text username and password in your .php file. But this needs to be world readable. So any user or any program running on the machine can obtain your database password. This problem is a result of using mod_php, which has to run as www-data. So for users who want to use database with PHP, we set them up so that requests for .php files in their website, are handled using the external program, php4, run as an external CGI. This is wrapped by suexec causing the php4 interpreter to run as the user ID owning the website. In theory you could with this setup, put your plaintext database passwords into your .php files, make the .php files readable only by your username, and it would work. But there’s a better way. Debian provides a modified version of the PostgreSQL database server with a new authentication type called peer sameuser . Using local connections between processes on the same machine, peer sameuser verifies that the UID of the database client matches the UID who owns the database being connected to. The connection is authenticated without the need for any password.

More »

Tags:

mod_deflate for Apache 1.3.37

Май 26th, 2010 | No Comments | Posted in Apache, modules

A new Apache 1.3.37 is out and I had to upgrade all my servers to it, in the process I’ve had to compile mod_deflate, a high performance compression module that works MUCH faster then mod_gzip. This is primarily thanks to the fact it does not use temporary files, but instead does everything in memory. Since the official mod_deflate package has been abandoned by its author, even though the code still works with a few minor tweaks. So, I’ve decided to post a patched version of this module for all interested Apache 1.3.37 users.

More »

Tags:

How To Enable Apache Modules in Ubuntu

Май 25th, 2010 | No Comments | Posted in Apache, modules

Learn how to use the a2enmod command to turn on modules for apache 2 in Ubuntu Published Oct 1, 2008 by lobo235

Enabling new Apache Modules in Ubuntu is an easy task once you learn how. On most systems when you want to enable a new Apache Module you just add a LoadModule directive to your httpd.conf but Ubuntu does it quite a bit differently since it is based off of Debian Linux.

More »

Tags:

Typical Configurations Overview For Nginx HTTP(S) …

Май 24th, 2010 | No Comments | Posted in Apache, modules

In one of my previous posts I have described very powerful Unix admin tool – Nginx. As I said, main problem of this server is lack of English documentation. That is why I decided to write this post with list of typical nginx configurations and example configuration snippets for these configurations.

More »

Tags:

niq’s soapbox

Май 23rd, 2010 | No Comments | Posted in Apache, modules

Just in case my blog is a primary source for anyone, Apache HTTPD 2.2.10 is now an official release.  This is primarily a bugfix release, with a number of fixes to proxy esoterica among other things.

One change that isn’t a bugfix is that Apache now supports running chroot as a core feature.  This means the third-party mod_chroot is likely to be obsolete for most users, with possible exceptions amongst those who already use it and rely on its exact behaviour.

Source: http://bahumbug.wordpress.com

Tags:

Apache-2.2.15

Май 22nd, 2010 | No Comments | Posted in Apache, modules

The Apache package contains an open-source HTTP server. It is useful for creating local intranet web sites or running huge web serving operations.

Package Information Additional Downloads Apache Dependencies Optional

Though you can install APR and APR-util as separate components, it is recommended to use the bundled versions that come with the Apache HTTPD tarball.

More »

Tags: