Return to site

Install Apache In Freenas Jail Host

broken image


  1. Freenas Jail Network
  2. Freenas Ssh Into Jail
05 Oct 2017

I've been running a NAS at home since Netgear released the first ARM-powered ReadyNAS device in 2007. It wasn't particularly fast, but it did a great job of being a NAS (i.e. keeping my data safe). It also had a decent community following that packaged software into easy to install plugins, such as Transmission for downloading torrents and Twonky for serving up media. This worked great until I developed a backup plugin that needed to do compression and encryption - then the CPU started to show its age.

Installing GitWeb on FreeNAS Learn how to install GitWeb to browse the repositories on your server. Build the Git package from the Ports collection to install GitWeb on an Apache server. Optionally, configure access over HTTPS and LDAP authentication. Preparing the jail; Installing GitWeb from Ports; Configuring the web service. Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un.x-like operating systems. It only takes a minute to sign up. Many users install a variety of web applications in jails on their FreeNAS servers, and often those applications run on non-standard ports like 6789, 8181, 7878, etc. These port numbers are far from intuitive, and the applications often either don't implement HTTPS at all, or make it difficult to configure. I only know little bit about Freenas (and Freebsd) but install Freenas 0.7.1 Shere (revision 5127) and follow the procedures mentioned above to install mysql, php & phpAdmin. And face the same problem. I use pkgdelete to remove mysql-client-5.1.33 and mysql-server-5.1.33 being installed.

Network

Some point in 2011 I upgraded to an HP Microserver running FreeNAS 8. FreeNAS also had a plugin architecture using FreeBSD jails (essentially small chrooted environments for applications to run in), so I could install the software I'd used previously as well as some cool new things - Crashplan, Plex, etc.

This ticked along nicely for a few years until I had a disk failure. I should have heard alarm bells ringing when the second-top Google result for 'FreeNAS replace failed disk' was a bunch of FreeNAS forum posts with lots of people asking the same thing over and over, each with similar (but not the same results!). The top Google result are the FreeNAS docs, and they are dreadful. Searching 'zfs replace failed disk' yielded slightly better results and at least some readable documentation.

I eventually made my way to FreeNAS 9 but yet more hardware failures followed, this time the USB stick with the FreeNAS system partition on it crapped out. Data still intact (and a full backup stashed away in Crashplan), but no OS to read it. FreeNAS Corral had been out about a month at that point, so I fired up a fresh USB stick and loaded it on. Thankfully it was reasonably trivial to import my data and everything was up and running after a few hours.

The Xen Project now works with The Linux Foundation in promoting open source applications.It is especially used for advanced virtualization, not least for servers, in both commercial and open source environments. This includes but is not restricted to Infrastructure as a Service (IaaS) applications, desktop virtualization, and security virtuzlised. Install qemu for mac virtualbox. The Xen Project software is even being used in automotive and aviation systems.The service is especially applicable for hyperscale clouds, and can easily be used with AWS, Azure, Rackspace, IBM Softlayer, and Oracle. A key emphasis is on security by using as small a code base as possible, making it not just secure but especially flexible.(Image credit: Microsoft Hyper-V).

Install Apache In Freenas Jail Host

Then I tried to reboot it….and waited. And waited. Hmmm. Must be a one off. Power off, try again…another hang. Try again…wait…and eventually it came online and everything seemed ok. Unfortunately (for me), within a few days FreeNAS Corral started to show its immaturity - the web UI would become unresponsive, it'd randomly drop off the network, the reboot instability continued, and the CPU would get mashed when it was seemingly sat there idle. Then…THEN, the guys at iXSystems decided that FreeNAS Corral wasn't a real release after all, but it was actually a 'tech preview'. Wait, what?

It was at this point I thought 'why on earth am I bothering with this crap?' - my career is based around building stable systems that process obscene amounts of data, so I should put this into practise and build something simple that 'just works'.

And I did.

