Archive for the ‘Server’ Category

CentOS 5.5 ImageMagick install + php module

Working this morning, I had to get ImageMagick working on a CentOS 5.5 VM. Pretty easy with YUM right? Well there were some complications installing the associated PHP module. So after doing the usual yum update, here is what you should do.

  1. yum install ImageMagick ImageMagick-devel
  2. If you are lucky “pecl install imagick” will work, if so skip to last 2 steps. If not continue along. I got the $PHP_AUTOCONF error.
  3. Head over to – http://pecl.php.net/package/imagick – and download the latest tarball (wget or whatever you fancy). At time of writing, I used “imagick-3.0.0RC2.tgz“.
  4. tar xzvf [da archive name] and cd into said archive
  5. gotta compile this thing from source: a) phpize b) ./configure c) make d) make install (as root … duh!) [check out Steven's post on webhostingtalk.com]
  6. load & restart: a) echo "extension=imagick.so" > /etc/php.d/imagick.ini b) /etc/init.d/httpd restart
  7. check to see if it was installed: php -m | grep imagick

Now let’s check to see if imagemagick “works”. Create a .php file on the server and access it with your web browser. Excerpted from docduke’s post on astahost.info.

<html> <head> <title>Test for ImageMagick</title> </head>
<body> <?
function alist ($array) {  //This function prints a text array as an html list.
$alist = “<ul>”;
for ($i = 0; $i < sizeof($array); $i++) {
$alist .= “<li>$array[$i]“;
}
$alist .= “</ul>”;
return $alist;
}
exec(“convert -version”, $out, $rcode); //Try to get ImageMagick “convert” program version number.
echo “Version return code is $rcode <br>”; //Print the return code: 0 if OK, nonzero if error.
echo alist($out); //Print the output of “convert -version”
//Additional code discussed below goes here.
?> </body> </html>

server move

I will be consolidating all of my sites onto one physical server collocated in FDCservers' Chicago location. My VPS lease runs out on the 16th. Large data files, media, and my SVN repos will probably be unavailable or sporadically accessible until during the week of the 24th sometime.

Your Ad Here

OpenVPN on CentOS 5.2

A bit of googling turned up a great post by on howtoforge.com called, “OpenVPN Server On CentOS 5.2. I didn’t know quite how to add the rpmforge repo that is needed to install OpenVPN from so … google turned up another handy article how to do that called, “CentOS 5 – install rpmforge yum repo“. I checked the rpmforge RPM releases at http://dag.wieers.com/rpm/packages/rpmforge-release/ to be sure that this is the latest release … it is (as of June 2009). The following pasties are based off of the aforementioned article with some changes.

yum install openvpn
cd /etc/openvpn/
mkdir easy-rsa
cp -R /usr/share/doc/openvpn-2.0.9/easy-rsa/2.0/* easy-rsa/
chmod -R 777 easy-rsa/
cd easy-rsa/
. ./vars
./clean-all
./build-ca

–> For the common name use “OpenVPN-CA”, of anything else helpfully descriptive. <–
./build-key-server server
–> Enter various customized values if you so please, but be sure to leave the common name value as the default – “server”. Oh, and answer yes to the two questions at the end. <–
./build-key client1
–> Change the number 1 to 2, 3, and so on how ever many client certificates you want. Leave the common name as the default “clientn“. <–
./build-dh
cd keys/
openvpn --genkey --secret ta.key

For more information on transferring the necessary keys to the client, see the final part of a blog post I did on running OpenVPN on Debian.

I created two example config files utilizing the OpenVPN routed tunnel method … hope they help. [server] [client]

Just add the static routes to the VPN subnet(s) to your LAN gateway.

If you need any help I suppose you could always pay me to set this up for you, that’s what I’ve done for some other folks.

Return top