Compile Apache on Fedora

Below is a walk-through for compiling Apache 2.2 on Fedora 9. First, download and unpack the source tarball from Apache.org. As of August 2008, the latest version of Apache is 2.2.9 (httpd-2.2.9.tar.gz)

tar -xzvf httpd-2.2.9.tar.gz
cd httpd-2.2.9

Next, configure the source for build. You can provide configure with –help to see the large list of options. The example below enables mod_rewrite, mod_cache, mod_mem_cache and mod_ssl as shared modules in /opt/apache2/modules. Change –prefix to adjust your install PREFIX and adjust the configure options to suit your needs.

./configure --prefix=/opt/apache2 --enable-rewrite=shared --enable-cache=shared --enable-mem-cache=shared --enable-module=so

Now, build and install Apache.

make
sudo make install

Your Apache configuration will be in /opt/apache2/conf and you can control Apache with /opt/apache2/bin/apachectl. Refer to the Apache documentation for more details.

Compile PHP on Fedora

Below is an outline on how to compile a feature rich, PHP Apache module on Fedora 9. First, compile Apache on the system using these instructions. This document assumes that Apache and the APache eXtenSion Tool are installed in the PREFIX: /opt/apache2.

Once you have Apache prepared, download the PHP source from php.net. As of August, 2008 the latest version is PHP 5.2.6. So, the following examples will use the php-5.2.6.tar.gz source tarball. Use your browser to download the latest and greatest. Then, untar the source.

tar -xzvf php-5.2.6.tar.gz
cd php-5.2.6

Next, configure the source for compile. Use the configure command. You can provide –help to see the large list of options.

./configure --help

For every option you enable, make sure you have the necessary RPMs installed to build PHP. For example, if you run configure with –with-snmp, you will need the net-snmp-devel RPM installed to complete the build. To ensure that you can build PHP with a full suite of options, install the following RPMs. Trim the list to suit your needs.

yum install aspell-devel curl-devel cyrus-sasl-devel e2fsprogs-devel freetype-devel glibc-devel keyutils-libs-devel krb5-devel libgcc libidn-devel libjpeg-devel libpng-devel libselinux-devel libsepol-devel libstdc++-devel libX11-devel libXau-devel libXdmcp-devel libxml2-devel libXpm-devel mysql-devel net-snmp-devel openldap-devel openssl-devel tcp_wrappers zlib-devel

Then, configure with the following settings. Change the configure –prefix to adjust your install PREFIX. Again, trim the list to suit your needs.

./configure  --prefix=/opt/php5 --with-apxs2=/opt/apache2/apxs --with-mysql=/usr/bin/mysql_config --with-mysqli=/usr/bin/mysql_config --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --enable-safe-mode --enable-magic-quotes --with-pspell --with-gettext --with-jpeg-dir=/usr  --with-zlib --with-curl --enable-soap --with-ldap=/usr --enable-sockets --with-openssl --with-snmp --enable-mbstring --with-freetype-dir=/usr --with-xpm-dir=/usr --with-libdir=lib64

Please note that if you are on a 32bit system, remove:

--with-libdir=lib64

Finally, build PHP and test it.

make
make test

If you are comfortable with the results (a few errors are OK in make test), then install PHP.

sudo make install

The install will place the PHP module in /opt/apache2/modules and prepare /opt/apache2/conf/httpd.conf with these settings:

LoadModule php5_module        modules/libphp5.so

Then, place a php.ini in /opt/php5/lib (or your PREFIX/lib).

cp -a php.init-recommended /opt/php5/lib/php.ini

Finally, prepare your Apache Virtual Host to support index.php with the following code:

AddType application/x-httpd-php .php .inc .class
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php

Refer to PHP.net and Apache.org for reference.

Fedora 9 Perlcc

As of version 5.10.0-RC2, Perlcc is no longer distributed with Perl. This means that Fedora 9 does not include perlcc. Here is the official statement regarding perlcc from CPAN.org:

Removal of the bytecode compiler and of perlcc

perlcc, the byteloader and the supporting modules (B::C, B::CC, B::Bytecode, etc.) are no longer distributed with the perl sources. Those experimental tools have never worked reliably, and, due to the lack of volunteers to keep them in line with the perl interpreter developments, it was decided to remove them instead of shipping a broken version of those. The last version of those modules can be found with perl 5.9.4.

However the B compiler framework stays supported in the perl core, as with the more useful modules it has permitted (among others, B::Deparse and B::Concise).

Sources
CPAN.org: perldelta – what is new for perl 5.10.0

Fedora 9 NVIDIA

Fedora 9 comes with two drivers that can be used in /etc/X11/xorg.conf to support your Nvidia card.

  1. NV: http://xorg.freedesktop.org/wiki/nv
  2. Nouveau: http://nouveau.freedesktop.org/wiki/

Although these two drivers work, they have their limitations. It is best to install the Nvidia driver from Nvidia.com. You can either build the source from Nvidia’s Driver Website, or use Livna.org to install a binary kernel module.

Livna’s Binary Nvidia Driver

To use Livna.org‘s binary driver, install Livna’s release package for Fedora 9. This will provide you with access to Livna.org’s Fedora 9 YUM repository using /etc/yum.repos.d/livna.repo.

rpm -ivh http://rpm.livna.org/livna-release-9.rpm

Next, install the Nvidia kernel module and all of it’s dependencies:

sudo yum install kmod-nvidia

Then, use the nvidia-xconfig script to configure /etc/X11/xorg.conf. This will configure /etc/X11/xorg.conf with the ‘nvidia’ driver and it’s options.

sudo /usr/sbin/nvidia-xconfig

