Posts Tagged ‘virtual host’
There is a great and popular service called Dropbox where you create your own remote drive that is available to all your computers as a folder on your desktop. The folder itself lives on the dropbox’s server and a copy of your local dropbox folder is continually synchronised with the remote one. Therefore if you’re at work and drop a file into your local dropbox folder, that same file is available to you at home in that dropbox folder.
I have wanted something like this for some time but found I could not get it to run on my Kubuntu workstation running the Fluxbox window manager. After spending a long time searching Google I thought there must be a simple alternative available for Linux that didn’t require any additional software that I could host on my virtualhost at Slicehost.
I was almost right. I needed to install one program locally but it couldn’t be any simpler. Install sshfs with the following command (For Debian/*buntu machines)
sudo apt-get install sshfs
Once installed you need to create your local mount point for the dropbox.
Create the dropbox path on your remoter server:
sudo mkdir /var/dropbox sudo chown remoteusername:remoteusername /var/dropbox
With this prepared you can now connect to your dropbox using sshfs.
sshfs remoteusername@host:/var/dropbox /home/username/dropbox
Depending how you have sshd setup onthe remote host you may be asked to enter your password. Then the dropbox is available. If you copy any files across to the local /dropbox path they are moved to the remote dropbox path as they would with any symbolic link or drive.
By setting this up on other workstations you have effectively created your own dropbox.
This is effectively the same as when using Windows to map a network drive on your computer to the files system on a remote web server.
There are two major points here that Dropbox has that this method does not and that is version control and a web interface. Although, a simple web interface wouldn’t be that hard to create if someone was inclined.
The path can be unmounted using the command
fusermount -u /dropbox
I have been working with Linux and web development for over seven years and in this time I have used several hosting companies as well as set-up some development servers at home in order to host and develop my websites. I had recently decided to take the plunge into getting my own virtual server account so I would have a live environment where I would have full control.
I chose Slicehost as my provider as I have used them in the past at work and found them to be reliable and the control panel and service to be exceptional. As with this type of virtual host you are given a completely new install with bare services running. This means that as a web server you need to manually install everything from Apache, MySQL and PHP manually. Also you will probably need to install a mail service.
The tough part for me was installing and configuring the mail. This is not something I do with my dev boxes at home. This was a bigger learning curve than I imagined but very rewarding. The greatest part with virtual hosts is that if you completely screw up, you can easily choose to rebuild your slice and start again from scratch.
Also through the slice manager you can easily configure DNS for any domains and subdomains hosted on the server.
Anyway, some of the best things I have learnt from the experience are:
- Setting up a mail server with encryption and smtp authentication for imap accounts using mysql.
- Setting up the firewall using iptables.
- Learning how to login over ssh without passwords.
- Setting up a Subversion server with SSL encryption.
It has been very satisfying to step away from the traditional hosting companies and have full control over my hosting. I recommend anyone else with Linux experience who is thinking of getting a virtual host with full root access to give it a go. There are some good ones about and the experience gained are better than I would have hoped.