Ansible-NAS is as simple as it gets whilst being packed with features - a barebones Ubuntu LTS image, Samba for sharing data, Linux ZFS so I could just import my ZFS disk pools with minimal messing about, and best of all - a Docker host to run up whatever I please at any point in time. Not a crappy FreeNAS-style unstable Docker host, but a real one that works and stays online. With the flexibility Docker brings, I've included a bunch of (switchable) Docker images that most people running their own NAS would find useful:

  • Transmission for downloading torrents
  • Crashplan for data backup
  • Couchpotato for managing movies
  • Sonarr for managing a music collection
  • Glances for a quick web-based view of the system status
  • Portainer for managing the Docker host and running ad-hoc containers

I've been running it myself now for a few months, and guess what? It's rock solid.

Install Apache In Freenas Jail Host

Try it out and let me know what you think. If there's something missing you'd love to see added, submit a pull request - contributions are welcome!

Related Posts

I had some free time this weekend and decided to upgrade my FreeNAS. I went from 11.1 to 11.3-UI and the upgrade installed without any issues. However, after the reboot I discovered that my jails and plugins were missing from the UI and that they were not running. I had read the manual (FreeNAS® 11.3-U1 User Guide) before the upgrade and and the instructions did not mention anything about the plugins, so I was little worried.

After spending a lot of time researching I discovered that on FreeNAS 11.2 the project started to use the ‘iocage' jail method instead of ‘warden'. FreeNAS 11.2 had the option of migrating your jails, and it could even display then from the UI. But for 11.3-UI that was no longer an option.

If you are on the same boat as me, the instructions below will help you quickly re-create a new Plex jail a move your old data to the new jail. If you have not upgraded to 11.3-UI you might want to convert your jail before upgrading. There are a lot of tutorials on-line on how to convert your jail that might be more useful to you.

Instructions

a. Create the plex user with UID 972 (this is the username and UID that is used by the project)

b. If desired, create a new Dataset to have Plex data outside of the plugin Dataset. I won't go into details for this type of setup here as I keep my Plex data inside the Plex plugin Dataset

c. Install the ‘Plex Media Server' plugin (official instructions)

d. Stop the plugin

