Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Saturday, August 8, 2009

Installing Bugzilla

Bugzilla is a bug-tracking system from mozilla.org. Bugzilla is enterprise-class piece of software that tracks bugs and issues for hundreds of organizations around the world.

Step 1: Create server say bugzilla.mydomain.com

Setup hostname, network, dns etc properly

Step 2 : Install the following prerequisites

Before installing see bugzilla documentation for supported versions for the package you are going to install

•Install MTA
#yum install sendmail*
•Install database server
#yum install mysql-server
•Install web server
#yum install httpd-*
•Install Perl
#Yum Install perl-*
#yum install ImageMagick-devel

Step 3 : Configure sendmail to send and recive email

You may need to configure your DNS server properly to set your email server to send and receive email. By default send mail will listen port on 25 in 127.0.0.1 only ,Change DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl as below

#vi /etc/mail/sendmail.mc

dnl #DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
#service sendmail restart
#chkconfig sendmail on

Note: - [Please see send mail documentation for any additional configurations]

Step 4 : Setup Database Server

•Start mysql server
#service mysqld start
•Set mysqladmin password
# mysqladmin password ********

Step 4.1: Allow large attachments and many comments

By default, MySQL will only allow you to insert things into the database that are smaller than 64KB. To change MySQL’s default, you need to edit your MySQL configuration file, which is usually /etc/my.cnf on Linux.

# vi /etc/my.cnf

[mysqld]
max_allowed_packet=10M

Step 4.2: Allow small words in full-text indexes

By default, words must be at least four characters in length in order to be indexed by MySQL’s full-text indexes. This causes a lot of Bugzilla specific words to be missed, including "cc", "ftp" and "uri".
MySQL can be configured to index those words by setting the ft_min_word_len param to the minimum size of the words to index. This can be done by modifying the /etc/my.cnf according to the example below:

# vi /etc/my.cnf
[mysqld]
# Allow small words in full-text indexes
ft_min_word_len=2

Step 4.3: create a database user to use for bugzilla

You need to add a new MySQL user for Bugzilla to use. (It’s not safe to have Bugzilla use the MySQL root account.) You will need the $db_pass password later to set in localconfig . I used SQL GRANT command to create a “bugs” user. This also restricts the “bugs”user to operations within database called “bugs”, and only allows the account to connect from “localhost”. Modify your setup if you will be connecting from another machine or as a different user. Replace $db_password with your proffered password


mysql> GRANT SELECT, INSERT,UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY ’$db_password’;

mysql> FLUSH PRIVILEGES;

Step 4.4 . Permit attachments table to grow beyond 4GB Note: [This has to be done only after completing bugzilla installation]

By default, MySQL will limit the size of a table to 4GB. This limit is present even if the underlying filesystem has no such limit. To set a higher limit, follow these instructions. After you have completed the rest of the installation (or at least the database setup parts), you should run the MySQL command-line client and enter the following, replacing $bugs_db with your Bugzilla database name (bugs by default):

mysql> use $bugs_db
mysql> ALTER TABLE attachments AVG_ROW_LENGTH=1000000,MAX_ROWS=20000;

Step 5: Setup webserver

Normally you will have to add set the server name and specify the document root directory .
Note [ Follow apache/httpd documentation for any advance configurations]

#vi /etc/httpd/conf/httpd.conf

ServerName bugzilla.mydomain.com


#service httpd restart
#chkconfig httpd on

Setup 6: Install Bugzilla

Download the latest package from bugzilla and unzip it

#tar -xvzf bugzilla-3.4.1.tar.gz
#mv bugzilla-3.4.1 /var/www/html/
# chown -R 751 bugzilla-3.4.1/
#chown root:apache -R bugzilla-3.4.1/


Step 7: Edit localconfig

#vi /var/www/html/bugzilla/localconfig

Set database password , username , location of dot /usr/bin/dot etc here

Step 10: Install all required modules

#cd /var/www/html/bugzilla/

Check whether all required modules are installed or not using checksetup.pl --check-modules
#./checksetup.pl --check-modules

Install any missing modules
eg: #/usr/bin/perl install-module.pl GD::Text

Step 11: Run checksetup.pl

After resolving all dependencies you can install bugzilla by running the below command

#./checksetup.pl


Step 12: Verify whether bugzilla is accessible

At this point we will be able to upgraded bugzilla instance bu accessing http://bugzilla.mydomain.com/bugzilla


Well .... its ready do some customization and play with bugs:-)

Saturday, August 1, 2009

Installing Apache2 on Linux



Step1: Get tar.gz packages for apache

Download appropriate package
#wget http://apache.mirror.facebook.net/httpd/httpd-2.2.11.tar.gz

Step2: Configure and Install Apache

#tar -xvxf httpd-2.2.11.tar.gz
# mv httpd-2.2.11 /usr/local/
#cd /usr/local/httpd-2.2.11
#./configure
#make
#make install

By default apache will install on /usr/local/apache2


Step3: Configure Apche to start automatically on reboot

# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd

Add the fllowing lines to /etc/init.d/httpd

#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/logs/httpd.pid
# config: /usr/local/apache/conf/httpd.conf
#
Then execute the below commands

# chmod 755 /etc/init.d/httpd
# chkconfig --add httpd
# chkconfig --level 35 httpd on


Note [ If you need a more detailed feedback we can use the below scrip as startup script]


#!/bin/bash
# httpd Startup script for the Apache HTTP Server
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server. It is used to serve
# HTML files and CGI.
# processname: httpd
# config: /usr/local/apache2/conf/httpd.conf
# pidfile: /var/run/apache2.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Start httpd in the C locale by default.
HTTPD_LANG=${HTTPD_LANG-"C"}

# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""

# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/local/apache2/bin/apachectl
httpd=${HTTPD-/usr/local/apache2/bin/httpd}
prog=httpd
pidfile=${PIDFILE-/var/run/apache2.pid}
lockfile=${LOCKFILE-/var/lock/subsys/apache2}
RETVAL=0

start() {
echo -n $"Starting $prog: "
LANG=$HTTPD_LANG daemon $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
reload() {
echo -n $"Reloading $prog: "
if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
RETVAL=$?
echo $"not reloading due to configuration syntax error"
failure $"not reloading $httpd due to configuration syntax error"
else
killproc $httpd -HUP
RETVAL=$?
fi
echo
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f ${pidfile} ] ; then
stop
start
fi
;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
exit 1
esac

exit $RETVAL





Step4: Add path variabled if required

Create a file /etc/profile.d/apache2

# touch /etc/profile.d/apache2
# chmod +x /etc/profile.d/apache2
#vi /etc/profile.d/apache2

#***** Set Env Variables for Apche

APACHE_HOME=/usr/local/apache2
export APACHE_HOME
export PATH=$APACHE_HOME/bin:$PATH



Logout from shell to get this updated


End Of the Document
*******************************************
Courtesy: http://olex.openlogic.com