Difference between revisions of "Mirroring LAMP Website"

From assela Pathirana
Jump to navigationJump to search
(Created page with '==Introduction== Cheap web hosting companies do not provide # SSL support (https), # Digest authentication (a poor-man's alternative to true SSL to introduce a modicum of secur…')
 
Line 8: Line 8:


The solution I wanted to to implement is to run the `editable' version of the web site in a different server (my home server, that is not 24h up and running) then to `mirror' the changes to a `read-only' server on my hosting site. After several false-stats, I was successfully in doing this. Following is the story.
The solution I wanted to to implement is to run the `editable' version of the web site in a different server (my home server, that is not 24h up and running) then to `mirror' the changes to a `read-only' server on my hosting site. After several false-stats, I was successfully in doing this. Following is the story.
There a a number of steps to this process: (Before anything else make a backup of the database, all the static files of the web site and keep them safely.)
# Use myseldump to backup the database from the host (Where the web site is served from) and restore it in the development machine (DM). The idea here is to have the identical databases in host and DM. It is OK to have other databases on either of the machines.
# Copy all the required files (e.g. php, skins, images, etc.) from host to DM.
# Get the web site working on DM (say <tt>https://mydm.net/develop/mysite</tt>)
# Now we have to set the databases and files on the host to be automatically updated by the versions on DM periodically. If you have admin access on DM, you can set [[wikipedia:database replication|database replication]], But, we don't, so I use a round-about way of getting this done. File synching can be done using [[wikipedia:rsync|rsync]].
# Have a crontab on DM to do the above step periodically. (say once a day)
# I had to add a url rewriting rule in the host machine to get the site fully functional.






[[Category:Computing]][[Category:Unix]]
[[Category:Computing]][[Category:Unix]]

Revision as of 17:52, 8 April 2011

Introduction

Cheap web hosting companies do not provide

  1. SSL support (https),
  2. Digest authentication (a poor-man's alternative to true SSL to introduce a modicum of security.)
  3. Admin access to MySQL database servers.

Running a web-based content creation system like a wiki off such a platform exposes your passwords being transmitted in clear-text each time you login to the site to change something.

The solution I wanted to to implement is to run the `editable' version of the web site in a different server (my home server, that is not 24h up and running) then to `mirror' the changes to a `read-only' server on my hosting site. After several false-stats, I was successfully in doing this. Following is the story.

There a a number of steps to this process: (Before anything else make a backup of the database, all the static files of the web site and keep them safely.)

  1. Use myseldump to backup the database from the host (Where the web site is served from) and restore it in the development machine (DM). The idea here is to have the identical databases in host and DM. It is OK to have other databases on either of the machines.
  2. Copy all the required files (e.g. php, skins, images, etc.) from host to DM.
  3. Get the web site working on DM (say https://mydm.net/develop/mysite)
  4. Now we have to set the databases and files on the host to be automatically updated by the versions on DM periodically. If you have admin access on DM, you can set database replication, But, we don't, so I use a round-about way of getting this done. File synching can be done using rsync.
  5. Have a crontab on DM to do the above step periodically. (say once a day)
  6. I had to add a url rewriting rule in the host machine to get the site fully functional.