Finally, reboot your system. You should see the Nvidia driver loading during boot. If you have any X errors, check /var/log/Xorg.log. If you want to tweak your driver, OpenGL or display settings, use nvidia-settings.

sudo /usr/bin/nvidia-settings

Fedora 9 GDM Theme

So, you want to change the theme or background for GDM in Fedora 9 and can’t find gdmsetup? Since GDM is currently being undergoing a rewrite, some functionality from the old version is temporarily missing. You might also find some changes. For instance, gdmsetup no longer exists.

bash$ gdmsetup
-bash: gdmsetup: command not found

The New Way

You can change various GDM parameters as described in the GDM Configuration page. In short, the GDM backend is configured using files in /etc/gdm and the front end uses GConf for most settings. Unfortunately, there is no option (yet!) to change the GDM theme or background.

bash$ ls /etc/gdm/
custom.conf  gdm.schemas  Init  PostLogin  PostSession  PreSession  Xsession
bash$ gconf-editor

Change your GDM Background

Fedora 9 currently displays as a GDM menu with a background that changes depending on the time of day. The XML governing the GDM 2.22 backgrounds and their timing is /usr/share/backgrounds/waves/waves.xml. To change your GDM background, you will need to edit this XML file. I suggest you backup the entire ‘waves’ folder first.

bash# cd /usr/share/backgrounds
bash# cp -a waves waves.orig
bash# cd waves && vim waves.xml

With a custom background installed in /home/foo/background.jpg, the XML can be trimmed to just this:

<background>
<static>
<!-- 24 Hours -->
<duration>86400.00</duration>
<file>
    <size width="800" height="480">/home/foo/background.jpg</size>
    <size width="1280" height="1024">/home/foo/background.jpg</size>
    <size width="1600" height="1200">/home/foo/background.jpg</size>
    <size width="1920" height="1200">/home/foo/background.jpg</size>
</file>
</static>
</background>

Save the file, and restart GDM by logging out of Gnome.

Alternate One Liner

Alternately, Todd Zullinger showed me how to change the background using gconftool-2.
From: https://www.redhat.com/archives/fedora-list/2008-June/msg00323.html

su -c 'gconftool-2 --direct --config-source xml:readwrite:/var/lib/gdm/.gconf -s --type string /desktop/gnome/background/picture_filename /home/foo/background.jpg' gdm

Fedora 9 MP3 Support

Fedora 9 does not release native support for MP3, so you need to get the right bits from another source like rpm.livna.org. First, install Livna’s release package for Fedora 9. This will provide you with access to Livna.org’s Fedora 9 YUM repository using /etc/yum.repos.d/livna.repo.

rpm -ivh http://rpm.livna.org/livna-release-9.rpm

Now, for XMMS MP3 support, install xmms and xmms-mp3

yum install xmms xmms-mp3

For Amarok MP3 support, install amarok and amarok-extras-nonfree.

yum install amarok amarok-extras-nonfree

For xine with MP3 support, install xine and xine-lib-extras-nonfree

yum install xine xine-lib-extras-nonfree

To create MP3s with LAME, install lame and lame-mp3x

yum install lame lame-mp3x

Flash Plugin on Fedora 9

OpenSource Flash Plugins

Fedora 9 features the Open Source Flash player, Swfdec. You can install the Swfdec plugin for Firefox using Yum.

sudo yum install swfdec-mozilla

Fedora 9 also provides Gnash.

sudo yum install gnash-plugin

Install Adobe Flash Using Yum

Alternatively, you can use Adobe’s Flash plugin. To install the Adobe Flash plugin on Fedora 9 visit http://www.adobe.com/products/flashplayer/ and click Download Now. Then select YUM for Linux and download the provided RPM (adobe-release-i386-1.0-1.noarch.rpm).

Install the downloaded RPM which installs /etc/yum.repos.d/adobe-linux-i386.repo.

sudo rpm -i  adobe-release-i386-1.0-1.noarch.rpm 

Check that you can access the Adobe Yum repository.

yum --disablerepo=* --enablerepo=adobe* list

Next, remove the Fedora Swfdec and Gnash plugin to avoid conflicts.

sudo yum remove swfdec-mozilla gnash-plugin

Now, install the Adobe Flash Plugin

sudo yum install flash-plugin

Finally, add the Adobe plugin is in your $HOME/.mozilla/plugins folder.

mkdir -p $HOME/.mozilla/plugins
cd $HOME/.mozilla/plugins
ln -s /usr/lib/flash-plugin/libflashplayer.so .

For Fedora 9 i386, you should be done. If you are running x86_64, read on.

Firefox x86_64 with 32-bit Adobe Flash

The Adobe Flash plugin is not available as an x86_64 package. If you need to run a 64-bit browser, but need Adobe Flash, you can use ndiswrapper to run the 32-bit Adobe Flash plugin on the 64-bit Firefox browser.

First, install Livna’s release package for Fedora 9. This will provide you with access to Livna.org’s Fedora 9 YUM repository using /etc/yum.repos.d/livna.repo.

rpm -ivh http://rpm.livna.org/livna-release-9.rpm

Next, install ndiswrapper from Livna.org.

sudo yum -y install ndiswrapper

Now, install both the i386 and x86_64 packages for nspluginwrapper from Fedora’s YUM repositories

sudo yum -y install nspluginwrapper.{i386,x86_64}

Finally, install the i386 version of libflashsupport and the i386 version of pulseaudio-libs (for flash sound support).

sudo yum -y install pulseaudio-libs.i386 libflashsupport.i386

Sources

fedorasolved.org: Adding the Flash Player Plugin
adobe.com: Adobe – Flash Player: Installation instructions