Installing Bugzilla on an ISPConfig site
Thu, 06/07/2007 - 16:34 — sandipThese are some notes I had taken down during the installation of Bugzilla on a server with ISPConfig hosting control panel:
Requirements:
# yum install mysql-devel gd-devel libpng-devel libjpeg-devel freetype-devel libdbm-devel
# rpm -e mod_perl #else mod_perl2 does not install.
Create Site:
Site was created via the ISPConfig control panel with "web6_bugs" as the admin user and "web6" as the group.
Install:
$ cd /var/www/web6
$ wget http://ftp.mozilla.org/pub/moz illa.org/webtools/bugzilla-3.0 .tar.gz
$ tar -xvzf buzilla-3.0.tar.gz
$ mv buzilla-3.0/* web
$ ./checksetup.pl --check-modules
# perl -MCPAN -e 'install AppConfig' #had to force install.
# perl -MCPAN -e 'install Bundle::Bugzilla'
# perl -MCPAN -e 'install GD' #requires libpng-devel, libjpeg-devel, freetype-devel
$ ./checksetup.pl #Edit the localcofig with the correct database settings.
$ ./checksetup.pl #Re-run anytime if needed, specifically if the file permissions are not correct.
$ chgrp -R apache . #Had to make all files belong to the apache group after re-running checksetup.pl .
Apache with mod_perl need the below directives in httpd.conf:
PerlSwitches -I/var/www/web6/web -w -T
PerlConfigRequire /var/www/web6/web/mod_perl.pl
Runs a lot faster, but is a memory hog. Suggested to turn off KeepAlive in apache when running mod_perl.
Crontab Entry:
# Bugzilla
5 0 * * * web6_bugs cd /var/www/web6/web; ./collectstats.pl
55 0 * * * web6_bugs cd /var/www/web6/web; ./whineatnews.pl
*/45 * * * * web6_bugs cd /var/www/web6/web; ./whine.pl
Hosting multiple domains pointed to the same web-space
Thu, 05/31/2007 - 16:20 — sandipPlace the snippet of code in an index.php file to pull up a different web page for each domain pointed to the same web-space.
<?
$serverName = $HTTP_HOST;
$serverName = str_replace("www.",& quot;",$serverName);
$serverName = str_replace(".com",& quot;",$serverName);
$serverName = str_replace(".net",& quot;",$serverName);
$serverName = str_replace(".org",& quot;",$serverName);
if (!(empty($serverName))) {
include("./".$server Name.".html");
}
?>
Installing APC Cache (alternative to Turck Mmcache/Eaccelerator)
Wed, 05/23/2007 - 10:31 — sandipNotes on installing Alternative PHP Cache (APC):
-
Download and istall:
$ wget http://pecl.php.net/get/APC-3. 0.14.tgz
$ tar -xvzf APC-3.0.14.tgz
$ cd APC-3.0.14
$ phpize
$ ./configure --enable-apc
$ make
# make install
extension=/path/to/apc.so
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XX XXXX
apc.enable_cli=1
# service httpd restart
Copy the "apc.php" admin file in the source directory to a password protected web site directory. Edit "apc.php" top line to change password to something different from default.
Static compile and install of apache + mod_ssl + php on FC4
Tue, 05/22/2007 - 15:24 — sandipLatest Compile with pdo drivers for mysql along with mod_security.
NOTE:
Remove the MySQL-shared rpm else openssl will not work.
# rpm -e MySQL-shared-5.0.20a-0.glibc23
Inserting adsense code to multiple files...
Tue, 05/08/2007 - 21:56 — sandipHere's a quick bash script that I wrote to add adsense code just before the closing body tag in several accounts with the same file name. Could be modified to take the file names as the last argument if different.
Note: replace the UA-####### with your particular ID number assigned by adsense.
#!/bin/bash
# insert_adsense.sh
# usage: ./insert_adsense.sh {account} {count}
ACCOUNT=$1
COUNT=$2
FILE=/home/${ACCOUNT}/public _html/index.inc.php
ADSENSE="
<script src=\"http://www.google-a nalytics.com/urchin.js\" type=\"text/javascript\&q uot;>
</script>
<script type=\"text/javascript\&q uot;>
_uacct = \"UA-#######-${COUNT}\&qu ot;;
urchinTracker();
</script>
"
cp $FILE $FILE.bak
replace "</body>" "${ADSENSE}</body>& quot; -- $FILE
exit 0
masquerade with iptables
Fri, 05/04/2007 - 23:39 — sandipAllows for easy sharing of internet connection to an internal network with dynamic IP range.
# iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
Sending mail to a SMTP server using telnet
Fri, 05/04/2007 - 14:15 — sandip$ telnet remotehost 25
HELO localhost
MAIL FROM: johndoe@localhost
RCPT TO: jilldoe@remotehost
DATA
Subject:Test Message
This is a test message.
.
QUIT
RAID notes...
Wed, 05/02/2007 - 12:16 — sandip-
Create RAID-1 level array with 2 active devices and 1 spare:
# mdadm -C /dev/md0 -l 1 -n 2 /dev/hda{8,9} -x 1 /dev/hda10
Note: RAID-1 provides for redundancy and needs a minimum of 2 partitions and any number of spares.
Show details:# mdadm --detail /dev/md0
# mdadm --manage /dev/md0 -f /dev/hda8
Note: When partition is marked faulty, the spare quickly replaces it in RAID 1 array.
Remove:# mdadm --manage /dev/md0 -r /dev/hda8
Note: Only faulty partitions can be removed.
Add:# mdadm --manage /dev/md0 -a /dev/hda8
Note: Only removed partitions can be added.
Stop RAID:# mdadm --stop /dev/md0
# mdadm --assemble /dev/md0 /dev/hda{8,9,10}
Note: Before assembling, check on the UUID of the devices. They should all be the same and show only one array:
mdadm --examine --scan /dev/hda{8,9,10}
# mdadm --zero-superblock /dev/hda{8,9,10}
# mdadm --examine --scan
mdadm --detail --scan
# nohup mdadm --monitor --mail=root --delay=300 /dev/md0 &
Check if cpu supports 64 bit
Sun, 04/22/2007 - 00:56 — sandipIf the below produces lm (long mode) flags, then the cpu has support for x86_64 architecture.
# grep lm /proc/cpuinfo
I have seen quite a few dedicated servers with support for x86_64 architecture, but i386 installed instead.
When doing a `uname -a`, the output misleads you to think that x86_64 is not supported. Such machines do not fully utilize the hardware resources and decreases performance of you box.
Converting bin/cue to iso format
Sat, 04/21/2007 - 22:45 — sandipYou might come across a disc image in the BIN/CUE format. BIN/CUE files can be directly burned to CD via K3B, however if you want to convert to an iso, a command line application called bchunk can be used.
# yum --enablerepo=extras install bchunk
# bchunk image.bin image.cue image.iso