Well.Done (c) Radek Hulán [EN]
Compile Apache (with SSL), PHP 5 and MySQL on Linux

Compile Apache (with SSL), PHP 5 and MySQL on Linux

15.07.2007

This article comes with a full reference on how to compile from source latest Apache 2.0.53 server, including support for SSL, PHP 5.0.3 as a module, and MySQL 4.1.10 database on a Linux. It was fully tested under SUSE Linux 9.1, SUSE Linux 9.2 and Fedora Core 3, but shall work with any Linux distribution (only on Debian you will have to change RPMs for proper deb packages).

Today, when almost every Linux distribution comes with a binary form of Apache 2.0.x, PHP 4.3.x and MySQL 4.0.x, it may seem a bit unnecessary to compile these, but, if you want some special configuration, latest components, or simply tune performance of your Apache, PHP and MySQL, compilation from source is the only possibility.

Basic system description:

PHP 5.0.3 will be compiled with support for: bz2, cpdflib, ctype, curllib, dom, ftp, gd2, freetype2, gettext, libiconv, libxml, mbstring, mysql, openssl, pcre, posix, session, SimpleXML, SPL, SQLite, tokenizer, xml, and zlib.

Apache 2.0.53 will be compiled with support for mod_access, mod_auth, mod_auth_digest, mod_deflate, mod_env, mod_headers, mod_setenvif, mod_ssl, mod_mime, mod_imap, mod_alias and mod_rewrite.

Compilation options:

Compilation can be customized by passing several parameters to gcc at runtime, for my Pentium-IV/HT/3.2GHz, this is a good starting set of parameters:

export CFLAGS="-march=pentium4 -mfpmath=sse -msse2 -O2 -pipe -s -fomit-frame-pointer"

You may get a list of gcc compilation options for your CPU at gcc.gnu.org.

All these scripts were fully tested under SESE Linux 9.1 with custom-built kernel 2.6.8.1 and Fedora Core 3 with custom-built kernel 2.6.9.1, and gcc version 3.3.3 / 3.4.2, but they shall work with any Linux distro (only on Debian you may need to change rpm packages for deb ones).

This manual assumes that all source files are located (downloaded to) /usr/local/src directory, SSL keys are placed into /home/ssl directory, and web root is located at /home/www directory.

Compile from source (Open) SSL:

Compilation of OpenSSL:

su
cd /usr/local/src
tar -zxvf openssl-0.9.7e.tar.gz
cd openssl-0.9.7e
./config --prefix=/usr/local
make
make install

Create a private key and place it into directory /home/ssl:

mkdir /home/ssl
cd /home/ssl
/usr/local/bin/openssl genrsa -des3 -rand \ 
  some_big_file_1:some_big_file_2 \
  -out localhost.key 1024

Next, we will create a private key without a pass-phrase, this is less secure, but it allows us to bootup the server without manually entering the pass-phrase every time…

/usr/local/bin/openssl rsa \
  -in localhost.key \
  -out localhost.key.unsecure

We will also create a request file that will be emailed to proper certification authority for getting a trusted SSL certificate (if needed) under file localhost.key.csr:

/usr/local/bin/openssl req -new \
  -key localhost.key \
  -out localhost.key.csr

While waiting for the certification authority, we can create a temporary self-signed certificate, good for 30 days:

/usr/local/bin/openssl x509 -req \
  -days 30 \
  -in localhost.key.csr \
  -signkey localhost.key \
  -out localhost.cert 
chmod 400 localhost.cert
chmod 400 localhost.key
chmod 400 localhost.key.unsecure

Compile MySQL 4.1.10 database from source:

MySQL 4.1.10 has a completely different communication protocol and associated PHP mysqli functions. If your scripts were not designed for MySQL 4.1, you shall rather get MySQL release 4.0.23, to stay 100% compatible! Compilation options for MYSQL 4.0.23 will be the same, just remove one line with mysqli from PHP ./configure script.

However for any new development, MySQL 4.1.10 is recommended.

Compiling MySQL from source, and creating user / group called mysql:

cd /usr/local/src
tar -zxvf mysql-4.1.10.tar.gz
cd mysql-4.1.10
./configure \
  --prefix=/usr/local/mysql \
  --with-unix-sock-path=/tmp/mysql.sock \
  --with-charset=utf8
make
make install
groupadd mysql
useradd -g mysql mysql
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R root  .
chown -R mysql var
chgrp -R mysql .

MySQL configuration file /etc/my.cnf can (for our local testing) look like this:

[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
net_buffer_length = 2K
thread_stack = 64K
skip-networking
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 8M
sort_buffer_size = 8M
[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout

Compile from source Apache 2.0.53 web server:

Quite a few web-hosting companies still use Apache 1.3.x, but time of Apache 2.0 incompatibilities and problems is long gone, so 2.0 is a better choice now.

And compile it:

cd /usr/local/src
tar -zxvf httpd-2.0.53.tar.gz
cd httpd-2.0.53
./configure \
   --prefix=/usr/local/apache2 \
   --enable-so \
   --enable-auth-digest \
   --enable-rewrite \
   --enable-setenvif \
   --enable-mime \
   --enable-deflate \
   --enable-ssl \
   --with-ssl=/usr/local \
   --enable-headers
make
make install

Next we have to modify (alter) main Apache config file located at /usr/local/apache2/conf/httpd.conf (this also assumes your web root is located at /home/www):

DocumentRoot "/home/www"

And we well add support for PHP 5 (as a module):

LoadModule php5_module modules/libphp5.so
DirectoryIndex index.html index.htm index.php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

We also have to allow / create basic mod_rewrite rules:

<Directory "/home/www">
 Options Indexes Includes FollowSymLinks MultiViews
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>

And dissalow clients to access .htaccess:

<Files ~ "^.ht">
   Order allow,deny
   Deny from all
</Files>

Next, if using SSL (on standard port 443), we will have to modify file /usr/local/apache2/conf/ssl.conf as follows (just replace the file content with this):

Listen 443
<VirtualHost _default_:443>
 ServerName localhost
 SSLEngine on
 SSLCertificateFile /home/ssl/localhost.cert
 SSLCertificateKeyFile /home/ssl/localhost.key.unsecure
</VirtualHost>

Compile from source PHP 5.0.3:

For compiling PHP, we will need quite a few external libraries, like libcurl, libiconv, libjpeg, libpng, and few others, which we have to download and compile first:

Compile libiconv from source:

cd /usr/local/src
tar -zxvf libiconv-1.9.2.tar.gz
cd libiconv-1.9.2
./configure --prefix=/usr/local
make
make install

Compile libjpeg from source:

cd /usr/local/src
tar -zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure --prefix=/usr/local
make
make install
make install-lib

Compile libpng from source:

cd /usr/local/src
tar -zxvf libpng-1.2.8.tar.gz
cd libpng-1.2.8
cp scripts/makefile.linux makefile
make
make install

Compile cpdflib from source:

cd /usr/local/src
tar -zxvf clibpdf202r1.tar.gz
cd ClibPDF/source
cp Makefile.Linux makefile
make
make install

Compile curl from source:

cd /usr/local/src
tar -zxvf curl-7.12.1.tar.gz
cd curl-7.12.1
./configure --prefix=/usr/local
make
make install

Compile freetype 2 from source:

cd /usr/local/src
tar -jxvf freetype-2.1.9.tar.bz2
cd freetype-2.1.9
./configure --prefix=/usr/local
make
make install

Next, we will compile PHP, with support for MySQL, iconv, curl, zlib, gd2, mbstring, SSL and many other modules:

cd /usr/local/src
tar -jxvf php-5.0.3.tar.bz2
cd php-5.0.3
./configure \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --with-mysql=/usr/local/mysql  \
  --with-mysqli=/usr/local/mysql/bin/mysql_config  \
  --with-mysql-sock=/tmp/mysql.sock \
  --with-sqlite \
  --enable-sqlite-utf8 \
  --with-zlib \
  --with-zlib-dir \
  --with-bz2 \
  --with-gd \
  --enable-gd \
  --enable-gd-native-ttf \
  --with-jpeg-dir=/usr/local \
  --with-png-dir=/usr/local \
  --with-ttf \
  --with-freetype-dir=/usr/local \
  --with-iconv=/usr/local \
  --with-curl=/usr/local \
  --enable-track-vars \
  --with-gettext \
  --with-config-file-path=/usr/local/apache2/conf \
  --enable-trans-id \
  --enable-ftp \
  --with-cpdflib=/usr/local \
  --enable-mbstring \
  --with-openssl=/usr/local
make
make install
cp php.ini-dist /usr/local/apache2/conf/php.ini

Next, we have to modify PHP configuration in file /usr/local/apache2/conf/php.ini, including basic PHP security settings:

mysql.default_socket = /tmp/mysql.sock
short_open_tag = Off
register_globals = Off
allow_url_fopen = Off

How to start Apache and MySQL at bootup?

The last thing left is to create a startup script, whitch will allow to run Apache and MySQL at bootup, automatically, so that we don’t have to do it manually. We will create a new file (for SuSE Linux 9.1, other ditros may vary here) /etc/init.d/web and set “executable” flag to it.

#! /bin/sh
#
# /etc/init.d/web
#
# (c) Radek HULAN
# http://hulan.info/
#
### BEGIN INIT INFO
# Provides:       apache-mysql
# Default-Start:  5
# Default-Stop:   5
# Description:    Starts Apache2 and MySQL 4
### END INIT INFO

case "$1" in
        start)
        /usr/local/apache2/bin/apachectl start
        /usr/local/mysql/share/mysql/mysql.server start
                ;;
        stop)
        /usr/local/apache2/bin/apachectl stop
        /usr/local/mysql/share/mysql/mysql.server stop
                ;;
        restart)
        /usr/local/apache2/bin/apachectl restart
        /usr/local/mysql/share/mysql/mysql.server restart
                ;;
esac

