Grow Your Business Online.

How Do I Start Hosting My Web Pages and PHP Scripts

To start hosting your web pages and PHP scripts, you will need to do the following things, in gist:
- Install a web server.
- Install the PHP interpreter.
- Configure the web server.
- Install a FTP server.
- Configure the FTP server.
- Install a database server.
- Configure the database server.


Installing is the easy part. Configuring is the hard part. However, "easy" or "hard" are relative terms, and it depends on your level of skill. If you are skillful, all of the above will be easy and you probably would not be reading this article in the first place. Thus, this article assumes that you are not skillful, in the sense that you have never done anything like build a Linux or Windows web server that runs hundreds of websites that can support common CMS like WordPress or Joomla.


First, you will need to acquire the needed skills to perform the above tasks. Skills take time and effort to acquire. The time and effort that you put into reading this entire article will certainly not suffice, but it will serve as a good start. (Wait! I do not have so much time! Is there a quicker way to do this? Yes there is! Please click here.)


There are several ways to install a web server. For Linux based servers, the most common way is to use a package manager. For Centos, the package manager would be Yum. For Debian, it would be Aptitude. Typically, a command like "yum install httpd" or "apt-get install apache2" would get the web server (Apache in this case here) installed in a Centos and Debian server respectively. The same thing applies to the PHP interpreter, i.e. a command like "yum install php" or "apt-get install php" should work. For more details, simply Google the words like "install apache centos" or "install PHP debian" will yield a host of articles.


After that, you will need to configure the Apache server. This will be no easy task as the Apache server is a powerful web server with many configurable options. To make it work together with PHP is even harder; "harder" in the sense that that are many ways to make it work, and there are even more ways to make it not work. Most articles in the Internet (Google "apache PHP centos" or something similar) will show you some very basic configuration approaches, but those articles by no means describe the only method of getting it done. Most involve just leaving things in their default configuration, and simply upload the web pages and scripts to the default locations (and hope that it all works out well). For Centos, it would be "/var/www/html". For Debian, it would be "/var/www". (Information is from http://wiki.apache.org/httpd/DistrosDefaultLayout#Debian.2C_Ubuntu_.28Apache_httpd_2.x.29: .) (You might be wondering how to upload the web pages. That point will be touched on when we come to the FTP server.)


For Windows server, the default web server is IIS. Installing IIS almost feels like enabling something in a Windows server. Typically, you would go to " Start -> All Programs -> Administrative Tools -> Server Manager", then "Roles", "Add Roles", tick "Web Server (IIS)". Full details available in
http://www.iis.net/learn/install/installing-iis-7/installing-iis-7-and-above-on-windows-server-2008-or-windows-server-2008-r2 .


For PHP in a Windows server with IIS, you can consult this article.
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php .


The purpose of the FTP server is to allow you to upload web pages and scripts into your server. In a Linux server, there are many FTP server programs available, each with its own method of configuration. But for Linux servers, using FTP is not the only way to upload files. You can use SCP, which actually uses the SSH connection to upload the files. If you use a program like "WinSCP" (http://www.winscp.net), you can upload files into your Linux server without the need to install additional software in the server.


For Windows server, please read the article below on installing the FTP server.
http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-ftp-7-on-iis-7 .


Typically, in a Linux server, the database server would be MySQL. Just like Apache, there are several ways to get it installed. The most common way would be to use a package manager. Thus, a command like "yum install mysql-server mysql php-mysql" (for Centos), or a command like "apt-get install mysql-server php5-mysql" (for Debian) will get it done. During the installation of MySQL, you should be prompted to set a MySQL root password. Please do not confuse this with the server's root password. The server's root password allows you to SSH into the server, and perform administrator tasks like installing more programs. The MySQL root password allows you to log into the MySQL server as MySQL administrator to do things like create databases and users for the databases. You can use the command "mysql_setpermission" (http://dev.mysql.com/doc/refman/5.1/en/mysql-setpermission.html) to help you create databases and database users.


For a Windows server, Microsoft will of course recommend using MSSQL as the database server. However, please note that not all versions of MSSQL are free.
To read about the official Microsoft method of doing this, please go to
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-sql-server-2008-for-php-applications-on-iis-7-and-above
If you want to try using MySQL, please go to
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-mysql-for-php-applications-on-iis-7-and-above .


The above describes the things that need to be done in order to make server capable of running a web site with PHP scripts. But it is by no means complete. It only serves as a start.


Some of us may not have the time, energy and/or interest to explore the intricacies of all the "ingredients" needed to make a web server that supports PHP and MySQL. In case you are wondering, "Is there a program that installs and configures all these 'ingredients' for me, and then gives me a graphical user interface for me to easily manage the server? " The answer is yes. It is called the "Parallels Plesk Panel". The software is free to download and install, but you will need a license to get it to work.


Some of our pre-build cloud servers are installed with Plesk. If you intend to explore this option, you might want to consider changing the "Template" (aka Operating System) to something like "CentOS 6.3 Plesk 11 x64", as illustrated in the picture below.



(Please note that changing the "template" or operating system of the cloud server will result in loss of data. Do this only when you have the means of re-uploading all your data.)


After that, you will need to "Rebuild Virtual Machine", as illustrated below. (To repeat, this will result in loss of data. Do this only when you have the means of re-uploading all your data.)



When your cloud server has done rebuilding itself, please read
https://orders.signetique.com/orders/knowledgebase.php?action=displayarticle&id=85
to find out how you can access the Plesk control panel.


As for the license needed for the Plesk control panel, you can ask for a trial key from Parallels at
http://www.parallels.com/products/plesk/trial/


... or you can contact support@webhosting.com.sg, and we will get a trial key for you.


To purchase an actual license / key, please contact support@webhosting.com.sg or sales@webhosting.com.sg.


After that, you can look at the tutorials on how to use Plesk, at
http://www.parallels.com/products/plesk/tutorials/   

Under most circumstances, learning from the Plesk tutorials should be easier than learning how to install and configure Apache / IIS, PHP and MySQL / MSSQL.


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.