Fatal error: Call to undefined function curl_init

When you run your PHP script you get the error:

Fatal error: Call to undefined function curl_init()

This is most likely caused by PHP not having the curl module installed. To fix, you want to run:

sudo apt-get install php5-curl

restart Apache and then check your phpinfo page to verify if this is showing up or not.

http://evolutioncreations.wik.is/Ubuntu/FAQ%27s/PHP/Fatal_error%3a_Call_to_undefined_function_curl_init()

Installing Process Maker on Ubuntu 8.04

This is being installed on a vanilla VM image with LAMP and OpenSSH server installed. The first thing you will want to do is:

sudo apt-get update
sudo apt-get upgrade
This will ensure that your base system is fully updated before we get started. If you didn’t install LAMP or OpenSSH, you can run:
sudo apt-get install openssh-server mysql-server php5 apache2 php5-mysql
and this will install the software you need. Let’s start by getting the software. Go to the URL:
and copy the link to pmos-1.1-1999.tar.gz. You run the following:
cd /opt; sudo wget http://downloads.sourceforge.net/processmaker/pmos-1.1-1999.tar.gz?modtime=1225133280&big_mirror=0

Your URL at the end of the wget may be different depending on the version of the package and the mirror site that SourceForge provides you. Run the following:
sudo tar zxvf pmos-1.1-199.tar.gz
so that the files extract in the /opt mount, you should see that this extracts a directory: processmaker. After this has completed, you will run:
sudo a2enmod expires
sudo a2enmod rewrite
sudo /etc/init.d/apache2 force-reload

and because we are going to use Joe:

sudo apt-get install joe

Now we need to configure apache2 to read from the configuration files. To do this, you will run:

sudo cp /opt/processmaker/etc/pmos.conf /etc/apache2/sites-available/
sudo joe /etc/apache2/sites-available/pmos.conf
sudo a2ensite pmos.conf

and add in the following line to the pmos.conf file:

php_value magic_quotes_gpc 0

once these have been added, reload apache2:

sudo /etc/init.d/apache2 reload

Now we need to create a superuser on the MySQL database. This is done by running:

mysql -p
mysql> grant all on *.* to ‘USER@localhost’ identified by ‘PASSWORD’ with grant option;

Change the USER to the name of the new user, and PASSWORD to the new password.

cd /opt/processmaker
sudo mkdir shared compiled
sudo chmod 777 shared compiled
sudo chmod 777 -R workflow/engine/content/languages
sudo chmod 777 -R workflow/engine/js/labels
sudo chmod 0777 -R workflow/engine/config/
sudo chown www-data:www-data -R /opt/processmaker

Finally you will want to open the site in a browser:

http://servername:port/

You may need to disable the default site in apache2, you can do this by running:

sudo a2dissite default
sudo /etc/init.d/apache2 reload

The installation configuration page should appear and test your configuration. You should expect that MySQL fails, until you enter in the username/password that you created previously in this guide. You can click on the TEST button to verify that it’s configured properly. Also you will get a warning that the memory_limit for PHP is too low. By default PHP will install with the memory_limit = 16M. To change this run:

sudo joe /etc/php5/apache2/php.ini

and change the 16M to 40M. Once this is done you have to reload apache2 for the changes to take effect. Once this is done you should have green across the board, and be ready to move forward with the install. If everything installed properly, you should get to a login screen, at which point you will enter using the default login information of:

Username: admin
Password: admin

Obviously once you login, you’ll want to change this information to something more secure. That should be, it, if you’ve followed everything here, the software should be installed and ready for you to go to work and play with it! The below URL will get you started on configurations. This is my first time using this software, so I’ll write up a post regarding configuration and integration with other systems after I get to that juncture in my process.

Note, if you are logging in from another machine, you might get a 3rd option during the login asking for workspace. By default, the default workspace is: workflow. 

Installing MindTouch DekiWiki on Ubuntu 8.04

I installed mine on a clean 8.04 VM image, so your environment may be slightly different, but going back to a vanilla install, this guide should be completely accurate. 

The first thing you will want to do is make sure that LAMP is installed on your machine and configured. You will also need to make sure you know the password to the ‘root’ user for MySQL. The next thing you need to do is:
sudo apt-get update
sudo apt-get upgrade
This will make sure your system is up2date with the existing software before you go ahead and update it further with Dekiwiki. Next you will want to run:
sudo apt-get install joe
As most of you know by know, joe is one of my favorite text editors on Linux, so the rest of the guide will use joe. Next run the following:
sudo apt-get joe /etc/apt/sources.list

and add in the following:
deb http://repo.mindtouch.com xUbuntu_8.04/
Once you save the file, run:
sudo apt-get update
Next run:
apt-get install html2ps poppler-utils html2text wv gs tidy links msttcorefonts cabextract
You want to respond ‘YES’ to everything that you get prompted for. Next you will want to run:
sudo wget http://www.princexml.com/download/prince_6.0r6-1_i386.deb
sudo dpkg -i prince_6.0r6-1_i386.deb
sudo apt-get install dekiwiki
and finally you will run:
a2ensite dekiwiki
a2dissite default
sudo /etc/init.d/apache2 reload
Then once Apache reloads you can go to the URL:
http://<servername>: /config/index.php
and go through the form to enter in information such as the title of the dekiwiki instance, administrator username/password, and database connection information. Once that gets configured you should get to a success page where you will then run some commands to clean up your installer.
Reference

Installing Geany Ubuntu

I’ve been reading through the book Agile Web Development with Rails by Dave Thomas and David Heinemeier Hansson, and there is a review of various editor’s, such as:

  • TextMate
  • RadRails
  • jEdit
  • Komodo
  • Arachno Ruby

While this opinion may change down the road, just starting out, I found it incredibly hard to find an editor that works. Textmate works on Mac, so that’s out of the picture. RadRails seems to have a long and exhaustive install process–no thanks! Jedit, I couldn’t get to work at all!

So after a bit more Googling I came across Geany. Now things might change later on, after I get to use this more, but for now it’s working. Hopefully this is the first blog of many on my travels in Ruby on Rails development!

Installing Java Version 1.5.0_08 in Ubuntu

Some software packages require older versions of Java to run. To do this, you will want to run:

sudo apt-get install sun-java5-jre sun-java5-plugin sun-java5-font

To test this afterwards, you can run:

java -version

And you should see version 1.5.0.15 show up.

Disabling Splash Screen Ubuntu

During startup, any administration knows that this is where you need to be aware of the things going on with your system. But out of the box, Ubuntu comes ready to suppress the errors and display a nice splash screen.

To get around this and get your information back you want to run:

sudo joe /boot/grub/menu.lst

and locate the below:

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=ed59a33a-69bf-4a01-af11-be65b87b4286 ro quiet splash xforcevesa
initrd /boot/initrd.img-2.6.24-19-generic
quiet

You just want to remove quiet splash so it reads:

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=ed59a33a-69bf-4a01-af11-be65b87b4286 ro xforcevesa
initrd /boot/initrd.img-2.6.24-19-generic
quiet

Obviously you’ll want to do this for the appropriate kernel title that you are using, as of the date of this posting it was 2.6.24-19.

Forcing Filesystem Check Ubuntu

So tonight my long download finally completed, and I had about 36 updates that were pending to go through, so naturally I just tried to do an apt-get update/upgrade, and wouldn’t you know about half way through the process, I got a failure to commit data to disk. And during restart I got an error that the disk was dirty.

Of all the things! So what I recommend people do, when you manually shutdown the machine, force the machine to fsck! Run the following from terminal:

sudo touch /forcefsck

This will place an empty file in / called forcefsk and restart your computer normally. This will force the system to fsck the disk during startup.

SNMP Error in Cacti with Windows Vista Device

So after coming back from holiday’s the only box that was on my network was my Linux router/server/firewall. In powering up all the other Windows machines two of them came back online ok and started reporting graphs, but my main Windows box didn’t. The error when I went into Cacti Admin > Console > Devices > The Device was: SNMP Error right under the upper left corner of the window under SNMP Information.

The first thing that I went to check was under Control Panels > Administrative Tools > Services and verified that the SNMP Service and SNMP Trap were both set to automatically start, and are both running. I went in to check the configuration of the SNMP service and the IP address that it was set to report to is correct and the community is fine.