Next we will run YaST, section “System”, sub-section “Run level editor”, where we will enable service web for runlevel 3 and 5.

Testing the system?

First, start Apache and MySQL servers by entering:

/etc/init.d/web start

Next, create file /home/www/index.php with the following content:

<?php phpinfo(); ?>

In your browser, type URL http://localhost/ and https://localhost/, and if everything is installed fine, you will see a lot of information about your new Apache/PHP/MySQL installation.

phpMyAdmin:

We will also need phpMyAdmin to manage MySQL database, by entering http://localhost/db/ into our browser:

Installation of phpMyAdmin into /home/www/db:

mkdir /home/www
cd /home/www
tar -jxvf /usr/local/src/phpMyAdmin-2.6.1.tar.bz2
ln -s phpMyAdmin-2.6.1 db

Next, we will configure phpMyAdmin’s advanced feaures, by modifying file /home/www/db/config.inc.php:

// URL to phpMyAdmin
$cfg['PmaAbsoluteUri'] = 'http://localhost/db/';

//connection settings
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['extension'] = 'mysqli';

// user na password
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root'; 
$cfg['Servers'][$i]['password'] = '';

// PMA settings
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; 
$cfg['Servers'][$i]['column_info'] = 'pma_column_info'; 
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['verbose_check'] = FALSE;

// persistent connections
$cfg['PersistentConnections'] = TRUE;

// do not display logo on the left
$cfg['LeftDisplayLogo'] = FALSE;

// show MySQL and PHP info
$cfg['ShowMysqlInfo'] = TRUE;
$cfg['ShowMysqlVars'] = TRUE;
$cfg['ShowPhpInfo'] = TRUE;

// show BLOBs
$cfg['ShowBlob'] = TRUE;

After everything is installed, use phpMyAdmin SQL window to run script /home/www/db/scripts/create_tables_mysql_4_1_2+.sql to create PMA tables, needed by phpMyAdmin.

Debugging PHP:

There are several tools, like PHPeclipse, which allow to debug PHP, in a full-featured IDE. In order to use PHPeclipse, you need to install PHP debugger first.

Installation:

cd /usr/local/src
tar -zxvf dbg-2.11.32-src.tar.gz
cd dbg-2.11.32
./deferphpize
mkdir /usr/local/modules
cp modules/dbg.so /usr/local/modules
cp modules/dbg.la /usr/local/modules

Next, you will have to modify PHP configuration file located at /usr/local/apache2/conf/php.ini, add here:

; load debugger
extension_dir = "/usr/local/modules"
extension=dbg.so

; debugger configuration
[debugger]
debugger.enabled = true
debugger.profiler_enabled = true
debugger.JIT_host = localhost
debugger.JIT_port = 10001
debugger.JIT_enabled = on

; implicint flush - use only when debugging
implicit_flush = On

Do you need mod_perl as well?

Installation and compilation:

cd /usr/local/src
tar zxvf mod_perl-2.0-current.tar.gz
cd mod_perl-1.99_16
perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
make
make install

Next, you have to modify Apache configuration file located at /usr/local/apache2/conf/httpd.conf to load mod_perl, and set to use perl at directory /home/www/perl:

LoadModule perl_module modules/mod_perl.so
PerlModule Apache2
Alias /perl/ /home/www/perl/
<Location /perl/>
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Location>

Testing? Create file /home/www/perl/test.pl, issue chmod 755 test.pl on it, and type http://localhost/perl/test.pl in your browser to test your mod_perl installation.

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl 2.0 rocks!\n";
18:00:43 - Sunday, 15.07.07 - category: Linux - 165663x - permalink

Exports:

Exports: Print [print].

