Imran's personal blog

September 17, 2012

VPS experiments

Filed under: Uncategorized — ipeerbhai @ 7:27 pm

Hi All,

I’ve been experimenting with VPS — Virtual Private Servers.  This is a direct on internet virtual machine.  You get a full IP, no firewalls or port restrictions, that you fully manage yourself.  I had hoped to find a Windows VPS for cheap — but I’ve found that the cheapest Windows VPS solutions are still pretty expensive.  So, I’m doing a Linux VPS, though my background is more Windows and Mac, with a smattering of Solaris.  I’ve got an Ubuntu 10 virtual machine that I run on my Mac for things like Pycam/Kicad, so I figured I’d go with an Ubuntu 10 VPS.  I want a VPS for the following user cases:

  1. VPN access anytime/place.  I’d rather run my own VPN to access things than rely on a VPN provider.  While Strong and the others are nice, the cost is greater.  A cheap Linux VPN for occasional use ( say whenever I’m traveling ), cost about $35 /year.  A VPN provider costs about $60/year.  I’d rather get the greater use from a VPS than I can get from a VPN.
  2. Perforce.  I know people like Git or SVN, but I’m a perforce fan.  I haven’t yet found a “perforcehub” like service.  I’d rather learn how to run a VPS with perforce on it, than learn git or SVN.  PLus this way, I control how open I choose to be with my code.  I have source control at work, and once you get used to having source control, you realize you always want source control.  Even if you’re working with Word docs or Excel spreadsheets.  Dropbox is nice, Google docs is nice.  But nothing beats a good source control system, maybe with DropBox as a backup service.
  3. Various services.  My programming skillset is ASP.NET/C#/PERL/Objective-C/Java.  I use ASP.NET/C# for web stuff.  I write iOS apps in Objective-C( rarely now.  My last one was a year or so ago. ), I write the occasional Java applications, and occasional PERL scripts.  Every once in a while, I have an idea, and I need a quick test-bed.  Getting a shared hosting package for every little idea, coupled with the restrictions each of them have ( say no filesystem access, which is a typical one.  Or process restrictions — again, common ), gets annoying.  With a VPS, I control the full virtual machine — so I set the policy.

Along the way, I’ve been figuring out some things, and this post is a memorial — I rarely will do these things, so I should find a way to remember them when I need to in the future.

First howto — add a user:

It used to be that to add a user, you’d add an entry in /etc/passwd, create a directory, chown the directory, and run passwd.  This process no longer works — too many shadow files and policy files to find and modify by hand.  Ubuntu solves this by making an adduser script.  Just call adduser with the name.  I recommend using adduser –ingroup staff NewUser.  This is because I set sudo/su permissions to only this group.  I suspect this script is probably in mot distributions.

Second howto — update/upgrade packages:

  1. Become root ( or alternative, run all these commands with sudo )
  2. apt-get update
  3. apt-get upgrade
  4. reboot

This will bring you server up-to-date with the installed software.

Third How-to — install Mono/Apache/etc…

This is a bit more complex.  I’m figuring it out right now.  Since my best web language is ASP.NET/C#, I need to create a server environment where I can run this.  Windows would have been much easier here — but I hear apache can do it.

Fourth How-to — install perforce.

Simple and Dirty way:

Download p4d from perforce.com

Put it in /usr/local/sbin

cd /usr/local/sbin

./p4d &

modify /etc/rc.local to include the above.  This way, perforce restarts on any reboot.  Make sure to chmod the file +x.

 

Fifth How-to — create a VPN

I’m exploring OpenVPN, but haven’t installed/tried it yet.

Sixth How-to — connect to the VPS with a GUI

No clue at all on this.  So far, all I know how to get is ssh.  It used to be you could use X servers and connect with an xterm — but the world has changed since then, and I don’t know the current method.  Probably some sort of VNC system.

Anyway, this is an in-progress post.  I’ll update it whenever I need to remember something, and I didn’t write  it down the first time…

Thanks,

Imran

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: