due my Sophos UTM (on amd64 Workstation) is a 24-7 device and not heavily loaded, I planned to run a simple webserver like lighttpd on my Sophos.
But due to minimal and secure concept of Sophos UTM there is no real possibility to just "copy binaries via ssh and wooosh run them".
The trick you will have to do: Run your binaries in ChrRooted mode.
Technical background
Many libraries or dependencies are not available on Sophos UTM.
To workaround the missing modules and files you will run your desired binary in a different "root" enviroment. Means:
running my binary lighttpd chrooted in /home/login/chroot. For lighttpd THIS is / - the binary will assume that this is its root file System.
You WILL HAVE TO create "Standard" Folders like etc, bin, sbin, usr, tmp in your chrooted enviroment!
Lets start.
Step A) ChRoot Enviroment based on OpenSuse
OpenSuse? Why not Debian or ubuntu? Well, Sophos is based on OpenSuse Enterprise Server. Lets stay Close to that. You can of course try to install Debian chrooted - there might be even nice guides in the web for that
1. Create a folder for your chroot enviroment: I will use
mkdir /home/login/chroot
cd /home/login/chroot
2. Create common folders
mkdir bin etc sbin lib var home temp WWW
3. Use my gz file and extract all contents to your chroot Folder
Notice: For lighttpd I've created a different "full" gz file with all dependencies in it.
Basic variant: http://www.mediafire.com/download/7m8zdg6989hzdg8/chroot_minimal.tgz
Lighttpd full variant: http://www.mediafire.com/download/e8fbypeeyjy9vdv/chroot_lighttp_full.gz
### DISCLAIMER ### I DO NOT OWN any of these binaries/libraries in the tar file provided. Nor I'm the author. Please mind that these files are copied from OpenSuse and are part of OpenSuse System. For Copyright and license Information please visit opensuse.org!
- OR -
OPTIONAL/ADVANCED
3a: Install OpenSuse (software.opensuse.org:) e.g. 64bit in any VirtualMachine to copy neccessary files and libraries: This will offer you a Major Bonus! You can use Zipper or YaST to easily download packages and extract them out of your OpenSuse machine - just copy them to the chroot enviroment and run!
Important: Use the proper architecture for OpenSuse download. Due i wanted Maximum compatibility i used the 32bit variant
3b: Install/extract/config your desired binary or Drivers
3c: Find out which dependencies you will need to copy (on OpenSuse machine):
ldd /bin/bash
ldd /path/to/desired-binary
sample Output:
ldd /bin/bash
libtermcap.so.2 => /lib/libtermcap.so.2 (0x4001e000)
libdl.so.2 => /lib/libdl.so.2 (0x40022000)
libc.so.6 => /lib/i686/libc.so.6 (0x40026000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
All these files need to be in your chroot enviroment /home/login/chroot !!
For lighttpd I created the necessary files (see above link)
So extract gz file - Target: chroot enviroment.
Caution: you will have to use "normal" ssh Connection to sophos. You can leave your chroot enviroment via:
exit
So you WILL NOT need Step B here!
Step B) Get inside your ChRoot enviroment
via console/SSH connected to your Sophos UTM run:
chroot /home/login/chroot
CAUTION: You will Need any Interpreter like /bin/bash or /bin/sh there! Otherwise no chroot "Connection" will be possible!!
Try to run your binary (after copying all neccessary files).
Do neccessary configuration...
Afterwards:
exit
Your back to your sophos!
Step C) Run! FINAL
via console/SSH connected to your Sophos UTM run:
chroot /home/login/chroot lighttpd -f /etc/lighttpd/lighttpd.conf
- OR -
chroot /home/login/chroot
Step D) Setup your binary for "autostart"
You will need to create a init.d script to run your chrooted binary automatically after your Sophos UTM booted.
I just packed an example file for my lighttpd here: http://www.mediafire.com/download/ag4f6aojjhoekea/etc.zip
(called aalighttpd - to easy find it again I used "aa" in the beginning)
Just edit it and place it in corresponding folder: /etc/init.d
You will need to create a Symlink in /etc/init.d/rc3.d ! Mine was called:
ln -s ../aalighttpd /etc/init.d/rc3.d/S00aalighttpd
Special Info for LIGHTTPD tar file:
You will Need to edit /etc/lighttpd/lighttpd.conf and other config files
Included in chroot enviroment is Perl - so you can run .cgi or .pl files via Webbrowser!
Default port: 8001
so use: http://sophosip:8001
Directory: /WWW
for authentication (Basic) edit /etc/lighttpd/lighttpdpassword !!
Default user: admin
Default password: Password
To disable authentication remove following lines in lighttpd.conf:
auth.require = ( "/" =>
(
"method" => "basic",
"realm" => "Servname",
"require" => "user=admin"
),
)
CHECK CONFIG ! This is a mandantory step. Edit e.g. serverport or Servername of lighttpd. Take your time for this step before using the webserver!
This thread was automatically locked due to age.