Comments:

  1. [1] Seth Buntin 216.249.151.172

    The new installtaion guide for the MySQL gamma doesn't work correctly. I get a folder /usr/local/mysql-test instead of /usr/local/mysql even when I declare the prefix to be /usr/local/mysql. I thought I might let you know. Keep up the wonderful work...

    reply to this comment
    1. this comment inspired admin — #2
    2. this comment inspired pop — #3
    3. this comment inspired Emanuele Bergamini — #10
    4. this comment inspired James — #41
    votes: 1 18.10.2004, 16:31:44
  2. [2] admin

    inspired by Seth Buntin — #1 Seth, it works just fine for me, properly installed in /usr/local/mysql, did you have any version of MySQL installed before? Binary form from your distro? If so, have you removed it first? What distro are you running?

    reply to this comment votes: 7 18.10.2004, 17:14:27
  3. [3] pop studpc324.thndorm.htu.se

    inspired by Seth Buntin — #1 I have the same problem but i ran MySQL release 4.0.21
    How can i see if i already had another realese installed? and if so how do i remove it/correxct it?

    reply to this comment
    1. this comment inspired admin — #4
    votes: 0 18.10.2004, 23:57:33
  4. [4] admin

    inspired by pop — #3 execute this to see if package is installed: rpm -qa | grep mysql ... that will show you full name and version of package installed, next : execute: rpm -e full-package-name and finally, execute: rpm --rebuilddb ...

    reply to this comment votes: 8 19.10.2004, 00:21:30
  5. [5] Seth Buntin 65.114.125.61

    I have installed (by the guide above) MySQL and still get the same problem. If I install the 4.0.21 I don't (but 4.0.21 doesn't accept the charset declaration). The server was blank (accept for the standard install of gnome, editors, and development tools. BTW I am using Fedora Core 2). I don't know where to go from here. I guess I will just use 4.0.21.

    reply to this comment votes: 1 19.10.2004, 05:15:45
  6. [6] Seth Buntin 65.114.125.61

    How do I clear the information from the MySQL-gamma? I deleted the folder /usr/local/mysql-test/ (which was created from above) and then installed the 4.0.21 version and now that gives me the /usr/local/mysql-test folder. I tried all of this on a brand new (fresh) machine.

    I don't know what to do now.

    reply to this comment votes: 1 19.10.2004, 05:53:09
  7. [7] pop studpc324.thndorm.htu.se

    i am using feodora core 2 to... i didnt find any with rpm -qa | grep mysql... can i just delete the folders and start all over?

    reply to this comment
    1. this comment inspired admin — #8
    2. this comment inspired admin — #9
    votes: 1 19.10.2004, 10:29:55
  8. [8] admin

    inspired by pop — #7 try rpmi, or use Fedora graphical "RPM package tool / Program Installation Tool", called "YaST" under SUSE Linux, to remove any MYSQL, Apache, PHP you may have...

    reply to this comment votes: 7 19.10.2004, 10:57:17
  9. [9] admin

    inspired by pop — #7 you may also try these: /sbin/chkconfig --del httpd and /sbin/chkconfig --del mysql on Fedora Core 2

    reply to this comment votes: 6 19.10.2004, 16:03:08
  10. [10] Emanuele Bergamini host179-18.pool8172.interbusiness.it

    inspired by Seth Buntin — #1 I got the same error. But I solved it. :)

    The problem is caused by an error in configure parameter for mysql. You must use --prefix=/usr/local/mysql and NOT --with-prefix=usr/local/mysql. (in 4.1.6gamma) the latter is ignored, and mysql is installed in /usr/local.

    If you want to delete the wrong installation, you have to delete manually any mysql-related files into every folder in /usr/local.
    (you can do a "good" installation and then see what files are created inside /usr/local/mysql, and then delete allo the file with the same name relative to /usr/local.

    reply to this comment
    1. this comment inspired admin — #11
    votes: 1 19.10.2004, 17:04:37
  11. [11] admin

    inspired by Emanuele Bergamini — #10 oh, you're right, my small typo. Fixed now. Thanks!!

    reply to this comment votes: 9 19.10.2004, 17:23:46
  12. [12] Seth Buntin 216.249.152.124

    I got everything to work correctly except the libjpeg source package. It will not create the a|so. At least that is what the php build tells me. I just took it out. Is that important?

    reply to this comment
    1. this comment inspired admin — #13
    votes: 0 19.10.2004, 21:17:43
  13. [13] admin

    inspired by Seth Buntin — #12 guess you haven't compiled it correctly, doesn't really matter if you are not using scripts like Coppermine Photo Gallery, which require GD2 with JPEG support

    reply to this comment
    1. this comment inspired Seth Buntin — #14
    votes: 10 19.10.2004, 21:27:33
  14. [14] Seth Buntin 216.249.152.124

    inspired by admin — #13 I did just as explained above...

    reply to this comment
    1. this comment inspired admin — #15
    votes: 0 19.10.2004, 21:32:21
  15. [15] admin

    inspired by Seth Buntin — #14 I double-tried to compile it again, with no problem.. Guess some distro, tool-related, problem.

    reply to this comment votes: 9 19.10.2004, 21:39:59
  16. [16] Seth Buntin 65.114.125.61

    I am still getting this error:

    configure: error: libjpeg.(a|so) not found.
    I don't know what to do.

    reply to this comment
    1. this comment inspired Dinh Quang Dan — #20
    votes: 1 26.10.2004, 05:32:17
  17. [17] Andrew J. Leer pool-151-201-154-72.phil.east.verizon.net

    When compiling mysql4.1 Gamma in Debian I always get this error, when running ./config What can I do about this?

    checking for tgetent in -lncurses... no
    checking for tgetent in -lcurses... no
    checking for tgetent in -ltermcap... no
    checking for termcap functions library... configure: error: No curses/termcap library found

    What does this mean and how can I get around it?

    reply to this comment votes: 0 26.10.2004, 19:47:30
  18. [18] Andrew J. Leer pool-151-201-154-72.phil.east.verizon.net

    Okay I figured it out...
    I went on IRC and some guy told me to install libncurses-dev with apt-get. This cleared up my problem on Debian, thanks! And do post this for all the Debian users who might be wondering about this, thanks!

    reply to this comment votes: 0 26.10.2004, 21:03:11
  19. [19] Andrew J. Leer pool-151-201-154-72.phil.east.verizon.net

    Also when installing Apache2 on Debian I found that I need to apt-get install zlib1g-dev because they don't call the zlib package the same thing.

    reply to this comment votes: 0 26.10.2004, 22:54:27
  20. [20] Dinh Quang Dan 203.162.92.126

    inspired by Seth Buntin — #16 just do one of the following commands, the error will be tripped.

    #ln -s /usr/local/src/jpeg-6b/libjpeg.a /usr/lib/libjpeg.a
    or
    #cp /usr/local/src/jpeg-6b/libjpeg.a /usr/lib

    refer to: /etc/ld.so.conf

    reply to this comment votes: 0 27.10.2004, 05:45:00
  21. [21] Dinh Quang Dan 203.162.92.126

    Dear all,

    When compiling php-5.0.2 in RH9, Kernel 2.4.20-8 with --with-gd , the cofiguration is passed but i always get this error when running make command

    /usr/local/src/php-5.0.2/ext/gd/libgd/gd_jpeg.c:38:21: jpeglib.h: No such file o
    r directory
    /usr/local/src/php-5.0.2/ext/gd/libgd/gd_jpeg.c:39:20: jerror.h: No such file or
    directory
    /usr/local/src/php-5.0.2/ext/gd/libgd/gd_jpeg.c:49: parse error before "cinfo"
    ...
    /usr/local/src/php-5.0.2/ext/gd/libgd/gd_jpeg.c:451: confused by earlier errors,
    bailing out
    make: *** [ext/gd/libgd/gd_jpeg.lo] Error 1

    i have already built jpeg-6b successfully, but can not build gd2. The errors are the same above while compiling gd2, i copied two library files to /usr/local/src/php-5.0.2/ext/gd/libgd/
    or change the Makefile

    GDLIB_CFLAGS = -I/usr/local/src/php-5.0.2/ext/gd/libgd -DHAVE_LIBPNG -DHAVE_LIBJPEG -I/usr/local/src/jpeg-6

    But nothing done, if i compile without gd support, it works fine...

    anyone built successfully and help me???

    Thanks in advance,
    Dan.

    reply to this comment
    1. this comment inspired melkor — #46
    votes: -2 30.10.2004, 06:06:29
  22. [22] bloodline adsl-126.121.42.info.com.ph

    Hello.
    I think that This document is really necessary for Apache2 and PHP 5 and MySQL 4.1 install.

    please agree that my translation to korean and upload to Korean web site with this site URL and Writer.

    anyway. Thank you for support good information like this document.

    reply to this comment
    1. this comment inspired admin — #23
    votes: 0 07.11.2004, 15:48:29
  23. [23] admin

    inspired by bloodline — #22 of course, go ahead, with proper credit given :-)

    reply to this comment votes: 9 07.11.2004, 15:50:16
  24. [24] Christopher cablelink40-252.intercable.net

    Everything works fine, but the installation of php. It says it doesn't find the file libphp5.so
    Here's the error message:
    Syntax error on line 233 of /usr/local/apache2/conf/httpd.conf:
    Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory
    The file is not in the entire system, for I have made a
    locate libphp5.so
    and nothing comes up.
    In /usr/local/apache2/modules/ there are three files:
    httpd.exp libphp5.a libphp5.la
    but the libphp5 is not.
    I would appreciate if you give me a clue here.
    Thanks

    reply to this comment votes: 0 08.11.2004, 03:16:54
  25. [25] Steven 194.206.158.67

    Thank you for putting this document on the web. I find it extremely helpful. After I make and then make install apache I see this:

    bin]# httpd -l
    Compiled-in modules:
    http_core.c
    mod_so.c
    suexec: enabled; valid wrapper /usr/sbin/suexec
    bin]#

    Which is not what I expect. I was expecting a long-ish list of the installed modules. Does anyone have any advice?

    reply to this comment votes: 1 12.11.2004, 16:59:21
  26. [26] holdenurg adsl-215-3-181.mia.bellsouth.net

    Great site!... Kudos!!!
    Installed on Suse9.1 without installing web server. Basic KDE default installation. Compiled as shown here and entire install is working. Only change for Suse9.1 is default home changed from /srv/www/htdocs to suggested /home/www/htdocs. Good documentation through entire process without any errors until Nusphere. Missing one library and found on Suse9.1 disk 2 & 3 ok.

    Good documentation and many thank-you's...!

    Has anyone installed Mambo on this setup?

    Regards

    Herb

    reply to this comment votes: 0 25.11.2004, 06:54:23
  27. [27] Herb adsl-215-0-190.mia.bellsouth.net

    Hello again...
    Tried this on Suse 9.2 Pro but not working. There is a conflict with one of the newer libraries. If you go through and run this setup it will kill the KDE desktop. (ack - forced back to command line.) I went back to suse 9.1 and resetup the server. If anyone gets on with the 9.2 version and walks through their setup, please let us know.... It is a simple fix I think as there are newer libraries installed by Suse9.2 and some of these here do not have to be installed. I am continuing to work on this. The 9.2 has the new KDE 3.3...

    Thank you again Radek for your work here...

    Herb

    reply to this comment
    1. this comment inspired admin — #28
    votes: 0 29.11.2004, 01:27:58
  28. [28] admin

    inspired by Herb — #27 Hi Herb, I am running SUSE 9.1 with KDE 3.3.0 as well, and custom-built kernel 2.6.9.1-smp. And no problem at all. I am not upgrading to SUSE 9.2 any soon, as I already have the latest components, but, if you find the reason for the problem you are describing, please let me know, I'll be happy to publish that.

    reply to this comment votes: 9 29.11.2004, 01:44:47
  29. [29] Nigel Heynes 213.249.129.4

    I just installed using your instructions on fedora Core 3..(I used mysql 4.0.21 for compatibility)

    The only 2 issues I got was I mistakenly thought some of the PHP prerequisite external libraries were installed ok.... They are included in Fedora core but not in the right places it would seem for the php configure. I installed all the libraries as per instruction and this got past those errors.

    I then had one other issue with the php configure, jpeglib.h missing as per Ding Quang Dan.... this I resolved by installing the development version of the jpeg-lib.

    All works great now... thanks for the help

    reply to this comment
    1. this comment inspired admin — #30
    votes: 0 02.12.2004, 17:42:51
  30. [30] admin

    inspired by Nigel Heynes — #29 Nigel, I have migrated today from SUSE 9.1 to Fedora Core 3 and had no problems compiling all stuff as described, ie. without any mods to scripts

    reply to this comment votes: 9 03.12.2004, 01:01:46
  31. [31] ddsurf rrcs-24-173-161-214.se.biz.rr.com

    I am on SUse 9.2 found a Library error on libxml2.6.7 required if you install utilities on top of this it conflicts. I installed then repaired with update and poof had new libxml2 and all installed fine from there on.
    However not knowing Linux well when i preview a page i get source not results of php or html pages.
    dave

    reply to this comment votes: 1 08.12.2004, 17:25:11
  32. [32] alert 202.144.77.68

    This is one of a GR8 Doclet i ever seen my life.
    Thanks for your help...

    reply to this comment votes: 0 25.01.2005, 09:34:20
  33. [33] Tazikas 213.252.247.196

    I had problems with running Apache+ssl. The problem was that You should use Listen 0.0.0.0:443 instead of Listen 443, as stated in this how-to. That solved the problem. Hope that helps someone.

    reply to this comment votes: 0 30.01.2005, 01:58:30
  34. [34] komaii 81-223-54-180.innsbruck-rum.xdsl-line.inode.at

    excellent howto. compiled on SuSE9.2 without any errors. great work :o)

    reply to this comment votes: 0 04.02.2005, 17:00:44
  35. [35] MC cblmdm63-162-28-14.buckeye-express.com

    This is a great howto. Everything went fine for me on FC2, except that when I try and open localhost/db/ I get the following error:

    Fatal error: Call to undefined function PMA_reloadNavigation() in /home/www/phpMyAdmin-2.6.1/header.inc.php on line 132

    Any thoughts?

    Thanks!

    reply to this comment votes: 0 11.02.2005, 21:04:50
  36. [36] Nitin ip28-106.csu.edu

    Hey Radek,
    I am wondering how come ur mysql4.1.9 complied with --with-charset=utf8 option as there is a reported bug on mysql site.
    http://bugs.mysql.com/bug.php?id=7893... (Primary)
    http://bugs.mysql.com/bug.php?id=7373...
    I hope u wont mind it. I just want to apprise u of problems with mysql 4.1.9. I dont undertsand your language so I dont know what I need to write in text boxes below.
    regards,
    Nitin

    reply to this comment
    1. this comment inspired admin — #37
    votes: 0 16.02.2005, 17:11:35
  37. [37] admin

    inspired by Nitin — #36 Hi, I'm currently using MySQL 4.1.8, and saw new 4.1.9 to be released, so just replaced the number in this tutorial, without recompilation. Thanks for the insight!

    reply to this comment votes: 9 16.02.2005, 17:31:02
  38. [38] Choc fir-newi-newi.nwman.ac.uk

    being a wind...(sorry I wont swear!) man myself, recently getting hold of a machine to run linux was awsome and im loving every moment of it!!

    Thank you for making this awsome tutorial/walk-through!

    Choc of eWales.info

    reply to this comment votes: 0 23.02.2005, 03:18:32
  39. [39] James 163.224.204.68.cfl.res.rr.com

    Hey there, wonderfull guide! Everything has gone perfectly up until this point where I try to issue:

    /etc/init.d/web start

    I get this error:

    /etc/init.d/web start
    [Sun Mar 27 17:14:59 2005] [warn] module php5_module is already loaded, skipping
    httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    /usr/local/apache2/bin/apachectl: line 78: 22090 Illegal instruction $HTTPD -k $ARGV
    I've tried stopping, and restarting... stoping yields this:
    /etc/init.d/web stop
    [Sun Mar 27 18:43:39 2005] [warn] module php5_module is already loaded, skipping
    httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    httpd (no pid file) not running
    No mysqld pid file found. Looked for /usr/local/mysql/var/jupiter.pid.
    restarting yields this:

    /etc/init.d/web restart
    [Sun Mar 27 18:44:14 2005] [warn] module php5_module is already loaded, skipping
    httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    httpd not running, trying to start
    /usr/local/apache2/bin/apachectl: line 78: 22187 Illegal instruction $HTTPD -k $ARGV
    No mysqld pid file found. Looked for /usr/local/mysql/var/jupiter.pid.

    Mainly, my problem is with apache... it doesn't seem to want to start at all. Heres my apachectl. The top line is line 78.
    case $ARGV in
    start|stop|restart|graceful)
    $HTTPD -k $ARGV
    ERROR=$?
    ;;
    startssl|sslstart|start-SSL)
    $HTTPD -k start -DSSL
    ERROR=$?
    ;;
    configtest)
    $HTTPD -t
    ERROR=$?
    ;;
    status)
    $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
    ;;
    fullstatus)
    $LYNX $STATUSURL
    ;;
    *)
    $HTTPD $ARGV
    ERROR=$?
    esac

    exit $ERROR

    Anyone have any idea what's wrong? Fedora Core 3, brand new install, dual pentium iii 500, 1gb ecc ram, wd hard disk (new).

    reply to this comment
    1. this comment inspired admin — #40
    votes: 0 27.03.2005, 23:40:19
  40. [40] admin

    inspired by James — #39 I think you have twice LoadModule php5_module modules/libphp5.so in your httpd.conf, as for the rest, try specify localhost as a ServerName, just for debugging..

    reply to this comment votes: 9 27.03.2005, 23:59:25
  41. [41] James 163.224.204.68.cfl.res.rr.com

    rADo, i did have LoadModule php5... in httpd.conf twice. I removed one of the lines and no longer get an error about php already loaded. However, when I try to start apache, even directly, i still get an illigal instruction.... perhaps I did something wrong when compiling? heres the error:

    /usr/local/apache2/bin/httpd -k start
    Illegal instruction

    and gcc version:
    gcc --ver
    Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.2/specs
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
    Thread model: posix
    gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)

    and my CFLAGS:
    export CFLAGS="-march=pentium3 -mfpmath=sse -msse2 -O2 -pipe -s -fomit-frame-pointer"

    cat /proc/cpuinfo
    processor : 0
    vendor_id : GenuineIntel
    cpu family : 6
    model : 7
    model name : Pentium III (Katmai)
    stepping : 3
    cpu MHz : 501.229
    cache size : 512 KB
    ...

    The only other abnormality during installation was that after compiling php, i issued 'make install', i would get another illigal instruction. A search on google only revealed one result which mentioned that my error was a bug, and to, get this, reboot the system, untar php again, and recompile. to my amazement, it worked, and turned out to be some error with gcc. i have no idea how it worked, or what it did, but perhaps these two problems are related? heres the lines from the php error if they help, and thanx again for your attention.

    [root@jupiter ~]#
    [root@jupiter ~]# cd /usr/local/src/php-5.0.3
    [root@jupiter php-5.0.3]#
    [root@jupiter php-5.0.3]# make install
    Installing PHP SAPI module: apache2handler
    /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
    /usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/
    cp .libs/libphp5.so /usr/local/apache2/modules/libphp5.so
    cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
    libtool: install: warning: remember to run `libtool --finish /usr/local/src/php-5.0.3/libs'
    chmod 755 /usr/local/apache2/modules/libphp5.so
    [activating module `php5' in /usr/local/apache2/conf/httpd.conf]
    Installing PHP CLI binary: /usr/local/bin/
    Installing PHP CLI man page: /usr/local/man/man1/
    Installing PEAR environment: /usr/local/lib/php/
    makeinspired by Seth Buntin — #1: *** [install-pear-installer] Illegal instruction
    make: *** [install-pear] Error 2
    [root@jupiter php-5.0.3]# rm -R *
    rm: remove regular file `acconfig.h'? y
    rm: remove regular file `acconfig.h.in'?
    [root@jupiter php-5.0.3]#

    reply to this comment
    1. this comment inspired admin — #42
    votes: 0 28.03.2005, 05:50:04
  42. [42] admin

    inspired by James — #41 try fine-tuning (=simplify) your EXPORT CFLAGS options, and update your Fedora Core 3 to the latest version of gcc, here's my own yum.conf: http://radekhulan.cz/item/fedora-core-3-pro-lamy-prvotni-instalace...

    reply to this comment votes: 9 28.03.2005, 14:40:23
  43. [43] komaii 81-223-54-182.innsbruck-rum.xdsl-line.inode.at

    Hi Radek,

    would it be okay for you if i translate this documentation to german? If yes let me know.

    thx,
    komaii

    reply to this comment
    1. this comment inspired admin — #44
    votes: 0 25.04.2005, 10:03:37
  44. [44] admin

    inspired by komaii — #43 I'll be glad, just give me the credit in your translation, and link to this (original) article. Thanks :-)

    reply to this comment votes: 9 25.04.2005, 10:51:47
  45. [45] Flatron fibhost-28-86.fibernet.bacs-net.hu

    I did everything as it wrote above, but I get this error:
    "[root@Flatroncomp httpd-2.0.54]# /usr/local/apache2/bin/apachectl start
    Syntax error on line 839 of /usr/local/apache2/conf/httpd.conf:
    Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied"
    That line is: "LoadModule php5_module modules/libphp5.so" I checked, the file is there.

    reply to this comment votes: 0 18.06.2005, 23:54:57
  46. [46] melkor static-151-204-234-210.bos.east.verizon.net

    inspired by Dinh Quang Dan — #21

    Install libjpeg-devel

    reply to this comment votes: 0 30.06.2005, 23:45:39
  47. [47] Marko 195.222.50.74

    THIS IS GODDEST TUTORIAL!

    reply to this comment votes: 0 06.07.2005, 13:21:58
  48. [48] deva 210-210-114-101.lan.sify.net

    Fantastic document. One of the gr8's

    reply to this comment votes: -1 17.07.2005, 10:44:47
  49. [49] komaii 81-223-54-180.innsbruck-rum.xdsl-line.inode.at

    i transtaled this in german with credit from readek.
    here the link:
    http://www.himml.com/komaii/apache-2-0-54-ssl-php-5-0-4-mysql-5.04beta-on-SuSE.html...

    reply to this comment votes: -1 20.07.2005, 10:22:32
  50. [50] MagicTux rrcs-24-123-52-170.central.biz.rr.com

    Execllent howto for LAMP! I've been setting up a new server with PHP 5.0.5, MySQL 4.1.14, Apache 2.0.55 running on Fedora Core3. Your guide really helped. Over the next couple weeks I'll try and submit some possible updates to even expand on your GR8 work.

    reply to this comment votes: 0 19.10.2005, 15:58:09
  51. [51] Etienne 253.139-136-217.adsl.skynet.be

    Hi, first of all wonderfull 'howto' and all going fine, except the install of Nusphere, there I get:

    Configuring for:
    PHP Api Version: 20031224
    Zend Module Api No: 20041030
    Zend Extension Api No: 220040412
    /usr/local/bin/phpize: line 104: aclocal: command not found
    ./deferphpize: line 22: aclocal: command not found
    left default
    ./deferphpize: line 54: ./configure: no such file or directory
    make:*** No targets specified and no makefile found. Stop.

    Can anybody help me with figuring out what I am missing???

    reply to this comment votes: 0 10.11.2005, 11:35:22
  52. [52] Luis Gustavo - BRASIL c906749f.static.spo.virtua.com.br

    Everything works fine, but the installation of php. It says it doesn't find the file libphp5.so
    Here's the error message:
    Syntax error on line 233 of /usr/local/apache2/conf/httpd.conf:
    Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory
    The file is not in the entire system, for I have made a
    locate libphp5.so
    and nothing comes up.
    In /usr/local/apache2/modules/ there are three files:
    httpd.exp libphp5.a libphp5.la
    but the libphp5 is not.
    I would appreciate if you give me a clue here.
    Thanks

    reply to this comment votes: 0 01.12.2005, 22:17:37
  53. [53] Jim Miller adsl-216-103-74-61.miramontes.com

    The solution to the problem with libjpeg.la not being found:

    http://www.libgd.org/FAQ_PHP#How_do_I_get_gd_to_work_with_PHP.3F

    "From 4.3.x, PHP includes its own version of gd, bundled in each PHP release.

    If you compile PHP yourself, it is recommended to use the bundled version of the GD library. It is possible using the following configure line (all features and works with all php versions): ./configure --with-gd -with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr' "

    That is, you don't have to download and install all those packages --just use the ones that seem to come with PHP.

    reply to this comment votes: 1 03.02.2008, 02:11:06
  54. [54] Pawan 202.172.251.227

    thanks a lot for this guide ... i have used it for more than 5 server installation...

    BUT

    i facing a lot of problem in installing php with supporting lib (specially jpeg, png and curl) on a REDHAT with 64 bit kernel...

    please help

    Regards,
    Pawan

    reply to this comment votes: 0 12.03.2008, 09:38:34
  55. [55] Mike cpe-76-175-102-1.socal.res.rr.com

    Great Article.

    I tested the article on a bare-bones install of Debian Etch, PHP 5.2.6, MySQL 5.0, Apache 2.2, and the latest version of all the suggested libraries.

    The only libraries that were missing from the article were ncurses (for mysql 5.0) and liblmx (for php cause it's enabled by default)

    Nice work.

    reply to this comment votes: 0 27.09.2008, 22:16:16
  56. [56] stoka 177.211.244.87.in-addr.arpa

    THX for GR8T HOWTO :)
    jps & orso first and succesfully compiled lamp on centos

    reply to this comment votes: 1 03.11.2008, 20:03:02

Add new comment:

Spam control
New comment