![]() |
Configuring PHP5 on Linux |
| Configuring MySQL | |||
|---|---|---|---|
| To compile latest MySQL from source, you may require to upgrade gcc compiler.
N.B. The upgradation process may take over 10 hours. In case you have upgraded gcc do not forget to create the symbolic links given below |
|||
| link /usr/lib/libstdc++.so.6 to /usr/local/lib/libstdc++.so.6 (ln -s /usr/local/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6)
link /lib/libgcc_s.so.1 to /usr/local/lib/libgcc_s.so.1 (ln -s /usr/local/lib/libgcc_s.so.1 /lib/libgcc_s.so.1) |
|||
| Compile & install | |||
| groupadd mysql
useradd -g mysql mysql gunzip < mysql-VERSION.tar.gz | tar -xvf cd mysql-VERSION ./configure --prefix=/usr/local/mysql make make install |
|||
| Configure | |||
| cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql chown -R mysql . chgrp -R mysql . bin/mysql_install_db --user=mysql chown -R root . chown -R mysql var bin/mysqld_safe --user=mysql & |
|||
| For starting/stopping MySQL daemon at boot/shutdown | |||
| cp support-files/mysql.server /etc/init.d/mysqld
ln -s mysqld /etc/rc3.d/S99mysql ln -s mysqld /etc/rc0.d/K01mysql |
|||
| Configuring SSL | |||
| Transfer the source file (openssl-0.9.8g.tar.gz) to /usr/local/src
tar -zxvf openssl-0.9.8g.tar.gz cd openssl-0.9.8g ./configure make make install |
|||
| Configuring Apache | |||
| Transfer the source file (httpd-2.2.6.tar.gz) to /usr/local/src
cd /usr/local/src tar -zxvf httpd-2.2.6.tar.gz cd httpd-2.2.6 ./configure --prefix=/usr/local/apache2 --enable-ssl --with-ssl=/usr/local/ssl --enable-so make make install |
|||
| Configuring PHP | |||
| Before configuring PHP, we need to install many supporting libraries. Some of them are mentioned here | |||
| zlib
cd /usr/local/src tar -zxvf zlib-1.2.1.tar.gz cd zlib-1.2.1 ./configure make make install |
|||
| curl
cd /usr/local/src tar -zxvf curl-7.16.1.tar.tar cd curl-7.16.1 ./configure make make install |
|||
| libxml2
cd /usr/local/src tar -zxvf libxml2-2.6.29.tar.gz cd libxml2-2.6.29 ./configure make make install If any error encounter later while compiling PHP, then add the symbolic link /usr/lib/libxml2.so.2 to the created/available .so file in /usr/lib |
|||
| bzip2
cd /usr/local/src tar -zxvf bzip2-1.0.4.tar.gz cd bzip2-1.0.4 ./configure make make install |
|||
| freetype
cd /usr/local/src tar -jxvf freetype-2.1.9.tar.bz2 cd freetype-2.1.9 ./configure --prefix=/usr/local make make install |
|||
| gd2
cd /usr/local/src tar -zxvf gd-2.0.35.tar.gz cd gd-2.0.35 ./configure make make install |
|||
| libjpeg
cd /usr/local/src tar -zxvf jpegsrc.v6b.tar.gz cd jpeg-6b ./configure --prefix=/usr/local make make install make install-lib |
|||
| libpng
cd /usr/local/src tar -zxvf libpng-1.2.22.tar.gz cd libpng-1.2.22 cp scripts/makefile.linux makefile make make install |
|||
| pdf-lite
cd /usr/local/src tar -zxvf PDFlib-Lite-7.0.2.tar.gz cd PDFlib-Lite-7.0.2 ./configure --prefix=/usr/local/PDFlib make make install |
|||
| php5
cd /usr/local/src tar -zxvf php-5.2.4.tar.gz cd php-5.2.4 If PDFLib to be configured, please carry out the steps in green Create ext/pdf directory under PHP source mkdir ext/pdf cp -R /usr/local/PDFLib/* ext/pdf/ ./buildconf --force ./configure --prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --libdir=/usr/local/php5/lib --enable-bcmath --enable-calendar --enable-fastcgi --enable-ftp --enable-inline-optimization --enable-magic-quotes --enable-mbregex --enable-mbstring --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-zend-multibyte --with-gd --enable-gd-native-ttf --with-png-dir=/usr/local --with-jpeg-dir=/usr/local --with-pdflib=/usr/local/PDFlib --with-bz2 --with-curl --with-freetype-dir==/usr/local --with-gettext --with-iconv --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-mysqli=/usr/local/mysql/bin/mysql_config --with-openssl --without-gdbm --with-pcre-regex --with-pear --with-libxml-dir --with-xmlrpc --with-zlib --enable-dba --with-exec-dir --with-mime-magic --with-ncurses --with-sqlite --with-apxs2=/usr/local/apache2/bin/apxs make make test make install ./libtool --finish /usr/local/src/php-5.2.4/libs mv php.ini-dist /usr/local/php5/lib/php/ Edit the httpd.conf (/usr/local/apache2/conf/httpd.conf) AddHandler php5-script php DirectoryIndex index.html index.php AddType text/html php AddType application/x-httpd-php-source phps |
|||
| Hope the above instructions will help you to configure your web-server. Information compiled by Anisur R Mullick | |||
| More help can be found at http://hulan.info/item/compile-apache-with-ssl-php-5-and-mysql-on-linux | |||
| CVS server | |||
| Install CVS server and configure as below | |||
| Add the file /etc/xinetd.d/cvs
service cvspserver { disable = no socket_type = stream wait = no user = root protocol = tcp port = 2401 server = /usr/bin/cvs server_args = -f --allow-root=/var/cvs_root[CVS ROOT] pserver } |
|||
|