How to Increase PHP File Upload Size Limit

Q. When you try to update the blog post in WordPress or any php application, you might notice that the application such as WordPress has a prohibitive maximum PHP file upload size. How to increase this limit in PHP ? In the below screenshot, i configured my PHP upload size to 50MB.

PHP file upload

A. If you own the virtual private server of dedicated web server, it is very easy to increase this parameter or option. The options can be set in php.ini configuration file, this configuration apply to all your applications. Many shared hosting server allows a maximum PHP file upload size is very low. This method may not work for most shared hosting because you do not give root access. If you plan to receive larger files, you should consider to purchase virtual private server (VPS) or dedicated server hardware.

What is default PHP File Upload Size (upload_max_filesize)?

The default values for PHP will restrict you to a maximum 2 MB upload file size.

Note : Below require you to access the server using root access from the linux server console. The steps has been tested on PHP 5.3 and PHP 5.4.

a) Login to your server via ssh connection.

b) Open php.ini file using vi editor :

# vi /etc/php.ini

There are two PHP configuration options that control the maximum PHP file upload size which are “upload_max_filesize” and “post_max_size”.

By default post_max_size = 8M and upload_max_filesize = 2M. You can update this value to the following :

c) Update this value from 8M to 60M :

post_max_size = 60M

d) Update this value from 2M to 50M :

upload_max_filesize = 50M

Note : Technically, post_max_size should always be greater than upload_max_file size . But for such a large number 150M you can safely make them the same size.

e) After you have made a changes, Then restart your web server to take effect of new PHP file upload size (e.g Apache or Nginx).

You can read more on these posts which explains PHP file upload article.

How to Install IonCube Loader in CentOS 6 / CentOS 7

ioncube loader

What is IonCube Loader ?

IonCube Loader is a PHP module or extension for PHP files decoding encrypted and is often required for many applications based on PHP. It helps us to protect php applications from unauthorized execution and at the same time can accelerate the website. This article will show you how you can install ioncube loader on CentOS 6 and the steps also works on CentOS 7.

1. Check and verify ioncube version :

# php -v
PHP 5.4.33 (cli) (built: Sep 20 2014 16:20:03)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

Your PHP version must match ioncube version :
eg. PHP 5.5 will use file: ioncube_loader_lin_5.5.so
eg. PHP 5.4 will use file: ioncube_loader_lin_5.4.so
eg. PHP 5.3 will use file: ioncube_loader_lin_5.3.so

In this case, php version is PHP 5.4, and the matching ioncube loader version should be ioncube_loader_lin_5.4.so.

2. Create directory for ioncube :

# mkdir /usr/local/ioncube

3. Download and extract the ioncube:

# wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
# tar xzvf ioncube_loaders_lin_x86-64.tar.gz

4. Open the extracted ioncube folder and copy the ioncube loader file match to your php version. :

# cd ioncube
# cp -p ioncube_loader_lin_5.4.so /usr/local/ioncube

5. Now locate php.ini file. This is how you can find location of php.ini.

# php -i| grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

6. Edit php.ini file and save :

# vim /etc/php.ini

Add the following at the bottom of php.ini :

..
..
zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.4.so

7. Verify the php version, it is now should include file “ioncube_loader_lin_5.4.so” in PHP 5.4 if you get the display as below :

# php -v
PHP 5.4.33 (cli) (built: Sep 20 2014 16:20:03)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.

If you can see the version of PHP with ionCube loader version, meaning you have successfully installed and configured ioncube PHP loader in your linux system.

How to Hide PHP Version in Linux

In general, most of the web server software has been installed with default settings that will lead to information leakage. One of them is a PHP software. PHP (Hypertest Preprocessor) is one of the most popular server-side HTML embedded scripting language for the websites today. In the current challenging times, there are lots of attacker will try to discover the weaknesses in your your server system. Hence, i will describe the simple way to hide the PHP information in Linux server.

By default expose_php is set to On. Turning off the “expose_php” parameter causes that PHP will hide it version details.

[root@centos66 ~]# vi /etc/php.ini

In your php.ini, locate the line containing expose_php On and set it to Off:

expose_php = Off

Before the changes, web server header will look like below :

[root@centos66 ~]# curl -I https://webhostinggeeks.com/howto/
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding
X-Powered-By: PHP/5.3.3
X-Pingback: https://webhostinggeeks.com/howto/xmlrpc.php
Date: Wed, 11 Feb 2015 14:10:43 GMT
X-Page-Speed: 1.9.32.2-4321
Cache-Control: max-age=0, no-cache

After the changes, PHP will no longer show the version to the web server header :

[root@centos66 ~]# curl -I https://webhostinggeeks.com/howto/
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 Feb 2015 15:38:14 GMT
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding
X-Pingback: https://webhostinggeeks.com/howto/xmlrpc.php
Date: Wed, 11 Feb 2015 14:10:43 GMT
X-Page-Speed: 1.9.32.2-4321
Cache-Control: max-age=0, no-cache

How to Install LAMP on CentOS 7 / RHEL 7

LAMP stack is a group of open source software that installed together to let you run a web server to host dynamic websites. “L” stand for Linux, “A” stand for Apache (to host Web server), “M” stand for MySQL(to store database) but in RHEL 7, MariaDB will in place of MySQL by default. “P” stand for PHP(to process dynamic content). This brief tutorial will explain how to install LAMP on CentOS 7 / RHEL 7 / Oracle Linux 7.

How to Install LAMP on CentOS 7 / RHEL 7 / Oracle Linux 7

The LAMP stack is just short reference for Linux, Apache, MySQL/MariaDB and PHP :

L = Linux
A = Apache
M = MariaDB /MySQL
P = PHP

If you’re a newbie, these steps can help to install web server and database server on linux operating system. It is very simple to install install LAMP on CentOS 7 / RHEL 7 / Oracle Linux 7. You just need to follow these steps one by one.

1. Install Apache web server, Mariadb database and PHP packages :

When come to the question, how to install web server i ? The answer is very easy,

[root@centos7 ~]# sudo yum install mariadb mariadb-server httpd php php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap -y

2. Start Apache web server and Mariadb database. Make it auto start at boot :

[root@centos7 ~]# sudo systemctl start httpd.service
[root@centos7 ~]# sudo systemctl enable httpd.service
[root@centos7 ~]# sudo systemctl start mariadb
[root@centos7 ~]# sudo systemctl enable mariadb.service

3. Settings for MariaDB.

[root@centos7 ~]# sudo mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 ... Failed!  Not critical, keep moving...
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

4. Browse to your server ip http://IPaddress.

Install LAMP on CentOS 7
Follow the instruction in welcome.conf before proceed to configure the virtual host :

[root@centos7 ~]# vi /etc/httpd/conf.d/welcome.conf

Install LAMP on CentOS 7

5. Configure Apache Virtual host :

a. Create DocumentRoot directory for new domain :

[root@centos7 ~]# mkdir -p /var/www/html/ehowstuff

b. Create vhost.conf to place Name-based virtual host. For example, the default domain is centos7.ehowstuff.local and you wish to add the new virtual host www.ehowstuff.local, which points at the same IP address.

[root@centos7 ~]# vi /etc/httpd/conf.d/vhost.conf

