NSLU2-Linux
view · edit · print · history

Goal

Set up a home website with minimum effort. An alternative approach is VirtualHostingWithTHTTPD. Both of these methods are fairly easy, and both can provide you with a home website. Depending upon the week you visit my site ByteRed, it may be implemented by one or the other method.

Prerequisites

Installation of Unslung. No other software installation is required!

Why this Article?

I've had several emails from people looking for a detailed but simple way to set up a home website. There are many different ways to set up a publicly viewable website and much documentation available here concerning this topic. Perhaps too much information is available these days due to the astounding success of this Wiki. Presented with this abundance of information, the choices are less clear and the solutions more difficult to fathom.

If you're looking for much beyond basic HTML pages and scripting CGI, you'll need to continue digging through this website. But, if you're looking for a basic public website using static HTML pages, this might be for you. This is the approach I've used for my website, with only a few additions which I will outline at the bottom of this document.

This "How To" focuses on the minimalist approach.

Overview

The creation of your home website requires three steps:

  1. Configure the outside world
  2. Install your HTML files
  3. Configure additional thttpd server

Step 1: Configure the outside world

Note: Remapping port 80 to 81 is a tiny bit safer than editing the original thttpd configuration file. Of course, you can set your website to use port 80, and the the admin server to run on a port other than 80, but this means you will need to alter the original thttpd config file.

Step 2: Install your HTML files

Using the NSLU2 administrative user page, create a new user called, "website". Fill in the bottom portion of the admin page as shown (choose your own password), and click on the "Save as New User" button.

This will create a new user, and a new directory on your NSLU2 at location...

/website

Add HTML files to your website from your PC, by clicking on Start->Run... and keying in \\192.168.1.77\website, and click the "OK" button. You will be prompted for a username and password - provide the same as when you created the user.

You can now drag and drop, or cut and paste your HTML files into this window, which represents the home directory of your website located on your NSLU2.

Step 3: Configure additional thttpd server

No further software installation is required. If you want to install Apache, Php, mySQL, or anything else, look to another page.

We are simply going to run two instances of the webserver, thttpd, which is already used for the NSLU2 admin interface.

Telnet into your NSLU2 and create a copy of the original admin thttpd config file as a starting point for your new website config file.

cd /etc
cp thttpd.conf thttpd-website.conf

Edit your new website config file, thttpd-website.conf, and change dir=, user=, pidfile=, and port=. Notice that the value of dir= matches the path that was created when we created the new user in step 2. The new config file uncommented lines should read as follows:

dir=/website
nochroot
nosymlink
user=website
pidfile=/var/run/thttpd-website.pid
cgipat=**.cgi
port=81

Note: changing the pidfile is a GOOD idea. W/o changing only one of the two server will start.

Use the following commands to create a startup script for your website in /opt/etc/init.d, and make it executable. If you have not installed any packages you will probably need to create two directories as shown in the first two commands. If the directories exist, you can skip the mkdir commands.

mkdir /opt/etc
mkdir /opt/etc/init.d
cd /opt/etc/init.d
echo "/usr/sbin/thttpd -C /etc/thttpd-website.conf" >S90website
chmod +x S90website

Now reboot! Voila! You should now be able to access your new website! Both of these URLs should now work:

http://www.yourdomain.com/
http://192.168.1.77:81/

Footnotes

This is basically how my website ByteRed is set up. I wanted to keep it lean and mean - without the overhead of a huge webserver such as Apache and the overhead of a Java Virtual Machine or PHP. My web pages were created using Adobe Photoshop and ImageReady, and a custom Java program that generates HTML from templates. The generated HTML files are transferred to the NSLU2 using ftp. If you look at the HTML page source, you will also notice that some of the images and larger files are pulled from my mindspring account - sort of like using Mindspring for my image server. I also use openssh instead of telnet.

michaelebrown@bytered.com from NSLU2 website ByteRed.

Gallery Generator moved to separate page.

view · edit · print · history · Last edited by RobHam.
Based on work by RobHam, michaelebrown, pumpkin, ironstorm, and Egor Kobylkin com.
Originally by michaelebrown.
Page last modified on January 03, 2007, at 08:52 PM