Contact Us  |  Site Map
Empty Cart
More section links

Guide to install Apache, Mysql, PHP with GD and Freetype support.

This guide will help with setting up your S.A.F.E Console.


Requirements before beginning:

Linux, any version will do, but for this guide we use Redhat/Fedora. You should install a simple Redhat/Fedora server without installing the Web server or MySQL server. We will install these after from source.


This guide is based off the Blazonry guide we only add GD and freetype support.




Installing MySQL:


First we will install MySQL since this is the easiest step. All we need to do is download the rpms and install them. You should use the most current version available which is the 4.x series.

You will need the following rpms:

  • MySQL-server-4.0.20-0.i386.rpm
  • MySQL-client-4.0.20-0.i386.rpm
  • MySQL-devel-4.0.20-0.i386.rpm
  • MySQL-shared-4.0.20-0.i386.rpm
  • MySQL-shared-compat-4.0.18-0.i386.rpm

Once you have downloaded all of the rpms, execute the command:

# rpm –Uvh MySQL*.rpm

Note: You will need to be root to install MySQL, either log in or su to root.


After installation is complete and there are no errors, the next step is to change the root password from a default of ‘blank


Issue the following command:

# mysqladmin –u root password your_password (substitute your_password with the password you would like root to be changed to).


If the mysql service is not running, you will need to issue the command (applies to Fedora and Redhat)

# /etc/rc.d/init.d/mysqld start


You can test the MySQL installation by doing the following:

# mysql –ppassword (substitute password with the root password that you changed)

mysql> use mysql

mysql> SELECT * FROM user;

You should see some data flash by on the screen. MySQL is installed and running properly. You can now type exit.

Downloading Sources:

Create yourself a directory to store all of the source files you will be downloading.

Download the latest Sources for Apache, PHP, zlib, libpng, libjpeg

Apache (for this guide we are using 1.3.31)

PHP (for this guide we are using 4.3.7)

GZIP (for this guide we are using 1.2.1)

Libpng (for this guide we are using 1.2.5)

Jpeg (for this guide we are using jpegsrc.v6b.tar.gz)


  • Check for the presence of freetype on your system. If you are using Redhat/Fedora this is as simple as rpm –q freetype. If freetype is not installed and you are running Fedora, then you can just type:

#yum install freetype

#yum install freetype-devel


You might also need to look for freetype-devel, depends if the compile or make generates errors or not, but it wont hurt to download and install it anyway.


Next, unpack the sources:


# tar –zxvf apache_1.3.31.tar.gz

# tar –zxvf php-4.3.6.tar.gz

# tar –zxvf zlib-1.2.1.tar.gz

# tar –zxvf libpng-1.2.5.tar.gz

# tar –zxvf jpegsrc.v6b.tar.gz


Installing Sources:

Installing Apache with statically linked PHP (with GD and FreeType)

Here are the instructions to install Apache and PHP into the directory /usr/local/apache.


In the Apache source directory /apache_1.3.31

# ./configure --prefix=/usr/local/apache


In the zlib source directory /zlib-1.2.1

# ./configure --prefix=/usr/local

# make

# make install


In the libpng source directory /libpng-1.2.5

# cp scripts/makefile.linux .

# mv makefile.linux makefile # make

# make install


In the libjpeg source directory /jpegsrc-v6b

# ./configure --prefix=/usr/local

# make

# make install

# cp libjpeg.* /usr/lib/


Install Freetype Rpm’s

Download freetype and freetype-devel rpm’s

freetype-2.1.4-5.i386.rpm (available at the time I wrote this article)

freetype-devel-2.1.4-5.i386.rpm (available at the time I wrote this article)


Issue the command:

rpm --ivh freetype-2.1.4-5.i386.rpm (if using the above version)

rpm --ivh freetype-devel-2.1.4-5.i386.rpm


In PHP source directory /php-4.3.6

# ./configure --with-mysql











# make

# make install


In apache source directory /apache_1.3.31

# ./configure --prefix=/usr/local/apache




# make

# make install


Configuring Apache/PHP


To configure PHP copy php.ini-dist which is in the PHP src directory to /usr/local/lib/php.ini Edit this file setting the options you wish, generally nothing needs to be edited.


To configure Apache edit /usr/local/apache/conf/httpd.conf and set your document directory and any other Apache settings you may want. To enable Apache and PHP to work together the following line needs to be added:

AddType application/x-httpd-php .php

Look for this line or something similar already in the httpd.conf file and replace it with the above. Make sure to remove the # comment mark.

After editing the config file you need to restart Apache the command to restart Apache is:

/usr/local/apache/bin/apachectl start

To test Apache and PHP work together create the following PHP file:

<? phpinfo() ?>

Copy this file to the document directory, if you did not change the document directory in the config file (httpd.conf) then the default document directory is /usr/local/apache/htdocs/ Load this page in your browser using the following URL: http://localhost/test.php

This page should bring up the PHP configuration page.

Congratulations you now have a working Apache/PHP/GD/Freetype system