Linux containers are simple, portable instances of Linux that run under the LXC container system. Whether you have Groundwork Core or Enterprise, it’s always good to have portable versions of your GroundWork servers. With containers, you can move them, copy them, snapshot them, and upgrade them (or test doing so) easily.
A Linux system with enough horsepower to run GroundWork. That usually means at least a dual-core CPU and 8 GB RAM, and 160 GB free on your hard drive. Yes, you could run this on a VM, but we can safely ignore that consideration since it’s abstract. If you want to run GroundWork on Amazon EC2, you can do it in a container as well, but you will want to follow a particular configuration option. See below.
# apt-get install lxc lxctl lxc-templates
Of course, there's more to it if you want to get the most up-to-date version, but this works fine.
If you are using another distro, you can find the equivalent for your package manager.
# wget https://lxc-webpanel.github.io/tools/install.sh -O - | bash
That gives you a nice little view into what the containers are doing.
Figure: LXC Web Panel
The web panel runs on port 5000 on your local system by default. The default username and password is admin/admin.
# lxc-ls
This will list all installed containers. Or you can run:
# lxc-ls --fancy
This says a bit more about the containers, like if they are running and their IP addresses.
# tar -xzvf lxc-gwos-server-71-beta.tgz -C /
Then skip to step 15, below.
# apt-get install yum
# lxc-create -t download -n mycentos -- --dist centos --release 6 --arch amd64
# lxc-start -n mycentos
# lxc-attach -n mycentos
# yum install openssh-server
# yum install wget
# yum install patch
# yum install tar
# chkconfig sshd on
# service sshd start
# passwd root
# exit
And you are back at the prompt of your Ubuntu Linux system. From here, you can see what the IP address is with:
# lxc-ls --fancy NAME STATE IPV4 IPV6 GROUPS AUTOSTART ---------------------------------------------------------------------- mycentos RUNNING 10.0.3.110 - - NO
# apt-get install httpd
# a2enmod proxy proxy_http
/etc/apache2/apache2.conf
RewriteEngine On RewriteCond %{HTTP_HOST} ^192.168.42.103/* RewriteRule (.*) http://10.0.3.110/$1 [P,L] ProxyPreserveHost On ProxyPass / http://10.0.3.110/ ProxyPassReverse / http://10.0.3.110/
<IfModule mod_proxy.c> ProxyRequests Off <Proxy *> AddDefaultCharset off Order deny,allow Allow from all </Proxy>
# service apache2 restart
# ./gw-config --machine_hostname 192.168.42.103
# sed -i 's/mycentos/192.168.42.103/g' /usr/local/groundwork/config/josso-agent-config.xml
service groundwork restart gwservices
There are a few limitations with the proxy approach. GDMA won’t work without a lot of adjustments that we haven’t covered here. Also, for example, it’s not possible to directly upload background files for the views application. The portal applications do work, though, and it’s adequate for testing and light-duty production monitoring. The best part is, you can move the server to any host just by stopping it (lxc-stop command) and tarring it up, then untarring it in the new location. If you use the bridge method, it’s just like having a GroundWork server on the network, but be advised that the load on the Ubuntu system network interface will be heavy, so you should use a capable machine.