Add the following. Please note that “NameVirtualHost *:80” no longer valid in Apache 2.4.x :

#Create new default domain
<VirtualHost *:80>
   DocumentRoot /var/www/html
   ServerName centos7.ehowstuff.local
</VirtualHost>
# for virtual domain
<VirtualHost *:80>
   DocumentRoot /var/www/html/ehowstuff
   ServerName www.ehowstuff.local
   ServerAdmin webmaster@ehowstuff.local
   ErrorLog logs/www.ehowstuff.local-error_log
   CustomLog logs/www.ehowstuff.local-access_log combined
</VirtualHost>

6. To debug apache configuration :

[root@centos7 ~]# httpd -S
VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server centos7.ehowstuff.local (/etc/httpd/conf.d/vhost.conf:2)
         port 80 namevhost centos7.ehowstuff.local (/etc/httpd/conf.d/vhost.conf:2)
         port 80 namevhost centos7.ehowstuff.local (/etc/httpd/conf.d/vhost.conf:2)
         port 80 namevhost www.ehowstuff.local (/etc/httpd/conf.d/vhost.conf:7)
         port 80 namevhost www.ehowstuff.local (/etc/httpd/conf.d/vhost.conf:7)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

7. To get more information about apache :

[root@centos7 ~]# httpd -V
Server version: Apache/2.4.6 (CentOS)
Server built:   Jan 12 2015 13:22:31
Server's Module Magic Number: 20120211:23
Server loaded:  APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

8. Check php version :

[root@centos7 ~]# php -v
PHP 5.4.16 (cli) (built: Oct 31 2014 12:59:36)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Install LAMP on CentOS 7

I hope this article gives you some ideas and essential guidance on how to install LAMP on CentOS 7 / RHEL 7 / Oracle Linux 7.

 

How to Install and Configure Apache2, PHP and MySQL 5.6 on Ubuntu 14.04

LAMP stack is a group of open source software that installed together to let you run a server to host dynamic websites. “L” stand for Linux, “A” stand for Apache (to host Web server), “M” stand for MySQL(to store database) and “P” stand for PHP(to process dynamic content). With the release of Ubuntu 14.04 on April 17 2014, i would share the steps to setup Apache2, PHP and MySQL on Ubuntu 14.04 in order to run a dynamic websites. This may useful for those who plan to run their websites on Virtual private server (VPS) or dedicated server.

1. Install Apache2, MySQL and PHP :

ehowstuff@ubuntu14:~$ sudo apt-get install apache2 php5 php5-cgi libapache2-mod-php5 php5-common php-pear mysql-server-5.6 -y

During this installation, you will require to set MySQL’s root password :
1

2

2. Backup the original Apache2 configuration file :

ehowstuff@ubuntu14:~$ sudo cp -p /etc/apache2/conf-enabled/security.conf /etc/apache2/conf-enabled/security.conf.bak

3. Open security.conf and modify the OS to become Prod. For security reason, Prod will tells apache to only return Apache in the Server header, returned on every page request.

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/conf-enabled/security.conf
..
..
ServerTokens Prod
..
..
ServerSignature Off
..
..

4. Add file extension that can be access :

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
        DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

5. Specify server name :

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/apache2.conf
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
ServerName ubuntu14.ehowstuff.local
#
# The accept se

6. Specify webmaster’s email :

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/sites-enabled/000-default.conf

        ServerAdmin webmaster@ubuntu14.ehowstuff.local
        DocumentRoot /var/www/html

7. Restart web server apache2 :

ehowstuff@ubuntu14:~$ sudo /etc/init.d/apache2 restart
 * Restarting web server apache2                                                             [ OK ]

8. Near line 220: add extension for PHP :

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/mods-enabled/mime.conf
..
..
AddHandler php5-script .php
..
..

9. Comment and add your timezone :

ehowstuff@ubuntu14:~$ sudo vi /etc/php5/apache2/php.ini
..
..
date.timezone = "Asia/Kuala Lumpur"
..
..

After change php.ini, restart the apache :

ehowstuff@ubuntu14:~$ sudo /etc/init.d/apache2 restart
 * Restarting web server apache2                                                             [ OK ]

10. Connect to MySQL :

ehowstuff@ubuntu14:~$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.6.17-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

11. Show user info :

mysql> select user,host,password from mysql.user;
+------------------+-----------+-------------------------------------------+
| user             | host      | password                                  |
+------------------+-----------+-------------------------------------------+
| root             | localhost | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | ubuntu14  | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | 127.0.0.1 | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | ::1       | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| debian-sys-maint | localhost | *9C063813F4CC3C2E09995B0D043C7375C5E5538A |
+------------------+-----------+-------------------------------------------+
5 rows in set (0.00 sec)

12. Show databases :

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.01 sec)

Done!!

Install MySQL, Apache and PHP on CentOS 6.5

LAMP stand for Linux, Apache, MySQL and PHP which is group of software used to run an web applications. The combination of these software is called LAMP stack. This document will walk you through the steps to install MySQL, Apache and PHP on CentOS 6.5.


What is Apache ?

Apache httpd is one of the most popular web servers and has a lot of features that make it very extensible and useful for many different types of websites.

What is MySQL?
MySQL Database server is one of the most popular used database in the internet especially for content management and blogging site.

What is PHP?
PHP is a widely-used and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML.

Steps :
1. Install MySQL, Apache and PHP :

[root@centos6-05 ~]# yum install mysql mysql-server httpd php* -y

2. Start Apache and MySQL :

[root@centos6-05 ~]# service httpd start
[root@centos6-05 ~]# service mysqld start

3. Check Apache, MySQL and PHP version :
Apache

[root@centos6-05 ~]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Aug 13 2013 17:29:28

MySQL

[root@centos6-05 ~]# mysql -V
mysql  Ver 14.14 Distrib 5.1.71, for redhat-linux-gnu (x86_64) using readline 5.1

PHP

[root@centos6-05 ~]# php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

4. Verifying Apache, MySQL and PHP :

Create a page called phpinfo.php under web root directory /var/www/html.

[root@centos6-05 ~]# vi /var/www/html/index.php
<?php

     phpinfo ();
?>

Restart Apache :

[root@centos6-05 ~]# service httpd restart

php-info

How to Fix “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”

Issue :

When i try to install WordPress, I’ve encountered this error and returned the following warning on browser :

“Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”

Solution :

The reason for this is your existing PHP does not support mysql or php-mysql extension does not installed. To overcome this issue, just install php mysql support using below command on your virtual private server (VPS) or your dedicated web server.
1. Install php with mysql extension :

yum install php-mysql -y

2. Restart httpd :

