| Install PHP Modules for a FreeBSD Production Web Server |
|
| Sunday, 03 April 2011 | |
|
Let's say we want to build a FreeBSD Production Web Server with a list of php modules that will be installed after we install PHP, Apache and MySQL. Here is a script to do that, very usefull if we will install many servers in the future. So in order to install a FreeBSD Production Web Server we will have to: 1. Install FreeBSD --------------------- Get the last IMAGE of FreeBSD from ftp.freebsd.org. You can use USB version which is easely to install. Install it, then cvsup to the stable version. You can do that using this tutorial: http://www.freebsdonline.com/content/view/460/476/ 2. Install PHP and Appache ----------------------------- cd /usr/ports/www/apache22 make install clean Add the following lines to /usr/local/etc/apache22/httpd.conf (to load index.php and support PHP) (If you already have dir_module section, just add ther index.php) <IfModule dir_module> make install clean Don't forget check APACHE MODULE before compiling, then compile and install, so your Apache would be able to run PHP scripts. You must configure Apache to run PHP. 3. Install MySQL Server and Client ----------------------------------- To install MySQL Server and Client use: cd /usr/ports/databases/mysql51-client make install clean cd /usr/ports/databases/mysql51-server make install clean 4. Install PHP modules -------------------------- Well this is the interesting part of this tutorial. We will use a list of PHP modules, saved in php_modules.conf file. And then we will have a script: compile_php_modules.sh that will do the task of compiling php modules from ports and installing on our system. # ------- php_modules.conf ------------ # php modules php5-bz2 php5-bcmath php5-ctype php5-curl php5-dom php5-extensions php5-filter php5-gd php5-gettext php5-hash php5-iconv php5-json php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-openssl php5-pdo php5-pdo_sqlite php5-posix php5-session php5-simplexml php5-soap php5-sockets php5-sqlite php5-tokenizer php5-xml php5-xmlreader php5-xmlwriter php5-zip php5-zlib # ------- eof php_modules.conf ------- And our script compile_php_modules.sh :
|
|
| Last Updated ( Tuesday, 03 May 2011 ) |
| < Prev | Next > |
|---|