e. Go to ‘Storage => Pools' and edit the ACL for the Dataset where your media is saved. We want to give access to the ‘plex' user (in case the files are not owned by ‘plex')

f. With the plugin still stopped, copy the old installation data folder from the old plugin Dataset to the new plugin Dataset

Note: The JAIL_ROOT location will vary between different FreeNAS versions:

  • FreeNAS 11.1 and bellow (warden) - JAIL_ROOT=/mnt/[Volume]/jails/[JAIL_NAME]
  • FreeNAS 11.2 and above (iocage) - JAIL_ROOT=/mnt/[Volume]/iocage/jails/[JAIL_NAME]

Source for your old Plex plugin (warden)

If installed manually

Install apache in freenas jail hostel

Some point in 2011 I upgraded to an HP Microserver running FreeNAS 8. FreeNAS also had a plugin architecture using FreeBSD jails (essentially small chrooted environments for applications to run in), so I could install the software I'd used previously as well as some cool new things - Crashplan, Plex, etc.

This ticked along nicely for a few years until I had a disk failure. I should have heard alarm bells ringing when the second-top Google result for 'FreeNAS replace failed disk' was a bunch of FreeNAS forum posts with lots of people asking the same thing over and over, each with similar (but not the same results!). The top Google result are the FreeNAS docs, and they are dreadful. Searching 'zfs replace failed disk' yielded slightly better results and at least some readable documentation.

I eventually made my way to FreeNAS 9 but yet more hardware failures followed, this time the USB stick with the FreeNAS system partition on it crapped out. Data still intact (and a full backup stashed away in Crashplan), but no OS to read it. FreeNAS Corral had been out about a month at that point, so I fired up a fresh USB stick and loaded it on. Thankfully it was reasonably trivial to import my data and everything was up and running after a few hours.

The Xen Project now works with The Linux Foundation in promoting open source applications.It is especially used for advanced virtualization, not least for servers, in both commercial and open source environments. This includes but is not restricted to Infrastructure as a Service (IaaS) applications, desktop virtualization, and security virtuzlised. Install qemu for mac virtualbox. The Xen Project software is even being used in automotive and aviation systems.The service is especially applicable for hyperscale clouds, and can easily be used with AWS, Azure, Rackspace, IBM Softlayer, and Oracle. A key emphasis is on security by using as small a code base as possible, making it not just secure but especially flexible.(Image credit: Microsoft Hyper-V).

Then I tried to reboot it….and waited. And waited. Hmmm. Must be a one off. Power off, try again…another hang. Try again…wait…and eventually it came online and everything seemed ok. Unfortunately (for me), within a few days FreeNAS Corral started to show its immaturity - the web UI would become unresponsive, it'd randomly drop off the network, the reboot instability continued, and the CPU would get mashed when it was seemingly sat there idle. Then…THEN, the guys at iXSystems decided that FreeNAS Corral wasn't a real release after all, but it was actually a 'tech preview'. Wait, what?

It was at this point I thought 'why on earth am I bothering with this crap?' - my career is based around building stable systems that process obscene amounts of data, so I should put this into practise and build something simple that 'just works'.

And I did.

Ansible-NAS is as simple as it gets whilst being packed with features - a barebones Ubuntu LTS image, Samba for sharing data, Linux ZFS so I could just import my ZFS disk pools with minimal messing about, and best of all - a Docker host to run up whatever I please at any point in time. Not a crappy FreeNAS-style unstable Docker host, but a real one that works and stays online. With the flexibility Docker brings, I've included a bunch of (switchable) Docker images that most people running their own NAS would find useful:

  • Transmission for downloading torrents
  • Crashplan for data backup
  • Couchpotato for managing movies
  • Sonarr for managing a music collection
  • Glances for a quick web-based view of the system status
  • Portainer for managing the Docker host and running ad-hoc containers

I've been running it myself now for a few months, and guess what? It's rock solid.

Try it out and let me know what you think. If there's something missing you'd love to see added, submit a pull request - contributions are welcome!

Related Posts

I had some free time this weekend and decided to upgrade my FreeNAS. I went from 11.1 to 11.3-UI and the upgrade installed without any issues. However, after the reboot I discovered that my jails and plugins were missing from the UI and that they were not running. I had read the manual (FreeNAS® 11.3-U1 User Guide) before the upgrade and and the instructions did not mention anything about the plugins, so I was little worried.

After spending a lot of time researching I discovered that on FreeNAS 11.2 the project started to use the ‘iocage' jail method instead of ‘warden'. FreeNAS 11.2 had the option of migrating your jails, and it could even display then from the UI. But for 11.3-UI that was no longer an option.

If you are on the same boat as me, the instructions below will help you quickly re-create a new Plex jail a move your old data to the new jail. If you have not upgraded to 11.3-UI you might want to convert your jail before upgrading. There are a lot of tutorials on-line on how to convert your jail that might be more useful to you.

Instructions

a. Create the plex user with UID 972 (this is the username and UID that is used by the project)

b. If desired, create a new Dataset to have Plex data outside of the plugin Dataset. I won't go into details for this type of setup here as I keep my Plex data inside the Plex plugin Dataset

c. Install the ‘Plex Media Server' plugin (official instructions)

d. Stop the plugin

e. Go to ‘Storage => Pools' and edit the ACL for the Dataset where your media is saved. We want to give access to the ‘plex' user (in case the files are not owned by ‘plex')

f. With the plugin still stopped, copy the old installation data folder from the old plugin Dataset to the new plugin Dataset

Note: The JAIL_ROOT location will vary between different FreeNAS versions:

  • FreeNAS 11.1 and bellow (warden) - JAIL_ROOT=/mnt/[Volume]/jails/[JAIL_NAME]
  • FreeNAS 11.2 and above (iocage) - JAIL_ROOT=/mnt/[Volume]/iocage/jails/[JAIL_NAME]

Source for your old Plex plugin (warden)

If installed manually

${JAIL_ROOT}/root/usr/local/plexdata/Plex Media Server/

If installed via plugin

${JAIL_ROOT}/var/db/plexdata/Plex Media Server/

Destination (iocage)

${JAIL_ROOT}/root/Plex Media Server/

g. In the jails configuration menu, select the new Plex jail and add the mount point for the media folder. Try to keep the same path as the old jail so you won't have to edit your library. If you don't remember that the path was, you can access it by looking at the contents of /mnt/[Volume]/jails/.[JAIL_NAME].meta/fstab

Freenas Jail Network

h. Start the plugin and try to access it via web

Freenas Ssh Into Jail

References:





broken image