solution for an offline server

dashmug asked:

I’m trying to setup a development server at work that will ideally be able to test drive a couple of projects in PHP, Rails, or Django (not always running at the same time). I develop the apps locally on a Mac and then I’ll put the projects up on this server for testing with my actual users (non-techies) before deploying to a production server.

My problem is that we have a very poor internet connection (almost negligible) at work and doing the usual apt-get/yum/ports (make, clean, install) processes for setting up servers always get their packages from online repositories somewhere. I know I could probably download the source and then compile them myself but that’s going to be too much of a hassle for me.

I’m thinking about two solutions:

Plan A:

Run a server VM on my Mac and then use this VM as the source repository for the offline server. I’ve read about Ubuntu’s apt-proxy and it seems to be good enough though I haven’t tried it yet.

I’m not sure if this is possible but can I simply do apt-get install nginx --downloadonly so that the package and its dependencies will be downloaded into my VM and my server can use the VM as the source repo for apt-get?

Plan B:

Run a server VM on my Mac (which I can setup/update easily when I’m home) and then clone the VM to the offline development server. Maybe I should simply make the server a VM host so I can simply copy the VM over.

I think this is okay for the first-time setup but subsequent updates will take too long (cloning the VM image).

If I was working on Windows, I imagine it’d be easier because most services have an installer file that I can download and then run at the server.

If you could suggest another way, it would be much appreciated.


From Michael Hampton’s answer, I found a possible solution which is apt-cacher.

I also found this page on Ubuntu’s website.

I wonder if there is a better tool than this one.

My answer:

Consider using apt-mirror to create a local mirror.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.