Showing posts with label Administration. Show all posts
Showing posts with label Administration. Show all posts

Wednesday, February 6, 2013

PC-BSD 9.1 Linux Jails, VirtualBox, Citadel Groupware

v 0.2
6 Feb 13

The last few days, I've been playing with PC-BSD Jails via Warden.  I've found that the BSD Jails work just great, as I've mentioned previously, however I've been having problems installing servers on a Debian Linux Jail.  Some servers install without a hitch, and others just won't let the outside world see them. 

A case in point is installing Citadel Groupware.  In the Linux Jail, the two components can't talk to each other - Webcit, which provides the outward facing web interface, can't see the Citserver to talk on TCP 504.  Installing on Virtualbox, no problems - it installs without a hitch.

Another example is the installation of Web Servers.  Apache - nope.  Nginx - worked out of the box.  In all cases, the installation was using the standard Debian packages from the Main repository.

Debian Jail - Install Script

The way Debian is installed in a Linux Jail, is using the debootstrap command.  The way this is set in the install script is simply:

debootstrap squeeze

However, there are several architectures for Debian, in particular, the ones we want use the FreeBSD kernel .. should we include the architecture we want?  So, it would look like:

debootstrap --arch kfreebsd-i386 squeeze
or
debootstrap --arch kfreebsd-amd64 squeeze

I haven't really seen any difference, however I wonder ...

Citadel Again

Maybe I take a little longer for the concepts to sink in, but I've finally satisfied myself that the Debian packages do the same installation (albeit with files in different places - because it is Debian).
  • The servers are installed
  • The "citadel" user is created to run the server
  • The init scripts are sorted.
The outcome of all this is that when the machine (virtual or real) is started, Citadel starts as well.

How to re-configure the Citadel Server?  There is a setup script in
"/usr/lib/citadel-server"
Run that script if you need to and you can adjust ports, and add an admin user.

Be aware, that Webcit ignores your setup instructions.  Get a text editor and edit
"/etc/default/webcit"
to your liking.




Later .........


Friday, February 1, 2013

PC-BSD 9.1 - More Jails and Linux

v 0.3.1
1 Feb 13
2 Feb 13
4 Feb 13

As I mentioned a couple of posts ago, most things are easy in hindsight, but maddening when you have to work them out.  Another such example I have found with PC-BSD Jails under the "Warden".  Rather than try and organise what I've found into little chunks, this will be a narration of the adventure.

I started learning about Jails using a Linux Jail.  I used an IP address within the router address space.  All was well until I tried to communicate with services within the Jail that I thought I'd started.  Not only that, but when I check the router's "attached devices" list, my Jail was nowhere to be seen.

I remembered there were two tutorial articles about Jails in BSD Magazine, one on Linux Jails in issue 12/12 and a tutorial on installing OwnCloud in a Standard Jail in issue 9/12.

The article on Linux Jails went into NAT configuration on the host and editing a few configuration files - I must confess I found this puzzling as a requirement since everything else about PC-BSD organisation of Jails was so automated.  Eventually I went back to the beginning and went through the tutorial setting up a standard BSD Jail.

What I found with the BSD Jail was that there were several other tools to manage these Jail types - including a Process manager, where I could make sure the processes I wanted were started.  That is where I started remembering the list of ports being monitored in the Linux Jail ....  Also, it was about that time I chanced on reading a statement in the PC-BSD forums where the poster pointed out that Warden does quite a few things in the background.

So ...

I cloned my BSD Jail, giving one an IP in the router address space, and the other another address in another address space.  I made sure the Apache process was started in each Jail and that the firewall had opened port 80.  Then I went to another computer on my network and simply typed in the IP address of each jail in a web browser.  The Jail with the router address space address worked immediately and Apache talked back.  The other one, not.

My conclusion as to Jail IP address:
  • If you are simply starting a Jail - give it an IP in the router address space.
  • If you are going to configure NAT on the host system, use another address space.
How do you find the Jail if the router does not know about it?  When you address your Jail, the router queries each of its attached machines.  When it queries the host machine, that machine recognises the Jail address and passes the request on to the Jail.  So the router doesn't have to know about the Jail, it just has to be able to have an address in its address space that it can give to the host machine that then knows.

NOW .. I went back to my Linux Jail - with its IP address in the router address space.  I installed an SSH server, made sure it was started (the listened port came up on the info tab).  I opened the SSH port on the firewall.  I then went to another machine on the network,

ssh (ip address)

The Jail replied!  Victory!

So you can now configure your router to talk to a Jail just like any other attached machine.  I would guess you could even assign a static IP to a Jail, using the mac address of the host machine.

A final note about Debian Jails.  When you install the Jail, there are several configuration tasks that are not taken care of that would normally be done so in a Debian Install, but are not.  That is my next little task to take care of with a Debian Linux Jail ....


Later ............

PS
For Debian,
  • an easy way to manage startup services is to load package " rcconf " and use that to graphically set services.
  • to set the default Locale, install package  " locales " and run " dpkg-reconfigure locales " to select and set your desired Locale.