[root@centos64 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Example :

[root@centos64 html]# yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.upsi.edu.my
 * epel: ftp.cuhk.edu.hk
 * extras: mirror.upsi.edu.my
 * updates: mirror.upsi.edu.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: php-pdo(x86-64) for package: php-mysql-5.3.3-22.el6.x86_64
--> Running transaction check
---> Package php-pdo.x86_64 0:5.3.3-22.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                 Arch                 Version                      Repository          Size
====================================================================================================
Installing:
 php-mysql               x86_64               5.3.3-22.el6                 base                81 k
Installing for dependencies:
 php-pdo                 x86_64               5.3.3-22.el6                 base                75 k

Transaction Summary
====================================================================================================
Install       2 Package(s)

Total download size: 155 k
Installed size: 383 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): php-mysql-5.3.3-22.el6.x86_64.rpm                                     |  81 kB     00:00
(2/2): php-pdo-5.3.3-22.el6.x86_64.rpm                                       |  75 kB     00:00
----------------------------------------------------------------------------------------------------
Total                                                               137 kB/s | 155 kB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-pdo-5.3.3-22.el6.x86_64                                                      1/2
  Installing : php-mysql-5.3.3-22.el6.x86_64                                                    2/2
  Verifying  : php-pdo-5.3.3-22.el6.x86_64                                                      1/2
  Verifying  : php-mysql-5.3.3-22.el6.x86_64                                                    2/2

Installed:
  php-mysql.x86_64 0:5.3.3-22.el6

Dependency Installed:
  php-pdo.x86_64 0:5.3.3-22.el6

Complete!

Securing and Hardening Linux Dedicated Server

securing linuxWhen we hosted the linux dedicated server or virtual private server(VPS) in a data center, security of the system is very important in order to ensure the data and the information are safe from the hackers. Securing and hardening linux dedicated server is mandatory when nearly every computing resources and the application systems is online and susceptible to attack. This post share basic security and hardening tips for the linux dedicated server. If you are plan to host your own linux dedicated server, then this post should able to provide you a good baseline and ideas. The following are the best practices to securing and hardening linux dedicated server :

1. Patching Linux Systems
2. Keep Linux Kernel and Software such as WordPress/Joomla Up to Date
3. Secure SSH
4. Enforcing Stronger Passwords and Password Aging
5. Disable Unnecessary Processes, Services and Daemons
6. Install a host based firewall to protect your dedicated server from unauthorized access
7. Implement Linux Kernel /etc/sysctl.conf hardening
8. Configure Logging and Auditing
9. Install And Use Intrusion Detection System

9 Steps to Setup Dedicated Server for your Website

dedicated serverThere are different types of hosting services are used in the computer technology such as shared hosting, VPS (Virtual Private Server) and Dedicated Server hosting. For new websites with low numbers of visitors, I would highly recommend getting a shared hosting. If you need more control of the server, then you should moving from shared hosting to a VPS. There are plenty of hosting companies offering Virtual Private Servers, and VPS hosting is getting cheaper. This blog hosted at RamNode VPS.

At some point, your site will get super slow server performance impact on limited resources when running VPS hosting. More server resources required is due to the increased number of visitors to the tens of thousands or hundreds of thousands per day.

At the situation when you are hitting super slow website performance due to huge numbers of traffic, I would recommend you to getting dedicated servers. Cheaper way is to setup VPS additional to balance the load. If cost is not an issue, I always recommend you to purchase a dedicated server as this will give you excellent processing performance. In a dedicated server environment , resources such as memory , hard drive storage capacity, processing power, and network access are all 100% to dedicated servers instead of shared with multiple VPS or dozens of shared hosting customers. Popular websites on the Internet certainly have excellent servers behind them. Without such an excellent server, web sites with high concurrency of visitors will not be able to survive.

If you are an experienced system administrator, the following articles may not attract you, but for web developers and those new to the web hosting, the following article can be a useful guide on their first steps. I believe the popular website on the internet has been setup by a consultant who specializes in servers or installed by an experienced system administrator. In this article, I would like to share 9 steps to setup Dedicated Server for your Website.

Once you have purchased a dedicated server, you can log in to your server to complete the setup of your server from start to finish. Below is a guide and checklist for you who are new to server administration.

9 Steps to Setup Dedicated Server

1. Choose and Install Linux operating system :

Choosing the right platform on which to host your dedicated server. Please make sure that you are familiar with the preferred operating system (OS) either CentOS or Fedora or Ubuntu or maybe Windows OS. If you choose linux OS, I would recommend you to do a clean minimal installed of the OS.

2. Update operating system :

Make sure that the OS has been applied the latest patches.
How to Update CentOS 6.4 System using ‘yum update’

3. Install Apache or Nginx Web server :

Apache httpd is one of the most popular web servers and has a lot of features that make it very extensible and useful for many different types of websites. As an alternative to Apache http server, you also can install NGINX. Nginx or “engine x” is a free, open-source HTTP server that provide high-performance edge web server with the lowest memory footprint and the key features to build modern and efficient web infrastructure. I used Nginx to run this blog.

How to Setup Nginx With PHP-FastCGI on CentOS 6.2/CentOS 6.3 VPS Server

4. Install MySQL Database server :

MySQL server is a database server that can stores and retrieves data for the blog, websites and applications. It is one of the most popular most used in the internet especially for content management and blogging site.

5. Install PHP :

PHP: Hypertext Preprocessor is a widely used, free and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML.

6. Install Bind DNS server :

BIND (the Berkeley Internet Name Domain) also known as NAMED is the most widely used DNS server in the internet. Bind DNS helps to resolve domain name to ip address and ip address to domain name.

7. Install FTP server :

File Transfer Protocol (FTP) is a network protocol used transfer file in the network. one of the most popular FTP server for Unix/Linux is vsftpd. Vsftpd stand for Very Secure FTP Daemon. Vsftpd not only just another popular FTP server for Unix/Linux systems, but vsftpd delivers excellent performance by consuming less memory.

8. Harden and Secure the dedicated server :

There are a few steps to harden the OS of dedicated server.
a) Install a host based firewall to protect your dedicated server from unauthorized access:
Once you have your web server running, you have to install host based firewall and open only certain port in your firewall. I would recommend you tosetting up iptables on your linux dedicated server.

b) Use Strong passwords :
Password complexity requirements should be in place to enforce strong password. A strong password should have mixed case, special characters, numbers, and be longer than 8 characters. Additional security, the passwords should be changed regularly.

c) Disable Unnecessary Processes, Services and Daemons :
I would recommend you to disable unneeded processes,services and daemon such as bluetooth, hidd, cups, yum-updatesd, ypbind, nfs, snmpd, saslauthd, netfs, gpm, pcmcia and sendmail. SELinux also should be set to “Disabled”. This is still very experimental so I would leave this disabled unless you really know what you are doing.

9. Install or migrate over the content of your website or blog :

You can start to migrate over the content of your website or blog to your new dedicated server. For dynamic content blog, i would recommend you to use WordPress as a platform. WordPress is an open-source blogging platform. It’s a free blogging tool and content management system (CMS) based on PHP and MySQL.

I hope that this 9 steps to setup dedicated server can be a useful guide on your first steps to have your own dedicated server to run a websites.

How to Install and Configure PHP 5.3.3 on CentOS 6.4

phpPHP is a widely-used and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML. PHP applications are commonly found with the filename extensions .php, .php4, or .php5. You can read more information about PHP from their website at www.php.net. The following step will install full PHP package.

1. Install PHP using yum command :

[root@centos64 ~]# yum install php* -y

Example :

