/var/net/sys/admin/blog

If you have multiple virtual hosts in your server and you specified different log files for each, it is more organized and easy to locate, but the downside is Linux has so called file descriptors or the number of files that it can be handle. Basically , it can be increased but I think it’s not really recommended just for the sake of it.
Making your apache logs more organized can be done by many ways, one way is via piped logging and use rotatelogs. And based on my tips before named Automatic unlimited subdomains via Apache mod_rewrite, one issue is the log files. But there’s one method to solve this, and this is by splitting up your log files.

Tomcat,known as Apache Tomcat or Jakarta Tomcat is a servlet container developed by ASF or Apache Software Foundation. It implements the JavaServer Pages (JSP) and Java Servlet specifications from Sun Microsystems. To make it simple, it is use as a java http web server environment where you can run your Java code.

This is a brief tutorial on installing and running tomcat in Linux.

Prerequisites:
Java SDK should be installed.

Tested in CentOS 5.X

1. Download Java SDK from sun.com website

http://java.sun.com/javaee/downloads/index.jsp

In this tutorial, we will be using Java EE 5 SDK

Assuming you already have mysql server installed on your machine, the reason you are
installing phpmyadmin is to ease  your administration of  your MySQL like database creation and deletion, create/alter/drop/view tables and execute any SQL statements, privilege and trigger management, stored procedures, and backup/ maintenance

phyMyAdmin is a tool built in PHP to manage and administer your MySQL servers via your browser.

Requirements:

1.PHP
2.MySQL
3.php-mysql
4.gd/gd-devel
5. Apache

I had the chance to work as a systems administrator in an e-commerce company and they have Linux dedicated servers leased/purchase from a hosting provider.
Dedicated servers compared to a shared hosting is you have full control of the box. You can do whatever you want with the box, implement services and of course a full root access with the machine.

With this company, we are hosting about 200+ websites and some of them are hosted in our  boxes run in Redhat Enterprise Linux. As part of administering the box is to have a full and incremental backup of our dynamic website files and database. Scheduled shell scripts are set on this machine and luckily, I was able to find one of the useful backup solution script that can be found in this site:

The procedure below was tested successfully on CentOS.  The same thing was also implemented on my BSD box and works as well.

Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on Unix and Windows and is licensed under the GNU GPL.

1.compile cronolog (http://cronolog.org) and install it on /usr/local/sbin
2. backup orig /usr/local/apache-tomcat-5.5.20/bin/catalina.sh  on /root
3. edit lines on catalina.sh from
org.apache.catalina.startup.Bootstrap “$@” start \
>> “$CATALINA_BASE”/logs/catalina.out 2>&1 &

to

org.apache.catalina.startup.Bootstrap “$@” start 2>&1 \
| /usr/local/sbin/cronolog “$CATALINA_BASE”/logs/catalina.out.%Y-%m-%d >> /dev/null &

4. Removed the line
touch “$CATALINA_BASE”/logs/catalina.out

5. Restart web service
#/usr/local/tomcat/bin/shutdown.sh
# service httpd stop
# /usr/local/tomcat/bin/startup.sh
#service httpd start

TESTING

1.    Check tomcat logs to see generated Catalina.out per day
# ls -la /usr/local/tomcat/logs

-rw-r–r–   1 root root      65607 Nov  6 14:55 catalina.out.2007-11-06

2.    browse ww2.freelinuxtutorials.com and login using test account to see if tomcat is working

Here are the steps in installing and configuring AWstats in Tomcat Web Server

STEPS:

1.    Download awstats.war from the internet
2.    Since Tomcat disabled by default the CGI executions, we need to enable it by renaming the file servlets-cgi.renametojar to servlets-cgi.jar
Example:
[Tomcat_installation_path] = /usr/local/apache-tomcat-5.5.20

#cd /usr/local/apache-tomcat-5.5.20/server/lib
#mv servlets-cgi.renametojar servlets-cgi.jar

3.    Install AWStats
Since it is already a .war file, no need to install it by hand, you just need to copy this file to [Tomcat_installation_path]/webapps folder

#cp awstats.war [Tomcat_installation_path]/webapps

It would create an [Tomcat_installation_path]/webapps/awstats folder after copied.

4.    Configure AWStats
Let say our domain is www.mydomain.com

Here are the steps in installing AWstats on Apache Web Server as your web log analyzer and statistics:

STEPS:

Assuming VirtualHost setting is already added on the httpd.conf, and the log is customized already for a combined log.

Example:
#<VirtualHost support.freelinuxtutorials.com:80>
ServerAdmin webmaster@support.freelinuxtutorials.com
DocumentRoot /home/www/support.freelinuxtutorials.com
ServerName support.freelinuxtutorials.com
ErrorLog /var/log/httpd/support.freelinuxtutorials.com-error_log
CustomLog /var/log/httpd/support.freelinuxtutorials.com-combined_log combined

If not httpd.conf should be modified to customized the log of a particular website

CustomLog /yourlogpath/yourlogfile common
to
CustomLog /yourlogpath/yourlogfile combined

1.    Download the latest stable awstats.tar.gz  from the internet

#cd /usr/local/
#wget http://prdownloads.sourceforge.net/awstats/awstats-6.7.tar.gz

2.    Uncompress the tarball file and rename the directory to awstats

This is the list of commonly used commands in systems administration.

Clocks
hwclock Manage hardware clock.
netdate Set clock according to host’s clock.
rdate Manage time server.
zdump Print list of time zones.
zic Create time conversion information files.

Host Information
arch Print machine architecture.
dnsdomainname Print DNS domain name.
domainname Print NIS domain name.
free Print memory usage.
host Print host and zone information.
hostname Print or set hostname.
nslookup Query Internet domain name servers.
uname Print host information.

One of my favorite linux distribution, Slackware, had released their version 13.0.

One of the significant change is the release of the official 64-bit.  Their is also a completely reworked on the  collection of X packages, major upgrades to the desktop environments for KDE and Xfce.

Full Official announcement in:

http://www.slackware.com/announce/13.0.php

 

About FLT

This site is dedicated to everyone who likes to learn and explore the beautiful world of Linux. If you have comments and suggestions, please feel free to email at comments@freelinuxtutorials.com. I am happy to serve and share things esp. that is free and enjoyable as Linux.