Tuesday, January 29, 2013

PC-BSD 9.1 Jails and a bit of PBI

v 0.2
29 Jan 13



PBI

I should mention a couple of niceties in dealing with PBI installs: 
  • The package does not appear on your menu until the next time you log in.
  • There is a preference selection to prevent the package making an icon on the desktop if you wish.


Jails

I started my exploration of Jails with a Linux Jail.  First thing you have to decide is what local network address you are going to assign the Jail.  At the very least, assign an address high up in the local address space - say 192.168.1.160 ..  Next you get to name the jail and finally to choose which of the two scripts to use to install it.  At the moment, there is the choice between Debian Squeeze and Gentoo.  I chose Debian, since I'm more familiar with it and just like it and intend using Debian Jails.

Once you start the script, it just works.  No deciding how big or anything like that.  The Jail uses what it needs to.  Nice.  Note the checkbox that starts the jail on system startup.  Oh, and when you shut down, the Jail is gracefully shut down before PC-BSD exits.

Upon completion, the Warden presents you with a list of your Jails and their status.  Select your Jail, and under the "Tools" tab, you can start a root terminal to use the Jail.  At the moment, the intent is text only via the terminal, however with more development, an X server environment will be easily achievable.

Would you like Wheezy or Sid with your Jail?

Whilst I am really happy that Debian is one of the two Linux distros selected for scripts to start Jails, probably because Debian has the BSD kernel available, Debian 6.0 Squeeze is old.  It is on the verge of being "Old-Stable".  Debian 7.0 Wheezy is on the verge of being the new Debian Stable for Servers.  What to do?

The answer is really, really, simple.

The shell script used to start the Debian Squeeze Jail is located in
/usr/local/share/warden/linux-installs

You can look at the script or view the source here:
http://trac.pcbsd.org/browser/pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze

Look at Line 18 of the script:
debootstrap squeeze ${jDIR}

Here you can see that the way that Debian is installed is that "debootstrap" is called to load "squeeze" over the internet.  Replace "squeeze" with "wheezy" and you will load Debian 7.0 Wheezy into the jail.  I see no reason why this should not work with Sid as well.


Now that is cool.




Later .........

Friday, January 18, 2013

PC-BSD 9.1 - Login and Control Panel

v 0.2
18 Jan 13

The first time you start PC-BSD it goes into the initial configuration, asking language, locale, checking you are happy with your video resolution and setting the root password and creating an account for you.  You are then presented with the log-in screen.  Highlight your name, and before entering your password if you look at the bottom status bar, you will see a number of selectors, one of which is for the desktop you wish to use.  Default is KDE, but I prefer Gnome or LXDE.  For the rest of this, I'll use Gnome2 as the reference (it seems to be faster than KDE) as we look around.  It is pretty much the same for all the Desktops.

Once the initial first time screens are presented when you log in, you see the desktop.  On the left are six icons if you are in Gnome.  Whilst all my autoconfiguration tasks completed successfully, there was one time they didn't - I had no network capability.  This was solved by going to the network configuration the control panel. so ...

PC-BSD Control Panel

I'm not going to go through every item here, but there are a few that are of initial interest. 
  • Under System management, the "About" selection gives you information about your system (obviously). 
  • Hardware compatibility tells you about your Video driver, resolution, whether the ethernet device is connected, wifi and the Sound device. 
  • The Network Configuration opens to a screen with a list of Network adapters - I highlighted the one (there was only one for me) and pressed the "configure" button.  I found that the device had been disabled with a check box in the bottom left hand corner - I unchecked it and then "apply" and "close".  Can't remember whether I restarted or not, but the problem was fixed.
  • There is a gui Firewall Manager - doesn't get easier than this.
  • "System Manager" - this is worth looking at.  It chooses the PC-BSD mirror you use for installing packages, which system packages you want to install and enables you to download the ports tree.

Services and Startup Applications

There are two places to see what applications and services start automatically.
  • System management > Service Manager
  • Desktop environment > Startup Applications

Tools

  • Life Preserver - this is the system backup program - it allows you to schedule your backups to a remote server if you wish
  • Warden - this application allows you to configure and manage your "Jails".  A note here would not do it all justice.


AppCafe

AppCafe is both a separate icon on the desktop and included in the Control Panel.  When you start it, it connects to a repository and presents you with an extensive list of applications you can install on your system.  Many applications are quite large - larger than you would expect.  The reason for this is that PC-BSD installs the application AND its dependencies for each application.  Yes it takes more room but it also removes the "dependency hell" that can exist when different applications expect different versions of a library.

I have not covered all selections - my aim was to cover some of the areas that were of initial interest to me and may be to you.  Once you get started, it is easy to move on from there.  Next I'll look at some of the applications that come "out of the box" and some minor issues, such as the "Attack of the Smurfs" when watching Youtube.


Later ....

Thursday, January 17, 2013

PC-BSD 9.1 - Installation Comments

 v 0.2
17 Jan 13