[root@centos64 ~]# yum install php* -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.3.3-22.el6.x86_64
--> Processing Dependency: httpd for package: php-5.3.3-22.el6.x86_64
---> Package php-bcmath.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-cli.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-common.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-dba.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-devel.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: automake for package: php-devel-5.3.3-22.el6.x86_64
--> Processing Dependency: autoconf for package: php-devel-5.3.3-22.el6.x86_64
---> Package php-embedded.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-enchant.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libenchant.so.1()(64bit) for package: php-enchant-5.3.3-22.el6.x86_64
---> Package php-fpm.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-gd.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpng12.so.0(PNG12_0)(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libpng12.so.0()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libfreetype.so.6()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
---> Package php-imap.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libc-client.so.2007()(64bit) for package: php-imap-5.3.3-22.el6.x86_64
---> Package php-intl.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libicuuc.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicuio.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicui18n.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicudata.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
---> Package php-ldap.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-mbstring.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-mysql.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-odbc.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libodbc.so.2()(64bit) for package: php-odbc-5.3.3-22.el6.x86_64
---> Package php-pdo.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-pear.noarch 1:1.9.4-4.el6 will be installed
---> Package php-pecl-apc.x86_64 0:3.1.9-2.el6 will be installed
---> Package php-pecl-apc-devel.x86_64 0:3.1.9-2.el6 will be installed
---> Package php-pecl-memcache.x86_64 0:3.0.5-4.el6 will be installed
---> Package php-pgsql.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpq.so.5()(64bit) for package: php-pgsql-5.3.3-22.el6.x86_64
---> Package php-process.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-pspell.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpspell.so.15()(64bit) for package: php-pspell-5.3.3-22.el6.x86_64
--> Processing Dependency: libaspell.so.15()(64bit) for package: php-pspell-5.3.3-22.el6.x86_64
---> Package php-recode.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: librecode.so.0()(64bit) for package: php-recode-5.3.3-22.el6.x86_64
---> Package php-snmp.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: net-snmp for package: php-snmp-5.3.3-22.el6.x86_64
--> Processing Dependency: libnetsnmp.so.20()(64bit) for package: php-snmp-5.3.3-22.el6.x86_64
---> Package php-soap.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-tidy.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libtidy-0.99.so.0()(64bit) for package: php-tidy-5.3.3-22.el6.x86_64
---> Package php-xml.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml-5.3.3-22.el6.x86_64
---> Package php-xmlrpc.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-zts.x86_64 0:5.3.3-22.el6 will be installed
--> Running transaction check
---> Package aspell.x86_64 12:0.60.6-12.el6 will be installed
---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
---> Package automake.noarch 0:1.11.1-4.el6 will be installed
---> Package enchant.x86_64 1:1.5.0-4.el6 will be installed
--> Processing Dependency: libhunspell-1.2.so.0()(64bit) for package: 1:enchant-1.5.0-4.el6.x86_64
---> Package freetype.x86_64 0:2.3.11-14.el6_3.1 will be installed
---> Package httpd.x86_64 0:2.2.15-26.el6.centos will be installed
--> Processing Dependency: httpd-tools = 2.2.15-26.el6.centos for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-26.el6.centos.x86_64
---> Package libX11.x86_64 0:1.5.0-4.el6 will be installed
--> Processing Dependency: libX11-common = 1.5.0-4.el6 for package: libX11-1.5.0-4.el6.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.5.0-4.el6.x86_64
---> Package libXpm.x86_64 0:3.5.10-2.el6 will be installed
---> Package libc-client.x86_64 0:2007e-11.el6 will be installed
---> Package libicu.x86_64 0:4.2.1-9.1.el6_2 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.1-1.el6 will be installed
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be installed
---> Package libtidy.x86_64 0:0.99.0-19.20070615.1.el6 will be installed
---> Package libxslt.x86_64 0:1.1.26-2.el6_3.1 will be installed
---> Package net-snmp.x86_64 1:5.5-44.el6 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-5.5-44.el6.x86_64
---> Package net-snmp-libs.x86_64 1:5.5-44.el6 will be installed
---> Package postgresql-libs.x86_64 0:8.4.13-1.el6_3 will be installed
---> Package recode.x86_64 0:3.6-28.1.el6 will be installed
---> Package unixODBC.x86_64 0:2.2.14-12.el6_3 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.2.14-12.el6_3.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-26.el6.centos will be installed
---> Package hunspell.x86_64 0:1.2.8-16.el6 will be installed
---> Package libX11-common.noarch 0:1.5.0-4.el6 will be installed
---> Package libtool-ltdl.x86_64 0:2.2.6-15.5.el6 will be installed
---> Package libxcb.x86_64 0:1.8.1-1.el6 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.8.1-1.el6.x86_64
---> Package lm_sensors-libs.x86_64 0:3.1.1-17.el6 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
--> Running transaction check
---> Package libXau.x86_64 0:1.0.6-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
 Package                       Arch              Version                             Repository          Size
==============================================================================================================
Installing:
 php                           x86_64            5.3.3-22.el6                        base               1.1 M
 php-bcmath                    x86_64            5.3.3-22.el6                        base                34 k
 php-cli                       x86_64            5.3.3-22.el6                        base               2.2 M
 php-common                    x86_64            5.3.3-22.el6                        base               524 k
 php-dba                       x86_64            5.3.3-22.el6                        base                40 k
 php-devel                     x86_64            5.3.3-22.el6                        base               507 k
 php-embedded                  x86_64            5.3.3-22.el6                        base               1.1 M
 php-enchant                   x86_64            5.3.3-22.el6                        base                28 k
 php-fpm                       x86_64            5.3.3-22.el6                        base               1.1 M
 php-gd                        x86_64            5.3.3-22.el6                        base               106 k
 php-imap                      x86_64            5.3.3-22.el6                        base                50 k
 php-intl                      x86_64            5.3.3-22.el6                        base                70 k
 php-ldap                      x86_64            5.3.3-22.el6                        base                38 k
 php-mbstring                  x86_64            5.3.3-22.el6                        base               455 k
 php-mysql                     x86_64            5.3.3-22.el6                        base                81 k
 php-odbc                      x86_64            5.3.3-22.el6                        base                50 k
 php-pdo                       x86_64            5.3.3-22.el6                        base                75 k
 php-pear                      noarch            1:1.9.4-4.el6                       base               393 k
 php-pecl-apc                  x86_64            3.1.9-2.el6                         base                96 k
 php-pecl-apc-devel            x86_64            3.1.9-2.el6                         base               6.7 k
 php-pecl-memcache             x86_64            3.0.5-4.el6                         base                60 k
 php-pgsql                     x86_64            5.3.3-22.el6                        base                70 k
 php-process                   x86_64            5.3.3-22.el6                        base                39 k
 php-pspell                    x86_64            5.3.3-22.el6                        base                28 k
 php-recode                    x86_64            5.3.3-22.el6                        base                25 k
 php-snmp                      x86_64            5.3.3-22.el6                        base                30 k
 php-soap                      x86_64            5.3.3-22.el6                        base               139 k
 php-tidy                      x86_64            5.3.3-22.el6                        base                35 k
 php-xml                       x86_64            5.3.3-22.el6                        base               103 k
 php-xmlrpc                    x86_64            5.3.3-22.el6                        base                52 k
 php-zts                       x86_64            5.3.3-22.el6                        base               1.2 M
Installing for dependencies:
 apr                           x86_64            1.3.9-5.el6_2                       base               123 k
 apr-util                      x86_64            1.3.9-3.el6_0.1                     base                87 k
 apr-util-ldap                 x86_64            1.3.9-3.el6_0.1                     base                15 k
 aspell                        x86_64            12:0.60.6-12.el6                    base               648 k
 autoconf                      noarch            2.63-5.1.el6                        base               781 k
 automake                      noarch            1.11.1-4.el6                        base               550 k
 enchant                       x86_64            1:1.5.0-4.el6                       base                49 k
 freetype                      x86_64            2.3.11-14.el6_3.1                   updates            359 k
 httpd                         x86_64            2.2.15-26.el6.centos                base               821 k
 httpd-tools                   x86_64            2.2.15-26.el6.centos                base                72 k
 hunspell                      x86_64            1.2.8-16.el6                        base               177 k
 libX11                        x86_64            1.5.0-4.el6                         base               584 k
 libX11-common                 noarch            1.5.0-4.el6                         base               192 k
 libXau                        x86_64            1.0.6-4.el6                         base                24 k
 libXpm                        x86_64            3.5.10-2.el6                        base                51 k
 libc-client                   x86_64            2007e-11.el6                        base               515 k
 libicu                        x86_64            4.2.1-9.1.el6_2                     base               4.9 M
 libjpeg-turbo                 x86_64            1.2.1-1.el6                         base               174 k
 libpng                        x86_64            2:1.2.49-1.el6_2                    base               182 k
 libtidy                       x86_64            0.99.0-19.20070615.1.el6            base               127 k
 libtool-ltdl                  x86_64            2.2.6-15.5.el6                      base                44 k
 libxcb                        x86_64            1.8.1-1.el6                         base               110 k
 libxslt                       x86_64            1.1.26-2.el6_3.1                    base               452 k
 lm_sensors-libs               x86_64            3.1.1-17.el6                        base                38 k
 mailcap                       noarch            2.1.31-2.el6                        base                27 k
 net-snmp                      x86_64            1:5.5-44.el6                        base               303 k
 net-snmp-libs                 x86_64            1:5.5-44.el6                        base               1.5 M
 postgresql-libs               x86_64            8.4.13-1.el6_3                      base               200 k
 recode                        x86_64            3.6-28.1.el6                        base               712 k
 unixODBC                      x86_64            2.2.14-12.el6_3                     base               378 k

Transaction Summary
==============================================================================================================
Install      61 Package(s)

Total download size: 24 M
Installed size: 82 M
Downloading Packages:
(1/61): apr-1.3.9-5.el6_2.x86_64.rpm                                                   | 123 kB     00:02
(2/61): apr-util-1.3.9-3.el6_0.1.x86_64.rpm                                            |  87 kB     00:00
(3/61): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm                                       |  15 kB     00:00
(4/61): aspell-0.60.6-12.el6.x86_64.rpm                                                | 648 kB     00:08
(5/61): autoconf-2.63-5.1.el6.noarch.rpm                                               | 781 kB     00:06
(6/61): automake-1.11.1-4.el6.noarch.rpm                                               | 550 kB     00:06
(7/61): enchant-1.5.0-4.el6.x86_64.rpm                                                 |  49 kB     00:00
(8/61): freetype-2.3.11-14.el6_3.1.x86_64.rpm                                          | 359 kB     00:04
(9/61): httpd-2.2.15-26.el6.centos.x86_64.rpm                                          | 821 kB     00:18
(10/61): httpd-tools-2.2.15-26.el6.centos.x86_64.rpm                                   |  72 kB     00:00
(11/61): hunspell-1.2.8-16.el6.x86_64.rpm                                              | 177 kB     00:01
(12/61): libX11-1.5.0-4.el6.x86_64.rpm                                                 | 584 kB     00:10
(13/61): libX11-common-1.5.0-4.el6.noarch.rpm                                          | 192 kB     00:01
(14/61): libXau-1.0.6-4.el6.x86_64.rpm                                                 |  24 kB     00:00
(15/61): libXpm-3.5.10-2.el6.x86_64.rpm                                                |  51 kB     00:00
(16/61): libc-client-2007e-11.el6.x86_64.rpm                                           | 515 kB     00:05
(17/61): libicu-4.2.1-9.1.el6_2.x86_64.rpm                                             | 4.9 MB     00:54
(18/61): libjpeg-turbo-1.2.1-1.el6.x86_64.rpm                                          | 174 kB     00:02
(19/61): libpng-1.2.49-1.el6_2.x86_64.rpm                                              | 182 kB     00:01
(20/61): libtidy-0.99.0-19.20070615.1.el6.x86_64.rpm                                   | 127 kB     00:01
(21/61): libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm                                        |  44 kB     00:00
(22/61): libxcb-1.8.1-1.el6.x86_64.rpm                                                 | 110 kB     00:00
(23/61): libxslt-1.1.26-2.el6_3.1.x86_64.rpm                                           | 452 kB     00:03
(24/61): lm_sensors-libs-3.1.1-17.el6.x86_64.rpm                                       |  38 kB     00:01
(25/61): mailcap-2.1.31-2.el6.noarch.rpm                                               |  27 kB     00:00
(26/61): net-snmp-5.5-44.el6.x86_64.rpm                                                | 303 kB     00:03
(27/61): net-snmp-libs-5.5-44.el6.x86_64.rpm                                           | 1.5 MB     00:17
(28/61): php-5.3.3-22.el6.x86_64.rpm                                                   | 1.1 MB     00:11
(29/61): php-bcmath-5.3.3-22.el6.x86_64.rpm                                            |  34 kB     00:00
(30/61): php-cli-5.3.3-22.el6.x86_64.rpm                                               | 2.2 MB     00:24
(31/61): php-common-5.3.3-22.el6.x86_64.rpm                                            | 524 kB     00:07
(32/61): php-dba-5.3.3-22.el6.x86_64.rpm                                               |  40 kB     00:00
(33/61): php-devel-5.3.3-22.el6.x86_64.rpm                                             | 507 kB     00:04
(34/61): php-embedded-5.3.3-22.el6.x86_64.rpm                                          | 1.1 MB     00:10
(35/61): php-enchant-5.3.3-22.el6.x86_64.rpm                                           |  28 kB     00:00
(36/61): php-fpm-5.3.3-22.el6.x86_64.rpm                                               | 1.1 MB     00:11
(37/61): php-gd-5.3.3-22.el6.x86_64.rpm                                                | 106 kB     00:00
(38/61): php-imap-5.3.3-22.el6.x86_64.rpm                                              |  50 kB     00:01
(39/61): php-intl-5.3.3-22.el6.x86_64.rpm                                              |  70 kB     00:00
(40/61): php-ldap-5.3.3-22.el6.x86_64.rpm                                              |  38 kB     00:00
(41/61): php-mbstring-5.3.3-22.el6.x86_64.rpm                                          | 455 kB     00:05
(42/61): php-mysql-5.3.3-22.el6.x86_64.rpm                                             |  81 kB     00:00
(43/61): php-odbc-5.3.3-22.el6.x86_64.rpm                                              |  50 kB     00:00
(44/61): php-pdo-5.3.3-22.el6.x86_64.rpm                                               |  75 kB     00:00
(45/61): php-pear-1.9.4-4.el6.noarch.rpm                                               | 393 kB     00:12
(46/61): php-pecl-apc-3.1.9-2.el6.x86_64.rpm                                           |  96 kB     00:00
(47/61): php-pecl-apc-devel-3.1.9-2.el6.x86_64.rpm                                     | 6.7 kB     00:00
(48/61): php-pecl-memcache-3.0.5-4.el6.x86_64.rpm                                      |  60 kB     00:00
(49/61): php-pgsql-5.3.3-22.el6.x86_64.rpm                                             |  70 kB     00:00
(50/61): php-process-5.3.3-22.el6.x86_64.rpm                                           |  39 kB     00:00
(51/61): php-pspell-5.3.3-22.el6.x86_64.rpm                                            |  28 kB     00:00
(52/61): php-recode-5.3.3-22.el6.x86_64.rpm                                            |  25 kB     00:00
(53/61): php-snmp-5.3.3-22.el6.x86_64.rpm                                              |  30 kB     00:00
(54/61): php-soap-5.3.3-22.el6.x86_64.rpm                                              | 139 kB     00:01
(55/61): php-tidy-5.3.3-22.el6.x86_64.rpm                                              |  35 kB     00:00
(56/61): php-xml-5.3.3-22.el6.x86_64.rpm                                               | 103 kB     00:00
(57/61): php-xmlrpc-5.3.3-22.el6.x86_64.rpm                                            |  52 kB     00:00
(58/61): php-zts-5.3.3-22.el6.x86_64.rpm                                               | 1.2 MB     00:17
(59/61): postgresql-libs-8.4.13-1.el6_3.x86_64.rpm                                     | 200 kB     00:01
(60/61): recode-3.6-28.1.el6.x86_64.rpm                                                | 712 kB     00:06
(61/61): unixODBC-2.2.14-12.el6_3.x86_64.rpm                                           | 378 kB     00:02
--------------------------------------------------------------------------------------------------------------
Total                                                                          82 kB/s |  24 MB     04:56
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-common-5.3.3-22.el6.x86_64                                                            1/61
  Installing : php-pdo-5.3.3-22.el6.x86_64                                                               2/61
  Installing : apr-1.3.9-5.el6_2.x86_64                                                                  3/61
  Installing : apr-util-1.3.9-3.el6_0.1.x86_64                                                           4/61
  Installing : php-cli-5.3.3-22.el6.x86_64                                                               5/61
  Installing : 1:php-pear-1.9.4-4.el6.noarch                                                             6/61
  Installing : lm_sensors-libs-3.1.1-17.el6.x86_64                                                       7/61
  Installing : 1:net-snmp-libs-5.5-44.el6.x86_64                                                         8/61
  Installing : autoconf-2.63-5.1.el6.noarch                                                              9/61
  Installing : automake-1.11.1-4.el6.noarch                                                             10/61
  Installing : 1:net-snmp-5.5-44.el6.x86_64                                                             11/61
  Installing : php-pecl-apc-3.1.9-2.el6.x86_64                                                          12/61
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                     13/61
  Installing : httpd-tools-2.2.15-26.el6.centos.x86_64                                                  14/61
  Installing : libXau-1.0.6-4.el6.x86_64                                                                15/61
  Installing : libxcb-1.8.1-1.el6.x86_64                                                                16/61
  Installing : libX11-common-1.5.0-4.el6.noarch                                                         17/61
  Installing : libX11-1.5.0-4.el6.x86_64                                                                18/61
  Installing : libXpm-3.5.10-2.el6.x86_64                                                               19/61
  Installing : postgresql-libs-8.4.13-1.el6_3.x86_64                                                    20/61
  Installing : mailcap-2.1.31-2.el6.noarch                                                              21/61
  Installing : httpd-2.2.15-26.el6.centos.x86_64                                                        22/61
  Installing : php-5.3.3-22.el6.x86_64                                                                  23/61
  Installing : php-devel-5.3.3-22.el6.x86_64                                                            24/61
  Installing : 2:libpng-1.2.49-1.el6_2.x86_64                                                           25/61
  Installing : libxslt-1.1.26-2.el6_3.1.x86_64                                                          26/61
  Installing : libtool-ltdl-2.2.6-15.5.el6.x86_64                                                       27/61
  Installing : unixODBC-2.2.14-12.el6_3.x86_64                                                          28/61
  Installing : libicu-4.2.1-9.1.el6_2.x86_64                                                            29/61
  Installing : recode-3.6-28.1.el6.x86_64                                                               30/61
  Installing : libc-client-2007e-11.el6.x86_64                                                          31/61
  Installing : freetype-2.3.11-14.el6_3.1.x86_64                                                        32/61
  Installing : 12:aspell-0.60.6-12.el6.x86_64                                                           33/61
  Installing : libtidy-0.99.0-19.20070615.1.el6.x86_64                                                  34/61
  Installing : libjpeg-turbo-1.2.1-1.el6.x86_64                                                         35/61
  Installing : hunspell-1.2.8-16.el6.x86_64                                                             36/61
  Installing : 1:enchant-1.5.0-4.el6.x86_64                                                             37/61
  Installing : php-enchant-5.3.3-22.el6.x86_64                                                          38/61
  Installing : php-gd-5.3.3-22.el6.x86_64                                                               39/61
  Installing : php-tidy-5.3.3-22.el6.x86_64                                                             40/61
  Installing : php-pspell-5.3.3-22.el6.x86_64                                                           41/61
  Installing : php-imap-5.3.3-22.el6.x86_64                                                             42/61
  Installing : php-recode-5.3.3-22.el6.x86_64                                                           43/61
  Installing : php-intl-5.3.3-22.el6.x86_64                                                             44/61
  Installing : php-odbc-5.3.3-22.el6.x86_64                                                             45/61
  Installing : php-xml-5.3.3-22.el6.x86_64                                                              46/61
  Installing : php-pecl-apc-devel-3.1.9-2.el6.x86_64                                                    47/61
  Installing : php-zts-5.3.3-22.el6.x86_64                                                              48/61
  Installing : php-pgsql-5.3.3-22.el6.x86_64                                                            49/61
  Installing : php-snmp-5.3.3-22.el6.x86_64                                                             50/61
  Installing : php-pecl-memcache-3.0.5-4.el6.x86_64                                                     51/61
  Installing : php-mysql-5.3.3-22.el6.x86_64                                                            52/61
  Installing : php-bcmath-5.3.3-22.el6.x86_64                                                           53/61
  Installing : php-fpm-5.3.3-22.el6.x86_64                                                              54/61
  Installing : php-xmlrpc-5.3.3-22.el6.x86_64                                                           55/61
  Installing : php-dba-5.3.3-22.el6.x86_64                                                              56/61
  Installing : php-mbstring-5.3.3-22.el6.x86_64                                                         57/61
  Installing : php-ldap-5.3.3-22.el6.x86_64                                                             58/61
  Installing : php-process-5.3.3-22.el6.x86_64                                                          59/61
  Installing : php-soap-5.3.3-22.el6.x86_64                                                             60/61
  Installing : php-embedded-5.3.3-22.el6.x86_64                                                         61/61
  Verifying  : hunspell-1.2.8-16.el6.x86_64                                                              1/61
  Verifying  : httpd-2.2.15-26.el6.centos.x86_64                                                         2/61
  Verifying  : php-recode-5.3.3-22.el6.x86_64                                                            3/61
  Verifying  : libjpeg-turbo-1.2.1-1.el6.x86_64                                                          4/61
  Verifying  : libtidy-0.99.0-19.20070615.1.el6.x86_64                                                   5/61
  Verifying  : libxcb-1.8.1-1.el6.x86_64                                                                 6/61
  Verifying  : libXpm-3.5.10-2.el6.x86_64                                                                7/61
  Verifying  : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                      8/61
  Verifying  : php-pecl-memcache-3.0.5-4.el6.x86_64                                                      9/61
  Verifying  : 12:aspell-0.60.6-12.el6.x86_64                                                           10/61
  Verifying  : php-bcmath-5.3.3-22.el6.x86_64                                                           11/61
  Verifying  : php-fpm-5.3.3-22.el6.x86_64                                                              12/61
  Verifying  : php-devel-5.3.3-22.el6.x86_64                                                            13/61
  Verifying  : 1:php-pear-1.9.4-4.el6.noarch                                                            14/61
  Verifying  : php-pspell-5.3.3-22.el6.x86_64                                                           15/61
  Verifying  : php-xml-5.3.3-22.el6.x86_64                                                              16/61
  Verifying  : httpd-tools-2.2.15-26.el6.centos.x86_64                                                  17/61
  Verifying  : freetype-2.3.11-14.el6_3.1.x86_64                                                        18/61
  Verifying  : php-mysql-5.3.3-22.el6.x86_64                                                            19/61
  Verifying  : php-enchant-5.3.3-22.el6.x86_64                                                          20/61
  Verifying  : libX11-1.5.0-4.el6.x86_64                                                                21/61
  Verifying  : unixODBC-2.2.14-12.el6_3.x86_64                                                          22/61
  Verifying  : automake-1.11.1-4.el6.noarch                                                             23/61
  Verifying  : php-gd-5.3.3-22.el6.x86_64                                                               24/61
  Verifying  : apr-util-1.3.9-3.el6_0.1.x86_64                                                          25/61
  Verifying  : php-tidy-5.3.3-22.el6.x86_64                                                             26/61
  Verifying  : php-cli-5.3.3-22.el6.x86_64                                                              27/61
  Verifying  : libc-client-2007e-11.el6.x86_64                                                          28/61
  Verifying  : php-common-5.3.3-22.el6.x86_64                                                           29/61
  Verifying  : 1:enchant-1.5.0-4.el6.x86_64                                                             30/61
  Verifying  : recode-3.6-28.1.el6.x86_64                                                               31/61
  Verifying  : php-pecl-apc-3.1.9-2.el6.x86_64                                                          32/61
  Verifying  : libicu-4.2.1-9.1.el6_2.x86_64                                                            33/61
  Verifying  : autoconf-2.63-5.1.el6.noarch                                                             34/61
  Verifying  : libtool-ltdl-2.2.6-15.5.el6.x86_64                                                       35/61
  Verifying  : libxslt-1.1.26-2.el6_3.1.x86_64                                                          36/61
  Verifying  : 2:libpng-1.2.49-1.el6_2.x86_64                                                           37/61
  Verifying  : mailcap-2.1.31-2.el6.noarch                                                              38/61
  Verifying  : apr-1.3.9-5.el6_2.x86_64                                                                 39/61
  Verifying  : 1:net-snmp-5.5-44.el6.x86_64                                                             40/61
  Verifying  : php-xmlrpc-5.3.3-22.el6.x86_64                                                           41/61
  Verifying  : postgresql-libs-8.4.13-1.el6_3.x86_64                                                    42/61
  Verifying  : php-odbc-5.3.3-22.el6.x86_64                                                             43/61
  Verifying  : libX11-common-1.5.0-4.el6.noarch                                                         44/61
  Verifying  : php-imap-5.3.3-22.el6.x86_64                                                             45/61
  Verifying  : php-dba-5.3.3-22.el6.x86_64                                                              46/61
  Verifying  : php-mbstring-5.3.3-22.el6.x86_64                                                         47/61
  Verifying  : php-ldap-5.3.3-22.el6.x86_64                                                             48/61
  Verifying  : php-5.3.3-22.el6.x86_64                                                                  49/61
  Verifying  : php-pecl-apc-devel-3.1.9-2.el6.x86_64                                                    50/61
  Verifying  : 1:net-snmp-libs-5.5-44.el6.x86_64                                                        51/61
  Verifying  : php-pgsql-5.3.3-22.el6.x86_64                                                            52/61
  Verifying  : php-snmp-5.3.3-22.el6.x86_64                                                             53/61
  Verifying  : libXau-1.0.6-4.el6.x86_64                                                                54/61
  Verifying  : php-pdo-5.3.3-22.el6.x86_64                                                              55/61
  Verifying  : lm_sensors-libs-3.1.1-17.el6.x86_64                                                      56/61
  Verifying  : php-process-5.3.3-22.el6.x86_64                                                          57/61
  Verifying  : php-soap-5.3.3-22.el6.x86_64                                                             58/61
  Verifying  : php-embedded-5.3.3-22.el6.x86_64                                                         59/61
  Verifying  : php-intl-5.3.3-22.el6.x86_64                                                             60/61
  Verifying  : php-zts-5.3.3-22.el6.x86_64                                                              61/61

Installed:
  php.x86_64 0:5.3.3-22.el6                             php-bcmath.x86_64 0:5.3.3-22.el6
  php-cli.x86_64 0:5.3.3-22.el6                         php-common.x86_64 0:5.3.3-22.el6
  php-dba.x86_64 0:5.3.3-22.el6                         php-devel.x86_64 0:5.3.3-22.el6
  php-embedded.x86_64 0:5.3.3-22.el6                    php-enchant.x86_64 0:5.3.3-22.el6
  php-fpm.x86_64 0:5.3.3-22.el6                         php-gd.x86_64 0:5.3.3-22.el6
  php-imap.x86_64 0:5.3.3-22.el6                        php-intl.x86_64 0:5.3.3-22.el6
  php-ldap.x86_64 0:5.3.3-22.el6                        php-mbstring.x86_64 0:5.3.3-22.el6
  php-mysql.x86_64 0:5.3.3-22.el6                       php-odbc.x86_64 0:5.3.3-22.el6
  php-pdo.x86_64 0:5.3.3-22.el6                         php-pear.noarch 1:1.9.4-4.el6
  php-pecl-apc.x86_64 0:3.1.9-2.el6                     php-pecl-apc-devel.x86_64 0:3.1.9-2.el6
  php-pecl-memcache.x86_64 0:3.0.5-4.el6                php-pgsql.x86_64 0:5.3.3-22.el6
  php-process.x86_64 0:5.3.3-22.el6                     php-pspell.x86_64 0:5.3.3-22.el6
  php-recode.x86_64 0:5.3.3-22.el6                      php-snmp.x86_64 0:5.3.3-22.el6
  php-soap.x86_64 0:5.3.3-22.el6                        php-tidy.x86_64 0:5.3.3-22.el6
  php-xml.x86_64 0:5.3.3-22.el6                         php-xmlrpc.x86_64 0:5.3.3-22.el6
  php-zts.x86_64 0:5.3.3-22.el6

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2                           apr-util.x86_64 0:1.3.9-3.el6_0.1
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1               aspell.x86_64 12:0.60.6-12.el6
  autoconf.noarch 0:2.63-5.1.el6                       automake.noarch 0:1.11.1-4.el6
  enchant.x86_64 1:1.5.0-4.el6                         freetype.x86_64 0:2.3.11-14.el6_3.1
  httpd.x86_64 0:2.2.15-26.el6.centos                  httpd-tools.x86_64 0:2.2.15-26.el6.centos
  hunspell.x86_64 0:1.2.8-16.el6                       libX11.x86_64 0:1.5.0-4.el6
  libX11-common.noarch 0:1.5.0-4.el6                   libXau.x86_64 0:1.0.6-4.el6
  libXpm.x86_64 0:3.5.10-2.el6                         libc-client.x86_64 0:2007e-11.el6
  libicu.x86_64 0:4.2.1-9.1.el6_2                      libjpeg-turbo.x86_64 0:1.2.1-1.el6
  libpng.x86_64 2:1.2.49-1.el6_2                       libtidy.x86_64 0:0.99.0-19.20070615.1.el6
  libtool-ltdl.x86_64 0:2.2.6-15.5.el6                 libxcb.x86_64 0:1.8.1-1.el6
  libxslt.x86_64 0:1.1.26-2.el6_3.1                    lm_sensors-libs.x86_64 0:3.1.1-17.el6
  mailcap.noarch 0:2.1.31-2.el6                        net-snmp.x86_64 1:5.5-44.el6
  net-snmp-libs.x86_64 1:5.5-44.el6                    postgresql-libs.x86_64 0:8.4.13-1.el6_3
  recode.x86_64 0:3.6-28.1.el6                         unixODBC.x86_64 0:2.2.14-12.el6_3

Complete!

2. Check and verify the installed PHP packages :

[root@centos64 ~]# rpm -qa | grep php
php-gd-5.3.3-22.el6.x86_64
php-pspell-5.3.3-22.el6.x86_64
php-recode-5.3.3-22.el6.x86_64
php-odbc-5.3.3-22.el6.x86_64
php-pecl-apc-devel-3.1.9-2.el6.x86_64
php-pgsql-5.3.3-22.el6.x86_64
php-pecl-memcache-3.0.5-4.el6.x86_64
php-bcmath-5.3.3-22.el6.x86_64
php-xmlrpc-5.3.3-22.el6.x86_64
php-mbstring-5.3.3-22.el6.x86_64
php-process-5.3.3-22.el6.x86_64
php-embedded-5.3.3-22.el6.x86_64
php-pdo-5.3.3-22.el6.x86_64
php-pear-1.9.4-4.el6.noarch
php-pecl-apc-3.1.9-2.el6.x86_64
php-devel-5.3.3-22.el6.x86_64
php-enchant-5.3.3-22.el6.x86_64
php-tidy-5.3.3-22.el6.x86_64
php-imap-5.3.3-22.el6.x86_64
php-intl-5.3.3-22.el6.x86_64
php-xml-5.3.3-22.el6.x86_64
php-zts-5.3.3-22.el6.x86_64
php-snmp-5.3.3-22.el6.x86_64
php-mysql-5.3.3-22.el6.x86_64
php-fpm-5.3.3-22.el6.x86_64
php-dba-5.3.3-22.el6.x86_64
php-ldap-5.3.3-22.el6.x86_64
php-soap-5.3.3-22.el6.x86_64
php-common-5.3.3-22.el6.x86_64
php-cli-5.3.3-22.el6.x86_64
php-5.3.3-22.el6.x86_64

3. Verify PHP Version :

[root@centos64 ~]# php -v
PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

4. Do backup original php.ini :

[root@centos64 ~]# cp -a /etc/php.ini /etc/php.ini.15032013

5. Configure PHP :

[root@centos64 ~]# vi /etc/php.ini

a. Increase PHP script memory limit :

memory_limit = 128M

b. ncrease PHP script max execution time :

max_execution_time = 120

c. Increase PHP script max upload size :

upload_max_filesize = 50M

6. Restart Apache Server :

[root@centos64 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Work around for error “php53-odbc64 conflicts with php53-odbc”

Question :
When i try to run “yum install php53*”, or “yum install php” to install php package on CentOS5.9, i get the following error :

..
..
..
  --> php53-odbc64 conflicts with php53-odbc
Error: php53-odbc64 conflicts with php53-odbc
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
..
..

Example :

[root@centos59 ~]# yum install php53*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nus.edu.sg
 * extras: mirror.nus.edu.sg
 * updates: mirror.nus.edu.sg
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php53.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-bcmath.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-cli.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-common.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-dba.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-devel.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-gd.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-imap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-intl.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-ldap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-mbstring.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-mysql.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-odbc.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-odbc64.i386 0:5.3.3-2.el5 set to be updated
--> Processing Dependency: libodbc.so.2 for package: php53-odbc64
---> Package php53-pdo.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-pgsql.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-process.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-pspell.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-snmp.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-soap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-xml.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-xmlrpc.i386 0:5.3.3-13.el5_8 set to be updated
--> Running transaction check
---> Package unixODBC64-libs.i386 0:2.2.14-3.el5 set to be updated
--> Processing Dependency: libltdl.so.3 for package: unixODBC64-libs
--> Running transaction check
---> Package libtool-ltdl.i386 0:1.5.22-7.el5_4 set to be updated
--> Processing Conflict: php53-odbc64 conflicts php53-odbc
--> Finished Dependency Resolution
php53-odbc64-5.3.3-2.el5.i386 from base has depsolving problems
  --> php53-odbc64 conflicts with php53-odbc
Error: php53-odbc64 conflicts with php53-odbc
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest

Solution :
Anyway, I’ve got the workaround for this issue as mentioned in the log above.

[root@centos59 ~]# yum install php53* --skip-broken

How to Install php-mcrypt on CentOS 6.3

mcrypt exension for PHP is necessary if we want to use cookie based authentication with phpymyadmin. In default CentOS 6.3 yum repository or in CentOS 6.3 installation CD/DVD, php-mcrypt exension are not included. To install php-mcrypt on CentOS 6.3, we have to use third party yum repository. Follow this steps :

1. Download epel repository :

[root@centos62 ~]# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
[root@centos62 ~]# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6

2. Install epel repository :

[root@centos62 ~]# rpm --import RPM-GPG-KEY-EPEL-6
[root@centos62 ~]# rpm -i epel-release-6-7.noarch.rpm

3. Simply run the following command to install php-mcrypt :

[root@centos63 ~]# yum install php-mcrypt -y
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: mirror1.ku.ac.th
 * epel: mirrors.ispros.com.bd
 * extras: mirror.issp.co.th
 * updates: mirror1.ku.ac.th
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.i686 0:5.3.3-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                   Arch                Version                    Repository           Size
====================================================================================================
Installing:
 php-mcrypt                i686                5.3.3-1.el6                epel                 18 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 18 k
Installed size: 38 k
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 18 k
php-mcrypt-5.3.3-1.el6.i686.rpm                                              |  18 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-mcrypt-5.3.3-1.el6.i686                                                      1/1
  Verifying  : php-mcrypt-5.3.3-1.el6.i686                                                      1/1

Installed:
  php-mcrypt.i686 0:5.3.3-1.el6

Complete!