I have gone into great details of setting up a web server this past month. Now that you have all of this information about web servers. Lets move to hosting websites from your phone. Their are two ways you can do this. Both of which are extremely simple to do. The first way is to install an app onto your phone. Their are currently two apps available on Google Play that are made specifically for hosting websites from your phone.
With the above two apps it’s simple as simply firing up the Google Market place and searching for them. Once you’ve found them. Choose one of them and install it. Follow the instructions and your phone will start to host websites.
The second way is a little more advanced and requires more know how. But it is also more flexible and custom. And unlike the above apps. You will be able to host websites that use SQL type databases as well as PHP. So in short you will have pretty much a LAMP server in your pocket with the method I will talk about next.
First in order to have a pocket LAMP server you will need to have Linux installed on your phone. I talked about how to do this in a previous post. If you have Linux one your phone you will need to start it up. Then type the following commands.
aptitude install apache2
aptitude install mysql-server mysql-client
Now we will want to install PHP. So we will type the following.
aptitude install php5 php5-mysql libapache2-mod-php5 php5-cgi
Remember to restart restart apache after installing MySQL and PHP. To do this we will type the following.
The above will setup you up with a traditional LAMP server right on your phone. However you may wish to have packages that are a little more light weight to be part of your server. So if this is the case we will use light httpd and sqlite.
To install the lite weight server we will first install light httpd. To do this we will type the following.
apt-get install lighttpd
Now we will install sqlite. To do this we will type the following.
apt-get install sqlite3
Great. Now lets add PHP. We will type the following.
apt-get install php5-sqlite
Now we should have our light weight web server right on our phone.