I wrote recently about my initial look at PC-BSD 9.1.  I gave initial installation impressions and some general thoughts about what it felt like.  I did give a detailed explanation of getting it dual-booting with Debian Linux, and emphasised that you should use an nVidia video card for best results.  Here, I'll talk in a bit more detail about the installation process.

In point form, here are the steps I went through to get the installation completed.
  • Reboot with Parted Magic
  • Once it had booted, the CD was ejected.
  • Started Gparted - tray retracted
  • Shrunk my Debian Wheezy install - shrinking and moving partitions.  There was a warning when I moved a partition that this could render the system unbootable, however this only referred to the boot partition.
  • Created a new Primary partition at the end (1.6 TB) to contain the BSD install.
  • Took over an hour to do tasks.

  • Rebooted in to Debian to make sure it worked.
  • Booted with PC-BSD DVD.
  • Default boot went into full screen graphical installer
  • English
  • Desktops - Customise - I chose all those desktops and components I wanted
  • Disk - Advanced - I chose the disk, and selected the patition I wanted from the drop-down list.  CAREFUL, default is to gobble the entire disk.
  • File system - ZFS because I have more than 2 gig memory AND I am 64 bit.
  • Left the "install bootable MBR" so that it would install the boot loader to the start of the partition, as well as the initial part on the MBR
  • IF you have multiple HDD AND you will use all of them, you have the option of configuring RAID
  • Do you want to Encrypt your data?
  • Mount point options
  • Summary
  • Start Installation

I found the PC-BSD installation screens quite straightforward, though you really do need to look and think about what you are doing.  If you make a mistake, you can always do the installation again - after all, for most of the time

There are a number of desktops that are available to be installed - they are all on the DVD.  The KDE desktop is the primary one - check which parts of the desktop you want installed.  As an example the KDE office Calligra is not installed by default.  You also have the choice of Gnome2, LXDE, XFCE, and then a host of "unsupported" desktops.

Along with the desktops, there are development, Hardware drivers (nVidia, HPLip) and Miscellaneous sections (Compiz, MythTV, VMWare and Virtualbox Guest additions) as well as a couple of other packages.  As I have said before, I would definitely want to use an nVidia video card because of its support in PC-BSD.

The ZFS file system seems to have a number of advantages when it comes to the subject of Jails, so I'm glad I installed that.  I was quite impressed that there was the option to set up a RAID array, so installing two or three identical disks could well be worthwhile.  I initially thought I might be able to do RAID 5, but I think there is only RAID 1,2 or 3.  Another great feature is being able to easily encrypt your data directories.  Excellent.



Still early days yet, but looking promising.  I have noted that using Dropbox and the like may have some limitations, but on the other hand, there are other things that can be done ...





Later ....

Tuesday, June 12, 2012

Wicd Wireless, Port Forwarding

v 0.2
12 Jun 12

Xfce Wireless

I installed Debian Wheezy onto my old IBM T31 laptop this morning.  The netinstall via a wireless network went smoothly.  I installed Xfce rather than Gnome, so the Wireless network manager was Wicd.  When I booted up, no wireless network was found.  Dead.  It should have detected at least two networks.

The fix was amazingly simple.  Open the Wicd window, Options, General.  There is an entry there for the wired "eth0".  In the Wireless entry, enter "wlan0".  

It works.

Port Forwarding and Blocked Ports

I have been driven to distraction the last week or so trying to port forward port 80 to allow some friends to play with a demonstration I've set up.  I blamed my Apple Time Capsule, particularly when I saw so many complaints that people were unable to port forward.  I bought another router, and then found THAT would not forward port 80.  Grrrrr.

I rang up my ISP over the matter and they said that they did not block port 80.  (yeah ... riiigghhhhttt)

They do.

So, I set the demo server to work on port 2000 and forwarded it from the router.

VICTORY!!

Another expensive lesson.  But I did bumble my way through it.


Later .......

Thursday, May 17, 2012

Debian - Package Management Atrocities

v 0.2
17th May 12

Flush with my success at installing "onEye" and a LAMP capability to my Wheezy server, I thought I'd have a look at the Citadel Groupware, provided in the "Main" Wheezy repository.  All went well, and I answered the configuration questions to the best of my ability.  I elected to use Apache as the web server rather than the internal one provided.  Unfortunately, I couldn't find how to run Citadel in the web mode (it ran fine in BBS command line mode).  It eventually turned out that the Webcit web client listens on port 8504 (from memory).  In any event, think carefully how you are going to use Citadel in concert with other web applications.

I decided to reconfigure the application and ran:
# dpkg-reconfigure citadel-suite

this did nothing and before I found out what I SHOULD have done, I ended up deleting some of the configuration files after mistakenly thinking I'd purged the whole thing.

What I SHOULD have done was:
# dpkg-reconfigure citadel-server citadel-webcit

Seems if I'd re-configured these packages that are called by the meta-package, all would have been well.  Lesson here.

note:  There may be some minor errors above as I've written it from memory, however the overall lesson remains.  look at re-configuring the correct packages ......


later ...