Installing Apache2 With PHP5 and MySQL on Rackspace Cloud Server with Ubuntu Linux is written in easy language and as step by step guide for the newbies with all step explanation. Where we need this kind of setup ? this is for most of the CMS, Forum and blogging softwares. WordPress is typical example. But for WordPress we have our old typical guide and obvious how to install WordPress on Rackspace Cloud Server as Video Guide. Firstly, you need to know few basic things which usually confuses any new user for installing Apache2.
Installing Apache2 With PHP5 and MySQL : Must Know Basics
If you have shifted from a control panel based web hosting like cPanel or Plesk to IaaS like Rackspace Cloud, we recommend to read :
- Cloud Computing Service Models for understanding the IaaS
- Secondly, the basics about Linux
- Thirdly, the difference of Server OS and Desktop OS in case of Linux
- Fourthly, to clear the fact that cPanel or Plesk are nothing but another web software, in fact we have shown the installation of Free Web Control Panel on the same kind of server where you will be installing Apache2 with PHP5 and MySQL.
- Fifth are some basic UNIX commands
- At minimum some idea about LAMP server
- Understand that we are using a protocol to connect with server that is SSH
These are not only enough for Installing Apache2 With PHP5 and MySQL guide but also for any kind of server setup. Actually the programs we use are broadly said as Terminal like in Apple OS X or in Linux. These are not actual Terminals but Terminal Emulators or Terminal Applications. iTerm2 for example is a third party Terminal Emulator for OS X. Windows has no such application by default. So we universally use a great free software named PuTTY. Windows users can read the Handy Guide to PuTTY.
---
Installing Apache2 With PHP5 and MySQL : Steps
If you watch the initial part of any of our video like how to install WordPress on Rackspace Cloud Server as Video Guide, you will actually view the process to create a server instance. At the next step we launch the Terminal Application and SSH (that is login) to the remote computer.
It is a generally taken fact that almost all guides starts assuming you know to perform the above steps. This obviously creates a big confusion to the new users. This actually avoids the facts of difference of Cloud Server or pure IaaS or Traditional Server or local computer. It becomes generalized. We are taking that, you have done the above steps by watching any such video guide.
So you logged in and asked to save the RSA fingerprint. You will accept it. This is the starting point. Stop following any other previous video guide at this step and only do what is written here.
Usually we update the server :
1 | apt-get update |
So there are clearly three components or softwares we have to install on Ubuntu Linux making the AMP part of LAMP acronym :
This Apache2 server software has various extra modules which we can activate, deactivate or install as extra if required. In the same way, PHP has extra dependencies. As normally happens, if we install unnecessary softwares they will consume more RAM. That is why this way of installation through command line is the best way than using a Control Panel based server – it gives more control. The sequence of installing Apache2, PHP and MySQL has no rules but we usually install Apache2 first as pointing towards IP / domain name will show the default webpage – “It Works!” – itself working as a checking point whether we are doing the right things.
Installing Apache2 is easy run by copy pasting this command and hit Enter from your keyboard :
1 | apt-get install apache2 |
If you run a plain HTML website nothing more actually needed to be installed – the server will require merely 256-512 MB RAM (with average traffic load). Now if you point your browser to http://IP address in numeric numbers, you should see the Apache2 placeholder page (It works!).
Second is MySQL :
1 | apt-get install mysql-server mysql-client |
You will be asked to provide a password for the MySQL root user. We can install the PHP part and the required Apache PHP5 module with one combined command :
1 | apt-get install php5 libapache2-mod-php5 |
We restart Apache2 at this point :
1 | /etc/init.d/apache2 restart |
We are talking about PHP modules, we must install php5-mysql to get MySQL to support PHP :
1 | apt-get install php5-mysql |
There are many modules like :
- php5-curl
- php5-gd
- php5-idn
- php-pear
- php5-imagick
- php5-imap
- php5-mcrypt
- php5-memcache
- php5-ming
- php5-ps
- php5-pspell
- php5-recode
- php5-snmp
- php5-sqlite
- php5-tidy
- php5-xmlrpc
- php5-xsl
Instead of running the commands separately like :
1 | apt-get install php5-curl |
We can combine them as many (practically so) we want :
1 | apt-get install php5-mysql php5-curl php5-gd |
If you read this guide for installing Apache2 with PHP5 and MySQL, you will never have any fundamental understanding issue.
Tagged With install php5 apache2