So here i’m to share, how i use to configure Apache php and MySQL on Fedora’s system, this configuration works fine with all fedora versions above and with core 3. In Tekriti we develop social networking sites (more about me and tekriti) that uses some feature configured with apache and php which are not compiled by default, for example with apache we need mod_rewrite and mod_proxy enabled and with php, soap and gd. When i was new to the system and asked to install the same i was told to compile them rather just to install the rpms, question was why we emphasize on compiling then just configuring yum or something and install rpm with all it’s dependencies with just a single command. I got my answer once i tried to understand, the development going around me based on latest web 2.0, the answer was simple everyone needs their product developed on latest source rather then using some some old if not outdated, services. With rpms it takes hell of efforts to acquire the same latest apache php and mysql then just to compile the latest source.
Ok, enough talking let’s get on to some work..
So at the very first step of this setup one things to keep in mind to avoid any conflict are first mysql and apache should be installed/configured on your system before compiling php. Second If you are going to compile apache, php and mysql rather then to use rpms for mysq and apache and compile the php from source with then (In case of RHEL), then I presume you would uninstall all the rpms for apache php and mysql (rpm -qa | grep http/php/mysql, must result nothing) and you would be setting everything below as a root user. Third, the setups holds good for Apache-2.x, php-5.x and MySQL-5.x with Fedora Core-3 and above, it may differ in other cases. Fourth and the last thing is, i have divided this setup in three sections first Configure MySQL then Configure Apache and in the last section configure php, in present section you will get only MysQL configuration and links to apache configuration and php configuration at the end of the section.
So first download non rmp/tarball of mysql either from
http://dev.mysql.com/downloads/mysql/5.0.htm
or download mysql version 5.0.18 from http://www.greatlinux.com.cn/mysql/Downloads/MySQL-5.0/mysql-standard-5.0.18-linux-i686.tar.gz
- Configuring MYSQL
groupadd mysql
useradd -s /sbin/nologin -g mysql mysql
tar -zxvf mysql-standard-5.0.18-linux-i686.tar.gz
cp -R mysql-standard-5.0.18-linux-i686 /usr/local/mysql-standard
ln -s /usr/local/mysql-standard /usr/local/mysql
cd /usr/local/mysql
scripts/mysql_install_db –user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
bin/mysqld_safe –user=mysql &
mv bin/* /usr/bin/
rm -rf bin
ln -s /usr/bin bin
To start MySQL at system boot :
cp support-files/mysql.server /etc/init.d/mysql.server
chmod 755 /etc/init.d/mysql.server
ln -s /etc/init.d/mysql.server /etc/rc5.d/S98mysql.server
To get mysql> prompt use type mysql -uroot and press enter key, then to Set MySQL root password
mysql > SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘newpwd’); - Configuring Apache
- Configuring PHP