So to break through all the walls here, the first test that you should run is:

snmpwalk -Os -c public -v 1 xxx.xxx.xxx.xx system

Replace the XXX’s with the actual internal IP address. Now what’s interesting for me is that my main box has two NIC’s on it; 192.168.1.8 and 192.168.1.20. When I ran the test against the first IP address, I received the below error:

george@otani:~$ snmpwalk -Os -c public -v 1 192.168.1.8 system
Timeout: No Response from 192.168.1.8

But when I ran it against the 192.168.1.20 IP, I received a response:

george@otani:~$ snmpwalk -Os -c public -v 1 192.168.1.20 system
sysDescr.0 = STRING: Hardware: x86 Family 6 Model 15 Stepping 11 AT/AT COMPATIBLE – Software: Windows Version 6.0 (Build 6001 Multiprocessor Free)
sysObjectID.0 = OID: enterprises.311.1.1.3.1.1
sysUpTimeInstance = Timeticks: (216315) 0:36:03.15
sysContact.0 = STRING:
sysName.0 = STRING: COMPUTERNAME
sysLocation.0 = STRING:
sysServices.0 = INTEGER: 76

This boils down to a firewall or some sort of block that is causing this error. If you don’t have two NIC’s, start with troubleshooting it at the local firewall level or at your router level. But changing the device IP from 192.168.1.8 to 192.168.1.20, I received the following within Cacti:

GEORGE-INTEL-DESKTOP (192.168.1.20) SNMP Information
System: Hardware: x86 Family 6 Model 15 Stepping 11 AT/AT COMPATIBLE – Software: Windows Version 6.0 (Build 6001 Multiprocessor Free)
Uptime: 218222 (0 days, 0 hours, 36 minutes)
Hostname: COMPUTERNAME
Location:
Contact:

apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

On the new Apache2 instance that I have running Cacti, I ran into a problem where I get the error message:

apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

To fix this, I have to add the following line into the /etc/apache2/httpd.conf file:

ServerName nameofserver

Replace nameofserver with the actual name of the server that you want to have Apache configured under.

Installing Spined for Cacti on Ubuntu 8.04

So to jazz things up again, I wanted to move away from the PHP poller, and install Spined, which is the poller daemon that can be used instead of the PHP program and is much more efficient for larger systems.

To start with, you want to download the latest version of Spine from the website here. Once you have downloaded the tar ball (I downloaded it to my /home/george directory (you will want to change george to whatever your current user is)), and run:

tar zxvf cacti-spine-0.8.7a.tar.gz

and then you want to:

cd cacti-spine-0.8.7a

From this directory, you will need to run:

./configure

Now when I did this, I got into loads of problems, because it was telling me that:

error: cannot run /bin/bash conifg/config.sub

To get around this, I had to run:

sudo apt-get install libmysqlclient15-dev libsnmp9-dev automake libtool

Then I was able to run:

aclocal
libtoolize –force
autoconf
autoheader
automake
./configure

In that order. Each of the above lines needs to be run separetely. Once you successfully run the ./configure, you can run:

make

to make the binary. Now once that has gone through for you, you will need to create a directory:

sudo mkdir /usr/local/spine

and then execute:

sudo cp spine* /usr/local/spine

This will move the spine binary and spine.conf files from your /home directory to the /usr/local/spine directory.

Then you want to run:

sudo joe /usr/local/spine/spine.conf

and modify the configuration to the proper settings for your cacti database instance. If you used my previous guide your information should be:

DB_Host localhost
DB_Database cacti
DB_User cacti
DB_Pass xxxxxx
DB_Port 3306

You will replace the xxxxxx with the password that you setup for your Cacti database during the installation.

Finally you will need to login to Cacti, and go to Console > Settings > Paths, and modify the path for Spine under the Alternative Poller Path section:

/usr/local/spine/spine

When you click on save, the words under the path field for Spine should read:

[OK: FILE FOUND]

Then you will want to click on the Poller tab and set this from cmd.php to spine and save your settings. This should be it and you should be using Spine as your poller!

Reference 1
Reference 2

Get Adobe Flash playerPlugin by wpburn.com wordpress themes