Quick and dirty way of Installing Urchin 5 on Ensim Webppliance (Any version)
(Please note, this howto does not contain instructions on setting up UTM tracking.
I don't like UTM, it seems to break too much so i never used it.)
Login to SSH as root "su -"
#Make a download directory and cd into it
mkdir urchin
cd urchin
#Download and extract the Urchin setup file (for redhat 7.2/7.3)
wget http://www.urchin.com/download/urchin5/dow...500_redhat72.sh
sh urchin5500_redhat72.sh
#Installing Urchin
./install.sh
Select 1 for english language
Select 1 if this is a new install (select 2 for upgrade)
Accept the default location of /usr/local/urchin (just press enter)
Select 1 to create the directory
Choose port number, I use 8080
leave user as 'nobody' (just press enter)
leave group as 'nobody' (just press enter)
Select 2 to not start urchin
Select 1 to continue the install
#Remove the download folder
cd /root; rm -fr urchin
#Allow the port 8080 in your firewall
If you have a firewall now is the time to allow port 8080.
If you use apf then:
pico -w /etc/apf/conf.apf (add port 8080)
#Save the file
ctrl x then y
#Restart the firewall
service apf restart
#Setting up the Logformat
pico -w /etc/httpd/conf/httpd.conf
#Search for 'logformat'
ctrl w (then type in "logformat")
#Replace this line
CODE
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
#With this line
CODE
LogFormat "%h %v %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" "%{Cookie}i"" combined
ctrl x then y to save
#Restart Apache
service httpd restart
#Change logrotate to rotate daily
pico -w /etc/logrotate.conf
(change the line that reads "weekly" to "daily" (no quotes))
ctrl x then y to save
#Make urchin startup on reboot
cp /usr/local/urchin/util/urchin_daemons /etc/rc.d/init.d/urchin
chmod 755 /etc/rc.d/init.d/urchin
#Open this file
pico -w /etc/rc.d/rc.local
#Add to the bottom
/etc/rc.d/init.d/urchin start
ctrl x then y to save
#Ensim automation scripts
cd /etc/appliance/customization/
pico -w add-all.sh
#Add this code
CODE
#! /bin/sh
DOMAINS=`/usr/local/bin/sitelookup -a domain`
SITERETVAL=$?
if [ $SITERETVAL -eq 0 ]; then
for DOMAIN in $DOMAINS
do
USER=`/usr/local/bin/sitelookup -d $DOMAIN site_admin`
/etc/appliance/customization/urchin-add.sh $DOMAIN $USER
done
fi
DOMAINS=`/usr/local/bin/sitelookup -a domain`
SITERETVAL=$?
if [ $SITERETVAL -eq 0 ]; then
for DOMAIN in $DOMAINS
do
USER=`/usr/local/bin/sitelookup -d $DOMAIN site_admin`
/etc/appliance/customization/urchin-add.sh $DOMAIN $USER
done
fi
ctrl x then y to save
pico -w urchin-add.sh
#Add this code
CODE
#! /bin/sh
URCHINPATH="/usr/local/urchin"
OUTPUT="/tmp/urchin-temp.conf"
DOMAIN=$1
USER=$2@$1
PASSWORD="urchin"
echo "<Profile Name="$DOMAIN">" > $OUTPUT
echo " ct_name=$DOMAIN" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_website=http://www.$DOMAIN" >> $OUTPUT
echo " ct_reportdomains=www.$DOMAIN,$DOMAIN" >> $OUTPUT
echo " cs_llist=$DOMAIN-access-log,$DOMAIN-access-log.[1-4]" >> $OUTPUT
echo " ct_defaultpage=index.html" >> $OUTPUT
echo " cs_vmethod=0" >> $OUTPUT
echo " cs_ulist=$USER" >> $OUTPUT
echo "</Profile>" >> $OUTPUT
echo >> $OUTPUT
echo "<Task Name="$DOMAIN">" >> $OUTPUT
echo " ct_name=$DOMAIN" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " cr_frequency=4" >> $OUTPUT
echo " cr_minute=0" >> $OUTPUT
echo " cr_runnow=0" >> $OUTPUT
echo " cr_enabled=off" >> $OUTPUT
echo "</Task>" >> $OUTPUT
echo >> $OUTPUT
echo "<Logfile Name="$DOMAIN-access-log">" >> $OUTPUT
echo " ct_name=$DOMAIN-access-log" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_loglocation=/home/virtual/$DOMAIN/var/log/httpd/access_log" >> $OUTPUT
echo " cs_logformat=ncsa" >> $OUTPUT
echo " cr_type=local" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</Logfile>" >> $OUTPUT
echo >> $OUTPUT
echo "<Logfile Name="$DOMAIN-access-log.[1-4]">" >> $OUTPUT
echo " ct_name=$DOMAIN-access-log.[1-4]" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_loglocation=/home/virtual/$DOMAIN/var/log/httpd/access_log.[1-4]" >> $OUTPUT
echo " cs_logformat=ncsa" >> $OUTPUT
echo " cr_type=local" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</Logfile>" >> $OUTPUT
echo >> $OUTPUT
echo "<User Name="$USER">" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_fullname="$DOMAIN"" >> $OUTPUT
echo " ct_name=$USER" >> $OUTPUT
echo " ct_password=$PASSWORD" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</User>" >> $OUTPUT
$URCHINPATH/util/uconf-import -f $OUTPUT
URCHINPATH="/usr/local/urchin"
OUTPUT="/tmp/urchin-temp.conf"
DOMAIN=$1
USER=$2@$1
PASSWORD="urchin"
echo "<Profile Name="$DOMAIN">" > $OUTPUT
echo " ct_name=$DOMAIN" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_website=http://www.$DOMAIN" >> $OUTPUT
echo " ct_reportdomains=www.$DOMAIN,$DOMAIN" >> $OUTPUT
echo " cs_llist=$DOMAIN-access-log,$DOMAIN-access-log.[1-4]" >> $OUTPUT
echo " ct_defaultpage=index.html" >> $OUTPUT
echo " cs_vmethod=0" >> $OUTPUT
echo " cs_ulist=$USER" >> $OUTPUT
echo "</Profile>" >> $OUTPUT
echo >> $OUTPUT
echo "<Task Name="$DOMAIN">" >> $OUTPUT
echo " ct_name=$DOMAIN" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " cr_frequency=4" >> $OUTPUT
echo " cr_minute=0" >> $OUTPUT
echo " cr_runnow=0" >> $OUTPUT
echo " cr_enabled=off" >> $OUTPUT
echo "</Task>" >> $OUTPUT
echo >> $OUTPUT
echo "<Logfile Name="$DOMAIN-access-log">" >> $OUTPUT
echo " ct_name=$DOMAIN-access-log" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_loglocation=/home/virtual/$DOMAIN/var/log/httpd/access_log" >> $OUTPUT
echo " cs_logformat=ncsa" >> $OUTPUT
echo " cr_type=local" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</Logfile>" >> $OUTPUT
echo >> $OUTPUT
echo "<Logfile Name="$DOMAIN-access-log.[1-4]">" >> $OUTPUT
echo " ct_name=$DOMAIN-access-log.[1-4]" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_loglocation=/home/virtual/$DOMAIN/var/log/httpd/access_log.[1-4]" >> $OUTPUT
echo " cs_logformat=ncsa" >> $OUTPUT
echo " cr_type=local" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</Logfile>" >> $OUTPUT
echo >> $OUTPUT
echo "<User Name="$USER">" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_fullname="$DOMAIN"" >> $OUTPUT
echo " ct_name=$USER" >> $OUTPUT
echo " ct_password=$PASSWORD" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</User>" >> $OUTPUT
$URCHINPATH/util/uconf-import -f $OUTPUT
ctrl x then y to save
pico -w virtDomain.sh
Add this code
CODE
IP=`/bin/hostname -i`
/etc/appliance/customization/urchin-add.sh $1 $2
/etc/appliance/customization/urchin-add.sh $1 $2
(if you already have code in this file, just add)
CODE
/etc/appliance/customization/urchin-add.sh $1 $2
chmod 755 virtDomain.sh urchin-add.sh add-all.sh
#Add current sites to urchin profiles
./add-all.sh
#Start urchin
service urchin start
#Open Urchin in browser and configure and add license
Go to http://IPADDRESS:8080/
User: admin
Pass: urchin (this should be changed)
If you have a licence from RS, click "Activate Pre-Purchased License"
Enter the license in the window that opened then click continue.
Add your contact information and click 'register' then click the link to install the license.
Now your back to urchin.
Click continue, leave the admin settings as default and click next. Enter a new password and click next and now your done.
Urchin stats update on the hour.
Your clients can access them via
http://IPADDRESS:8080/
User: username@domain.com
Pass: urchin (should be changed)
To install a link from Webppliance Pro to urchin see this thread
(i have copyied the thread to the next post incase somehow it becomes deleted)
http://forum.rackshack.net/showthread.php?...&threadid=24197