31
Installing Apache2 and PHP 5.4 from source on Ubuntu 11.10
This guide will show you how to install Apache 2.2 (2.2.21) and PHP 5.4 and MySQL 5.6 from the latest source
First, we will make sure that the development environment and libraries are install on your server
Setup Development Environment tools and libraries
sudo apt-get update
sudo apt-get -y -q install make g++ flex bison build-essential zlib1g-dev binutils cmake
sudo apt-get -y -q install libmcrypt-dev libmhash-dev libxslt1-dev libtidy-dev libbz2-dev libxml2-dev libssl-dev libmysqlclient16 libmysqlclient16-dev
sudo apt-get -y -q install libpng12-dev libpng12-0 libpng3 libjpeg62 libjpeg62-dev libxpm-dev libpcre3 libpcre3-dev zlib1g zlib1g-dev libltdl-dev libltdl7
sudo apt-get -y -q install pkg-config libcurl4-openssl-dev libfreetype6 libfreetype6-dev libc-client2007e libc-client2007e-dev libkrb5-3 libkrb5-dev
sudo apt-get -y -q install openssl libglobus-openssl libglobus-openssl-dev libcurl4-openssl-dev libicu-dev libicu44 libpspell-dev
sudo apt-get -y -q install linux-libc-dev libc-dev-bin libc-bin libc-client2007e-dev eglibc-source libkrb5-3 libkrb5-dev libkrb53 libkrb5support0
sudo apt-get -y -q install libncurses5-dev libncurses5 ncurses-base ncurses-bin ncurses-term libaio-dev
Installing Apache 2.2.21 from source
wget http://apache.mirror.nexicom.net//httpd/httpd-2.2.21.tar.gz
tar zxf httpd-2.2.21.tar.gz cd httpd-2.2.21
./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable-ssl --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so
make -s
sudo make install
sudo mkdir /var/www/
sudo chgrp -R www-data /var/www/
Configure Apache2 to start automatically when system is rebooted
runlevel (should output a number like 2)
cd /etc/rcX.d/ (replace X with the number you saw when you run 'runlevel')
sudo ln -s -T /usr/local/apache2/bin/apachectl S80apache
Easy enough, Apache2 is already installed and ready to serve normal HTML web pages.
You can control the status of the web server with these commands:
Stop the web server
/usr/local/apache2/bin/apachectl stop
Start the web server
/usr/local/apache2/bin/apachectl start
Installing MySQL 5.6 from source
sudo groupadd mysql
sudo useradd -r -g mysql mysql
sudo groupadd mysql
sudo useradd -r -g mysql mysql
sudo mkdir /var/log/mysql/
sudo chgrp -R mysql /var/log/mysql/
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.3-m6.tar.gz/from/http://mirror.csclub.uwaterloo.ca/mysql/
mv index.html mysql.tar.gz
tar zxf mysql.tar.gz
cd mysql-5.6.3-m6/
mkdir bld
cd bld
cmake -DBUILD_CONFIG=mysql_release ..
sudo make install
cd /usr/local/mysql
sudo chown -R mysql .
sudo chgrp -R mysql .
sudo scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql/ –datadir=/usr/local/mysql/data
sudo chown -R root .
sudo chown -R mysql data
sudo cp support-files/my-medium.cnf /etc/my.cnf
sudo cp support-files/mysql.server /etc/init.d/mysql.server
Edit configuration file sudo nano /etc/mysql/my.cnf
under [MYSQLD] edit or add the following lines:
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
to save
to exit
sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &
sudo /usr/local/mysql/bin/mysqladmin -u root password "NEW PASSWORD"
Installing PHP 5.4 from source
wget http://downloads.php.net/stas/php-5.4.0beta2.tar.gz
tar zxf php-5.4.0beta2.tar.gz
cd php-5.4.0beta2/
'./configure' '--disable-short-tags' '--enable-exif' '--with-zlib' '--with-bz2' '--with-openssl' '--with-pcre-regex' '--with-gettext' '--with-mcrypt' '--with-mhash' '--with-iconv' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir' '--with-xpm-dir' '--with-xsl' '--with-tidy' '--with-freetype-dir' '--enable-gd-native-ttf' '--enable-calendar' '--enable-mbstring' '--enable-ftp' '--enable-bcmath' '--enable-sockets' '--enable-dom' '--enable-xml' '--enable-soap' '--enable-libxml' '--enable-session' '--enable-simplexml' '--enable-calendar' '--without-pear' '--enable-mbstring' '--disable-cli' '--with-png-dir=/usr/lib/libpng12.so' '--with-mysql-sock' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' --with-imap-ssl --with-kerberos --with-curl --enable-ftp
make -s
sudo make install
If you want to configure PHP in development mode, run this line:
sudo cp php.ini-development /usr/local/lib/php.ini
If you want to configure PHP in production mode, run this line:
sudo cp php.ini-production /usr/local/lib/php.ini
Configuring Apache2 to run PHP scripts
wget http://apache.parentinginformed.com/httpd/mod_fcgid/mod_fcgid-2.3.6.tar.gz
tar zxf mod_fcgid-2.3.6.tar.gz
cd mod_fcgid-2.3.6
APXS=/usr/local/apache2/bin/apxs ./configure.apxs
make
sudo make install
You also need to edit Apache2 config file
Order allow,deny
Allow from all
AllowOverride All
Options MultiViews Indexes Includes FollowSymLinks ExecCGI
5
Making a perfect DVD rip on Windows
I just posted a new tutorial to show how to RIP a DVD movie (free)
http://lucraymond.net/windows/making-a-perfect-dvd-rip/
12
Build and install APC extension on Mac OSX 10
If you tried to install the APC extension on the MAC and got the following error:
pecl mac error: ‘apc_regex’ has no member named ‘nreg’
The problem is that APC depends on the PCRE library and we need to install it before compiling APC. Here is how to fix it!
- Open a TERMINAL session, type : mkdir temp
- Head up to this page and download a PCRE library (try to use the latest one). I took pcre-8.12.zip, put the file inside the temp directory
- uncompress the PCRE archive via Finder (or any other way)
cd pcre-x.xx replace x with the version number (example: cd pcre-8.12)
./configure
make
sudo make install
- now download the latest APC release (link here)
- uncompress the APC archive via finder (or terminal by typing tar zxf APC-X-XX replace X with archive name and version number )
- type
cd ~/temp/APC-3.1.9 (change the version number if you're using something different)
phpize
./configure
make
sudo make install
you should see something similar to this when it’s done compiling
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files: /usr/include/php/
Modify your php.ini file to have the extension loaded at php startup
- Open /private/etc/php.ini (in Finder, select GO menu, select GO TO FOLDER and type /private/etc)
- add this line in the Dynamic extensions area
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so
Restart the web server (reboot your machine if your lazy, or go into the System preferences, click on Sharing, un-select Web sharing , wait a few seconds and select it again )
You’re done, congrats!
Note:
There is a bug in version APC 3.1.9
if you get error
Fatal error: Unknown: apc_fcntl_unlock failed: in Unknown on line 0
Relax! just modify the file apc_lock.h inside the APC folder you created. Edit the following line around lines 155-160
Find the following:
# define apc_lck_rdunlock(a) apc_fcntl_unlock(&a TSRMLS_CC)
Replace by the following
# define apc_lck_rdunlock(a) apc_fcntl_unlock(a TSRMLS_CC)
Recompile APC by doing:
cd ~/temp/APC-x-xx (replace X with version number) make clean phpize ./configure make sudo make install
And restart your web server! Too easy ! enjoy!
8
Fixing VLC and NVidia color profile
If you have an NVidia card, I recommend you to change a setting on your Nvidia control panel as soon as possible. I was often using VLC to play back movies and was puzzled why the black were pictured as dark grays.
The picture on the left is greyer and the picture on the right has better contrast. The explanation is that the color palette on our generation of video cards are based on 4 color components ranging from 0 to 255. No every screen is able to reproduce the entire color spectrum so it was a normal practice to limit the range to values between 16 and 235. So instead of having a darkest color with a value of 0 (which gives black), you end up having a darkest color with a value of 16 which is dark grey.
You can easily fix this yourself, just go into Windows Control Panel, and click Appearance and Personalization
Click Nvidia Control Panel
Click Adjust Video Color Settings
Click on Advanced
Click on Limited (16-235) next to the Dynamic Range
Change it to Full (0-255)
Click Apply and your done..
You should see a difference if you use a software like VLC. Some software seem to bypass the NVidia control panel and they doesn’t have this issue.
13
Fixing SMB issue with Mac OSX 10.6.3 update
You may have noticed problems when trying to save/write/create/delete stuff on a SMB share after updating your Mac to update 10.6.3. The quick turn around is to edit the smb.conf file (usually find in /etc/samba/smb.conf) and add this line in the [GLOBAL] section:
unix extensions = no
restart samba and it will work again!
to restart SAMBA: /etc/init.d/samba restart
24
how to install Windows 2008 Easy Print sucessfully
If you’re not careful, you may have a few issues trying to use the Easy print feature, read the article for a problem free approach
Click here to read article
http://lucraymond.net/windows/windows-2008-easy-print-terminal-service-how-to-install-without-failure/
24
Building a HD Linux based multimedia streaming server PART 1 – (dvd and bluray and more)
I started a new article to show how to build a HD home entertainment streaming server. If you ever wanted to watch Bluray/DVD from anywhere in your house, this is for you.
You will learn:
- how to setup your network
- setup a server
- stream music
- stream pictures
- stream DVD movies
- stream Bluray movies
- access files and documents across any machines
You can see the first part of the article here :
http://lucraymond.net/linux/building-a-hd-linux-based-multimedia-streaming-server-part-1-dvd-and-bluray-and-more/
9
New linux hard disk performance article
This article talks about how to measure hard disk performance and give a few tips on how to improve it.
You can read the article by clicking here











