Information and Links
Join the fray by commenting, tracking what others have to say, or linking to it from your blog.
- Other Posts
- Urchin and HTTPS on RHEL and Ensim
Install Urchin on Ensim RHEL 3 or 4
UPDATE: Since EV1 has merged (for better or worse) with The Planet, the forums have also merged. This means that all those fantastic links we used to have are now gone from EV1. So I have found the original post for this how to from Foggy at The Planet forums and updated it here. Hope that helps someone.
UPDATE 2: I am using this script on RHEL4 boxes with no issues. Though I do see the scheduler not running error all the time on one box. Despite that message, Urchin runs quite happily.
Here is a simple and extemely useful How-To to help you get Urchin running smoothly on RHEL 3 and 4 with Ensim 3.x and 4.x. This How-To is based on projectandrews now defunct unofficialsupport.com website with some minor updates. You can also find this How-To posted at The Planet.
Login as root
-
cd /usr/local/src
-
mkdir urchin
-
cd urchin
Download and extract Urchin
-
wget http://www.urchin.com/download/urch...500_redhat73.sh
-
sh urchin5500_redhat73.sh
Install 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 (preferably use a different one from the default i.e. 9899)
-
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 /usr/local/src
-
rm -Rf urchin
Open port 9899 in your firewall (or whatever port you used.)
For APF
-
pico -w /etc/apf/conf.apf
-
CTRL-x then y
Restart the firewall
-
service apf restart
Setting up the Logformat to use UTM
-
cd /etc/httpd/conf/
Make a backup copy of the apache config file first.
-
cp httpd20_app.conf httpd20_app.conf.bak
-
pico -w /etc/httpd/conf/httpd.conf
Search for 'logformat'
CTRL-w (then type in "logformat")
Replace this line:
-
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
With this line:
-
LogFormat "%h %v %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined
CTRL-x then y to save
Restart Apache
-
/etc/init.d/httpd configtest
If you get response of Syntax OK, then proceed to restart apache. If you get errors, DO NOT try to restart apache, as it will fail. Fix the errors first, then try the configtest again.
-
/etc/init.d/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 this line
-
/etc/rc.d/init.d/urchin start
CTRL-x then y to save
Now we will create the auto add scripts for ensim. So each time you add a new site, urchin will be enabled for that site. And we will add urchin to all the sites that already exist.
-
cd /etc/appliance/customization/
-
pico -w add-all.sh
Copy paste the following 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
ctrl x then y to save
pico -w urchin-add.sh
Add this code to urchin-add.sh
-
#! /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
CTRL-x then y to save
-
pico -w virtDomain.sh
Add this code to virtDomain.sh
-
IP=`/bin/hostname -i`
-
/etc/appliance/customization/urchin-add.sh $1 $2
If there is already code in virtDomain.sh, then simply append this code to the end of virtDomain.sh instead:
-
/etc/appliance/customization/urchin-add.sh $1 $2
Then make all three files executable
-
chmod 755 virtDomain.sh urchin-add.sh add-all.sh
Now simply add the current sites to urchin profiles by running add-all.sh like so
-
./add-all.sh
Now start or restart Urchin
-
service urchin start
Final Configuration of Urchin
Open Urchin in your browser and follow the configuration instructions. The license number will be in the email that you received from EV1 Servers.
Go to
-
http://IPADDRESS:8080/
Enter your username and password into Urchin.
Username: admin
Password: urchin
If you purchase or received your license from EV1 Servers, then click on "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.
You will now be automatically taken back to Urchin on your own server.
Click continue, leave the admin settings as default and click next. Enter a new password and click next.
Congratulations! You are now finished installing Urchin.
Miscellaneous info about Urchin
- Urchin stats update on the hour.
- Your clients can access them via
- https://IPADDRESS:9899/
- User: username@domain.com
- Pass: urchin (should be changed)


I have used urchin for quite some time using what I believe to be this exact script to configure urchin profiles upon creating new hosting accounts on my ensim servers…
Unfortunately after RHEL 4 came out I discovered a number of troubles in installing urchin… More specifically even after fixing problems related to the installation I have been unnable to use this script due to problems in importing configs using the importer script that urchin comes with (which is relied on to add to the urchin profiles).
Does anyone use urchin on rhel4 with this script to automate things??
Thanks