Category archives: Server

How to check if Apache's mod_rewrite is installed? | PHP Snippet

Hi everyone!

This is a snippet (function) that lets you know if the mod_rewrite of Apache is installed on a Web server.

 * Check if Apache's mod_rewrite is installed.
 * @return boolean
function isRewriteMod()
    if (function_exists('apache_get_modules'))
        $aMods = apache_get_modules();
        $bIsRewrite = in_array('mod_rewrite', $aMods);
        $bIsRewrite = (strtolower(getenv('HTTP_MOD_REWRITE')) == 'on');

    return $bIsRewrite;

How to use this?

Very simple, just look this example below:

if (!isRewriteMod()) exit('Please install Apache mod_rewrite module.');

Good code! ;-)

Continue reading

Install MySQL database server

Install MySQL server

1) Download the latest version of MySQL on this page:
and unzip the archive, then you put in the folder.

2) Install MySQL with the following commands in your terminal:

./configure --prefix=/usr/local/mysql
sudo make install

3) Change permissions if necessary (MySQL Directory and database).

4) Check if the MySQL installation was successful by typing this command
mysql -V
You should get a message similar to this one:

mysql  Ver 14.14 Distrib 5.5.28, for Linux (x86_64) using readline 5.1

5) Add a password for ...

Continue reading

Installing an Apache server on Linux OS

Install Apache

Here we will learn how to install an Apache server.
Here are the steps

1) Download the latest version of Apache

2) Extract the archive: tar -jxvf httpd-2.4.3.tar.bz2

3) Now compile and install the Apache source code
Type this: cd httpd-2.4.3/
then create the directory of your Web server's public
sudo mkdir /var/www/
then installing Apache

./configure --prefix=/var/www --enable-module=so --enable-module=rewrite
sudo make && make install

4) Permissions
In general you should do this for the right server for your permission.

cd /var/www/
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

and for the file to be executed ...

Continue reading

Tutorial: Install Red5 on Linux

Tutorial: Install Red5 on Linux

Note: that this installation has been applied in Fedora with "yum", but you can easily do in other Linux distributions with aptitude, apt-get (Ubuntu), ...

1) Install Java JRE: Download Java JRE here:
For me, I chose this version "jre-7u5-linux-i586.rpm"
After, your run this script:
sudo chmod +x jre-7u5-linux-i586.rpm
sudo sh jre-7u5-linux-i586.rpm
Make the same procedure for JDK.
Note: You can also install Java with the command:
sudo yum update
sudo yum install java-package sun-java6-jdk sun-java6-jre subversion ant
2) Download Red5
Get the latest version in SVN: svn ...

Continue reading