NSLU2-Linux
view · edit · print · history

HowTo.SimpleHomeWebsite History

Hide minor edits - Show changes to markup

January 03, 2007, at 08:52 PM by RobHam -- Changes that relate to a Recent Group Post
Changed line 85 from:

path that was created when we created the new user in step 1.

to:

path that was created when we created the new user in step 2.

January 03, 2007, at 07:05 PM by RobHam -- Changes that relate to a Recent Group Post
Changed lines 53-54 from:
/share/hdd/data/website
to:
/website
Changed line 56 from:

keying in \\196.168.1.77\website, and click the "OK" button. You will be prompted for a username and password -

to:

keying in \\192.168.1.77\website, and click the "OK" button. You will be prompted for a username and password -

Changed line 88 from:
dir=/share/hdd/data/website
to:
dir=/website
Changed lines 112-113 from:
http://196.168.1.77:81/
to:
http://192.168.1.77:81/
November 20, 2006, at 02:00 PM by michaelebrown --
Changed line 117 from:

without a huge webserver such as Apache and the overhead of a Java Virtual Machine.

to:

without the overhead of a huge webserver such as Apache and the overhead of a Java Virtual Machine or PHP.

November 20, 2006, at 01:59 PM by michaelebrown --
Changed lines 116-117 from:

This is basically how my website ByteRed is set up. I wanted to keep it lean and mean.

to:

This is basically how my website ByteRed is set up. I wanted to keep it lean and mean - without a huge webserver such as Apache and the overhead of a Java Virtual Machine.

November 04, 2006, at 05:25 PM by michaelebrown --
Changed line 125 from:
to:

Gallery Generator moved to separate page.

November 04, 2006, at 05:23 PM by michaelebrown --
Deleted lines 125-174:

Quick index.html generator for photo galleries

If you have tonns of photos you want to show your friends but never have time to really put them all in a neat webpage, this is how you can create photo galleries on your thttpd server in five minutes.

Copy the following script text into a file index.sh

##########################cut here################################
# index.sh
# Author egor@kobylkin.com
# A quick way to create thumbnailed gallery index.html 
# With Microsoft Office Picture Manager I create thumbnails with the same name as the 
# pictures themself and put them into the subfolder "Thumbs".
# Then I'd just copy whole folder with the pictures and thumbnails to the /website 
# and run this script in there.

#!/bin/bash
cat <<EOF >./index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd"><html>
<head><title>`pwd|sed 's:/website/::'`</title>
<meta http-equiv="Content-Type" content="text/html">
</head>
<body>

`ls|sed 's/ /%20/g'|egrep -v "index.html|make_pic_index.sh|Thumbs|Thumbs.db"| \
  while read entry;
  do echo "<a href=$entry><img src=Thumbs/$entry></a>"; done;`

</body>
</html>
EOF

chmod a+r ./index.html
###########################cut here######################################

Put it where your pictures are (copy paste) and and make it executable

chmod a+x index.sh

If you will be copying when you are logged in as root you will have to change ownership to "website" afterwards.

chown website,website ./index.sh

Now run it

./index.sh

Check if everything looks OK

then delete it

rm ./index.sh
November 04, 2006, at 05:22 PM by michaelebrown --
Changed line 125 from:

[Gallery Generator]

to:
November 04, 2006, at 05:21 PM by michaelebrown --
Changed lines 5-7 from:

implemented by one or the other method.

to:

implemented by one or the other method.

Added line 125:

[Gallery Generator]

September 23, 2006, at 04:51 PM by pumpkin -- pidfile in config should be changed
Changed lines 96-97 from:
to:

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

April 30, 2006, at 03:09 PM by ironstorm -- typo fix
Changed line 137 from:
  1. Then I'd just copy whole folder with the pictueres and thumbnails to the /website
to:
  1. Then I'd just copy whole folder with the pictures and thumbnails to the /website
April 30, 2006, at 05:40 AM by michaelebrown --
Changed line 18 from:

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,

to:

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,

April 30, 2006, at 05:40 AM by michaelebrown --
Changed line 18 from:

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, this might be for you. This is the approach I've used for my website,

to:

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,

April 11, 2006, at 05:34 AM by michaelebrown -- Confirmed chmod does exist with initial unslung install, and removed paragraph concerning this.
Changed lines 12-13 from:

There may be a potential exception to this; I've had conflicting reports. It appears that the original BusyBox installation may not include the chmod command, and therefore you may need to upgrade BusyBox or install some other comparable package.

to:
March 03, 2006, at 07:25 AM by michaelebrown --
Changed lines 14-15 from:

Why?

to:

Why this Article?

March 03, 2006, at 07:24 AM by michaelebrown --
Changed lines 12-13 from:

There may be a potential exception to this; I've had conflicting reports. It appears that the original BusyBox installation may not include the chmod command, and therefore you may need to upgrade BusyBox or install some other comparable package.

to:

There may be a potential exception to this; I've had conflicting reports. It appears that the original BusyBox installation may not include the chmod command, and therefore you may need to upgrade BusyBox or install some other comparable package.

March 03, 2006, at 07:23 AM by michaelebrown --
Changed lines 12-13 from:

There may be a potential exception to this; I've had conflicting reports. It appears that the original BusyBox installation may not include the chmod command, and therefore you may need to upgrade BusyBox or install some other comparable package.

to:

There may be a potential exception to this; I've had conflicting reports. It appears that the original BusyBox installation may not include the chmod command, and therefore you may need to upgrade BusyBox or install some other comparable package.

March 03, 2006, at 07:22 AM by michaelebrown --
Changed line 98 from:

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 chmod does not exist on your box, you will need to upgrade busybox. If the directories exist, you can

to:

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

March 03, 2006, at 07:20 AM by michaelebrown --
Changed lines 12-13 from:

There may be a potential exception to this; I've had conflicting reports. It appears that the original [ BusyBox? | BusyBox? ] installation may not include the chmod command, and therefore you may need to upgrade [ BusyBox? | BusyBox? ] or install some other comparable package.

to:

There may be a potential exception to this; I've had conflicting reports. It appears that the original BusyBox installation may not include the chmod command, and therefore you may need to upgrade BusyBox or install some other comparable package.

March 03, 2006, at 07:19 AM by michaelebrown --
Changed lines 11-13 from:

(Potential exception: if the chmod command does not exist on your system, you will need to upgrade busybox.)

to:

There may be a potential exception to this; I've had conflicting reports. It appears that the original [ BusyBox? | BusyBox? ] installation may not include the chmod command, and therefore you may need to upgrade [ BusyBox? | BusyBox? ] or install some other comparable package.

March 03, 2006, at 07:13 AM by michaelebrown --
Changed lines 11-13 from:

(Question for others: will this approach work with OpenSlug, etc...)

to:

(Potential exception: if the chmod command does not exist on your system, you will need to upgrade busybox.)

March 03, 2006, at 07:11 AM by michaelebrown --
Changed line 98 from:

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

to:

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 chmod does not exist on your box, you will need to upgrade busybox. If the directories exist, you can

December 30, 2005, at 05:13 PM by Egor Kobylkin com --
Added line 132:
  1. cut here################################
Added line 159:
  1. cut here######################################
December 30, 2005, at 05:12 PM by Egor Kobylkin com -- Quick index.html generator for photo galleries
Changed lines 125-126 from:
to:

Quick index.html generator for photo galleries

If you have tonns of photos you want to show your friends but never have time to really put them all in a neat webpage, this is how you can create photo galleries on your thttpd server in five minutes.

Copy the following script text into a file index.sh

# index.sh
# Author egor@kobylkin.com
# A quick way to create thumbnailed gallery index.html 
# With Microsoft Office Picture Manager I create thumbnails with the same name as the 
# pictures themself and put them into the subfolder "Thumbs".
# Then I'd just copy whole folder with the pictueres and thumbnails to the /website 
# and run this script in there.

#!/bin/bash
cat <<EOF >./index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd"><html>
<head><title>`pwd|sed 's:/website/::'`</title>
<meta http-equiv="Content-Type" content="text/html">
</head>
<body>

`ls|sed 's/ /%20/g'|egrep -v "index.html|make_pic_index.sh|Thumbs|Thumbs.db"| \
  while read entry;
  do echo "<a href=$entry><img src=Thumbs/$entry></a>"; done;`

</body>
</html>
EOF

chmod a+r ./index.html

Put it where your pictures are (copy paste) and and make it executable

chmod a+x index.sh

If you will be copying when you are logged in as root you will have to change ownership to "website" afterwards.

chown website,website ./index.sh

Now run it

./index.sh

Check if everything looks OK

then delete it

rm ./index.sh
December 15, 2005, at 02:54 PM by michaelebrown --
Changed lines 3-6 from:

Set up a home website with minimum effort. An alternative approach is VirtualHostingWithTHTTPD. My website ByteRed is an example of SimpleHomeWebsite.

to:

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.

December 15, 2005, at 02:18 PM by michaelebrown --
Changed lines 3-6 from:

Set up a home website with minimum effort. My website ByteRed is an example of this approach.

to:

Set up a home website with minimum effort. An alternative approach is VirtualHostingWithTHTTPD. My website ByteRed is an example of SimpleHomeWebsite.

December 15, 2005, at 02:26 AM by michaelebrown --
Changed lines 37-39 from:
  • Configure your home router, DSL router, or Cable modem to map incoming port 80 to port 81.*

'-Note: Remapping port 80 to 81 is a little safer than editing the original thttpd configuration file. Of course, you can set your

to:
  • Configure your home router, DSL router, or Cable modem to map incoming port 80 to port 81.

Note: Remapping port 80 to 81 is a tiny bit safer than editing the original thttpd configuration file. Of course, you can set your

Changed lines 41-42 from:

the original thttpd config file.-'

to:

the original thttpd config file.

December 15, 2005, at 02:25 AM by michaelebrown --
Changed lines 39-43 from:
'-* This is a little 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 config file - something I wanted to avoid to eliminate risk of implementation.-'

to:

'-Note: Remapping port 80 to 81 is a little 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.-'

December 15, 2005, at 02:23 AM by michaelebrown --
Changed lines 39-40 from:
* This is a little safer than editing the original thttpd configuration file.
to:
'-* This is a little 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 config file - something I wanted to avoid to eliminate risk of implementation.-'

December 15, 2005, at 02:20 AM by michaelebrown -- Removed bogus vhost setting from example
Changed lines 93-94 from:
vhost=true
to:
December 13, 2005, at 04:53 PM by michaelebrown --
Changed line 113 from:

This is basically how my website, ByteRed, is set up. I wanted to keep it lean and mean.

to:

This is basically how my website ByteRed is set up. I wanted to keep it lean and mean.

Changed lines 115-116 from:

Photoshop and ImageReady?, and a custom Java program that generates HTML from templates. The generated HTML files are transferred to the NSLU2. If you look at the HTML page source, you will also notice that some of the images

to:

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

December 13, 2005, at 04:51 PM by michaelebrown --
Deleted lines 0-1:

Still under review!

Changed lines 105-107 from:

Reboot

Voila! You should now be able to access your new website!

to:

Now reboot! Voila! You should now be able to access your new website!

December 13, 2005, at 04:50 PM by michaelebrown --
Changed lines 1-2 from:

Still under construction!

to:

Still under review!

December 13, 2005, at 04:48 PM by michaelebrown --
Changed lines 5-7 from:

Set up a home website with minimum effort.

to:

Set up a home website with minimum effort. My website ByteRed is an example of this approach.

Changed line 11 from:

Installation of Unslung.

to:

Installation of Unslung. No other software installation is required!

Changed lines 18-19 from:

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 find.

to:

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.

Changed lines 21-22 from:

ByteRed, with only a few additions, which I will outline at the bottom of this document.

to:

with only a few additions which I will outline at the bottom of this document.

Changed lines 61-62 from:

You can drag and drop, or cut and paste your HTML files into this window, which represents the directory located

to:

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

Changed lines 97-98 from:

Create a startup script for your website in /opt/etc/init.d, and make it executable. (Note: If the directories donít exist, then create them. This is very likely true if you have not installed any packages.)

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.

Added line 102:
Changed lines 107-110 from:

Voila!

Reboot. You should now be able to access your new website!

to:

Reboot

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

http://www.yourdomain.com/
http://196.168.1.77:81/
December 13, 2005, at 04:30 PM by michaelebrown -- Minimalist approach to a home website
Added lines 2-120:

Goal

Set up a home website with minimum effort.

Prerequisites

Installation of Unslung. (Question for others: will this approach work with OpenSlug, etc...)

Why?

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 find.

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, this might be for you. This is the approach I've used for my website, ByteRed, 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

* This is a little safer than editing the original thttpd configuration 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.

http://www.bytered.com/unslung/add-website-admin.gif%center%

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

/share/hdd/data/website

Add HTML files to your website from your PC, by clicking on Start->Run... and keying in \\196.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.

http://www.bytered.com/unslung/access-website-files.gif%center%

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

http://www.bytered.com/unslung/nslu2-window.gif%center%

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 1. The new config file uncommented lines should read as follows:

dir=/share/hdd/data/website
nochroot
nosymlink
user=website
pidfile=/var/run/thttpd-website.pid
cgipat=**.cgi
port=81
vhost=true

Create a startup script for your website in /opt/etc/init.d, and make it executable. (Note: If the directories donít exist, then create them. This is very likely true if you have not installed any packages.)

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

Voila!

Reboot. You should now be able to access your new website!

Footnotes

This is basically how my website, ByteRed, is set up. I wanted to keep it lean and mean. My web pages were created using Photoshop and ImageReady?, and a custom Java program that generates HTML from templates. The generated HTML files are transferred to the NSLU2. 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.
December 12, 2005, at 11:55 PM by michaelebrown --
Deleted lines 1-116:

Goal

Set up a home website with minimum effort.

Prerequisites

Installation of Unslung. (Question for others: will this approach work with OpenSlug, etc...)

Why?

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 find.

If you're looking for much beyond basic HTML pages, you'll need to continue digging through this website. But, if you're looking for a basic public website, this might be for you. This is the approach I've used for my website, ByteRed, 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

* This is a little safer than editing the original thttpd configuration 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.

http://www.bytered.com/unslung/add-website-admin.gif%center%

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

/share/hdd/data/website

Add HTML files to your website from your PC, by clicking on Start->Run... and keying in \\196.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.

http://www.bytered.com/unslung/access-website-files.gif%center%

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

http://www.bytered.com/unslung/nslu2-window.gif%center%

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.

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

Edit your new website config file 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 1. The new config file uncommented lines should read as follows:

dir=/share/hdd/data/website
nochroot
nosymlink
user=website
pidfile=/var/run/thttpd-website.pid
cgipat=**.cgi
port=81
vhost=true

Create a startup script in /opt/etc/init.d, and make it executable:

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

Voila!

Reboot. You should now be able to access your new website!

Footnotes

This is basically how my website, ByteRed, is set up. I wanted to keep it lean and mean. My web pages were created using Photoshop and ImageReady?, and a custom Java program that generates HTML from templates. The generated HTML files are transferred to the NSLU2. 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.
December 12, 2005, at 11:46 PM by michaelebrown --
Changed line 36 from:
  • Register you domain name.
to:
  • Register your domain name.
Changed lines 40-41 from:

* This is a little safer than editing the original thttpd configuration file.

to:
* This is a little safer than editing the original thttpd configuration file.
Changed lines 80-82 from:
cp /etc/thttpd.conf /opt/etc/thttpd-website.conf
cd /opt/etc
to:
cp /etc/thttpd.conf /opt/etc/thttpd-website.conf
cd /opt/etc
Changed lines 98-101 from:
cd /opt/etc/init.d
echo "/usr/sbin/thttpd -C /opt/etc/thttpd-website.conf" >S90mywebsite
chmod +x S90mywebsite
to:
cd /opt/etc/init.d
echo "/usr/sbin/thttpd -C /opt/etc/thttpd-website.conf" >S90website
chmod +x S90website
December 12, 2005, at 11:32 PM by michaelebrown --
Deleted lines 18-19:

This "How To" focuses on the minimalist approach.

Added lines 22-24:

This "How To" focuses on the minimalist approach.

Changed lines 38-39 from:
  • Configure your router to map port 80 to port 81.
to:
  • Configure your home router, DSL router, or Cable modem to map incoming port 80 to port 81.*

* This is a little safer than editing the original thttpd configuration file.

Changed lines 46-49 from:
 and click on the "Save as New User" button.

http://www.bytered.com/unslung/add-website-admin.gif

to:

and click on the "Save as New User" button.

http://www.bytered.com/unslung/add-website-admin.gif%center%

Changed lines 58-59 from:

http://www.bytered.com/unslung/access-website-files.gif

to:

http://www.bytered.com/unslung/access-website-files.gif%center%

Changed lines 64-68 from:

http://www.bytered.com/unslung/nslu2-window.gif

to:

http://www.bytered.com/unslung/nslu2-window.gif%center%

Changed line 77 from:

Telnet into your NSLU2 EnableTelnetThroughTheWebInterface?,

to:
December 12, 2005, at 11:21 PM by michaelebrown --
Changed line 74 from:

Telnet into your NSLU2 EnableTelnetThroughTheWebInterface?, go the to "etc" directory,

to:

Telnet into your NSLU2 EnableTelnetThroughTheWebInterface?,

Changed lines 77-78 from:
cd /etc
cp thttpd.conf /opt/etc/thttpd-website.conf
to:
cp /etc/thttpd.conf /opt/etc/thttpd-website.conf
Changed line 90 from:
port=80
to:
port=81
Changed line 109 from:

and larger are referenced from my mindspring account - sort of like using Mindspring for my image server.

to:

and larger files are pulled from my mindspring account - sort of like using Mindspring for my image server.

December 12, 2005, at 11:17 PM by michaelebrown --
Changed line 28 from:
  1. Register your domain name
to:
  1. Configure the outside world
Changed lines 30-37 from:
  1. Reconfigure the existing thttpd server

Step 1: Register your domain name

Talk to your internet provider about a static IP address for your home, or see DynDNSupdate and SetUpYourOwnStaticLinkToYourSiteAtADynamicIP.

to:
  1. Configure additional thttpd server

Step 1: Configure the outside world

Changed lines 42-43 from:

Fill in the bottom portion of the admin page as shown, and click on the "Save as New User" button.

to:

Fill in the bottom portion of the admin page as shown (choose your own password),

 and click on the "Save as New User" button.
Changed lines 47-48 from:

This will create a directory on your NSLU2 at location...

to:

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

Changed lines 52-53 from:

keying in \\196.168.0.77\website, and click the "OK" button.

to:

keying in \\196.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.

Changed lines 66-68 from:

Step 3: Reconfigure the existing thttpd server

No further software installation is required.

to:

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.

Changed lines 74-75 from:

Telnet into your NSLU2 (see EnableTelnetThroughTheWebInterface? ), and go the to "etc" directory.

to:

Telnet into your NSLU2 EnableTelnetThroughTheWebInterface?, go the to "etc" directory, and create a copy of the original admin thttpd config file as a starting point for your new website config file.

Changed lines 78-88 from:

Edit the original admin website config file, thttpd.conf, and change the port number from 80 to 81 (or another port if you wish). The two instances of thttpd must use different port numbers, and it's more typical for the public website to use port 80. You must use this new port number when you want to access the administrative pages for the NSLU2, with a URL of http://192.128.0.77:81/.''

The uncommented lines in the admin website config file should now be as follows:

dir=/share/hdd/data/www
to:
cp thttpd.conf /opt/etc/thttpd-website.conf
cd /opt/etc

Edit your new website config file 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 1. The new config file uncommented lines should read as follows:

dir=/share/hdd/data/website
Changed lines 88-89 from:
user=root# default = nobody
pidfile=/var/run/thttpd.pid
to:
user=website
pidfile=/var/run/thttpd-website.pid
Changed line 91 from:
port=81
to:
port=80
Deleted lines 93-109:

Copy the original admin website config file as a starting point for your website config file.

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

Edit your new website config file 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 1. The new config file uncommented lines should read as follows:

dir=/share/hdd/data/website
nochroot
nosymlink
user=website
pidfile=/var/run/thttpd-website.pid
cgipat=**.cgi
port=80
vhost=true
December 12, 2005, at 10:53 PM by michaelebrown --
Changed lines 3-4 from:

Goal:

to:

Goal

Changed lines 8-9 from:

Prerequisites:

to:

Prerequisites

Changed lines 13-14 from:

Why?

to:

Why?

Added lines 24-25:

Overview

Changed lines 33-37 from:

Step 1: Register your domain name

Step 2: Install your HTML files

to:

Step 1: Register your domain name

Talk to your internet provider about a static IP address for your home, or see DynDNSupdate and SetUpYourOwnStaticLinkToYourSiteAtADynamicIP.

Step 2: Install your HTML files

Changed lines 41-42 from:

Fill in the bottom portion of the admin page as shown, and click on the "Create" button.

to:

Fill in the bottom portion of the admin page as shown, and click on the "Save as New User" button.

Changed lines 54-55 from:

You can drag and drop, or cut and paste your HTML files into this window, which is located

to:

You can drag and drop, or cut and paste your HTML files into this window, which represents the directory located

Changed lines 63-64 from:

Step 3: Reconfigure the existing thttpd server

to:

Step 3: Reconfigure the existing thttpd server

Changed lines 70-71 from:

Telnet or ssh into your NSLU2 (see ?), and go the to "etc" directory.

to:

Telnet into your NSLU2 (see EnableTelnetThroughTheWebInterface? ), and go the to "etc" directory.

Changed line 88 from:
cgipat=**.cgi''
to:
cgipat=**.cgi
Changed lines 94-96 from:
cp thttpd.conf thttpd-website.conf

Edit your new website config file and change dir=, pidfile=, and port=. Notice that the value of dir= matches the

to:
cp thttpd.conf /opt/etc/thttpd-website.conf

Edit your new website config file and change dir=, user=, pidfile=, and port=. Notice that the value of dir= matches the

Changed line 103 from:
user=root# default = nobody
to:
user=website
Changed line 112 from:
echo "/usr/sbin/thttpd -C /etc/thttpd-website.conf" >S90mywebsite
to:
echo "/usr/sbin/thttpd -C /opt/etc/thttpd-website.conf" >S90mywebsite
Changed lines 115-116 from:

Voila!

to:

Voila!

Changed lines 119-120 from:

Footnotes

to:

Footnotes

Changed lines 126-127 from:
to:

I also use openssh instead of telnet.

December 12, 2005, at 10:22 PM by michaelebrown --
Changed lines 20-21 from:

If you're looking for much beyond basic HTML pages, you'll need to continue digging through this website. But, if you're looking for a basic public website, 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.

to:

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

Deleted lines 112-117:

Further Reading

Please add additional links here...

If you're interested

Changed line 114 from:

This is basically how my website, [[ http://bytered.com/ | ByteRed? ] is set up. I wanted to keep it lean and mean.

to:

This is basically how my website, ByteRed, is set up. I wanted to keep it lean and mean.

December 12, 2005, at 10:19 PM by michaelebrown --
Changed lines 28-35 from:

Voila!

Register your domain name

Install your HTML files

to:

Step 1: Register your domain name

Step 2: Install your HTML files

Changed lines 41-42 from:
    /share/hdd/data/website
to:
/share/hdd/data/website
Changed lines 44-45 from:

keying in \\196.128.1.77\website, and click the "OK" button.

to:

keying in \\196.168.0.77\website, and click the "OK" button.

Changed lines 51-53 from:

Configuration:

No further software installation is *required*.

to:

http://www.bytered.com/unslung/nslu2-window.gif

Step 3: Reconfigure the existing thttpd server

No further software installation is required.

Changed lines 65-66 from:
    cd /etc
to:
cd /etc
Changed lines 72-84 from:

pages for the NSLU2, with a URL of http://192.128.1.77:81/.

The *uncommented" lines in the admin website config file should now be as follows:

    dir=/share/hdd/data/www
    nochroot
    nosymlink
    user=root# default = nobody
    pidfile=/var/run/thttpd.pid
    cgipat=**.cgi
    port=81
    vhost=true
to:

pages for the NSLU2, with a URL of http://192.128.0.77:81/.''

The uncommented lines in the admin website config file should now be as follows:

dir=/share/hdd/data/www
nochroot
nosymlink
user=root# default = nobody
pidfile=/var/run/thttpd.pid
cgipat=**.cgi''
port=81
vhost=true
Changed lines 87-100 from:
    cp thttpd.conf thttpd-website.conf

Edit your new website config file and change *dir*, *pidfile*, and *port*. The new config file *uncommented* lines should read as follows:

    dir=/share/hdd/data/website
    nochroot
    nosymlink
    user=root# default = nobody
    pidfile=/var/run/thttpd-website.pid
    cgipat=**.cgi
    port=80
    vhost=true
to:
cp thttpd.conf thttpd-website.conf

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

dir=/share/hdd/data/website
nochroot
nosymlink
user=root# default = nobody
pidfile=/var/run/thttpd-website.pid
cgipat=**.cgi
port=80
vhost=true
Changed lines 104-108 from:
    cd /opt/etc/init.d
    echo "/usr/sbin/thttpd -C /etc/thttpd-website.conf" >S90mywebsite
    chmod +x S90mywebsite
to:
cd /opt/etc/init.d
echo "/usr/sbin/thttpd -C /etc/thttpd-website.conf" >S90mywebsite
chmod +x S90mywebsite

Voila!

Changed lines 112-124 from:
to:

Further Reading

Please add additional links here...

If you're interested

Footnotes This is basically how my website, [[ http://bytered.com/ | ByteRed? ] is set up. I wanted to keep it lean and mean. My web pages were created using Photoshop and ImageReady?, and a custom Java program that generates HTML from templates. The generated HTML files are transferred to the NSLU2. If you look at the HTML page source, you will also notice that some of the images and larger are referenced from my mindspring account - sort of like using Mindspring for my image server.

December 12, 2005, at 09:58 PM by michaelebrown --
Changed lines 1-110 from:

Under construction by michaelebrown.

to:

Still under construction!

Goal:

Set up a home website with minimum effort.

Prerequisites:

Installation of Unslung. (Question for others: will this approach work with OpenSlug, etc...)

Why?

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 find.

This "How To" focuses on the minimalist approach.

If you're looking for much beyond basic HTML pages, you'll need to continue digging through this website. But, if you're looking for a basic public website, 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.

The creation of your home website requires three steps:

  1. Register your domain name
  2. Install your HTML files
  3. Reconfigure the existing thttpd server

Voila!

Register your domain name

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, and click on the "Create" button.

http://www.bytered.com/unslung/add-website-admin.gif

This will create a directory on your NSLU2 at location...

    /share/hdd/data/website

Add HTML files to your website from your PC, by clicking on Start->Run... and keying in \\196.128.1.77\website, and click the "OK" button.

http://www.bytered.com/unslung/access-website-files.gif

You can drag and drop, or cut and paste your HTML files into this window, which is located on your NSLU2.

Configuration:

No further software installation is *required*.

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

Telnet or ssh into your NSLU2 (see ?), and go the to "etc" directory.

    cd /etc

Edit the original admin website config file, thttpd.conf, and change the port number from 80 to 81 (or another port if you wish). The two instances of thttpd must use different port numbers, and it's more typical for the public website to use port 80. You must use this new port number when you want to access the administrative pages for the NSLU2, with a URL of http://192.128.1.77:81/.

The *uncommented" lines in the admin website config file should now be as follows:

    dir=/share/hdd/data/www
    nochroot
    nosymlink
    user=root# default = nobody
    pidfile=/var/run/thttpd.pid
    cgipat=**.cgi
    port=81
    vhost=true

Copy the original admin website config file as a starting point for your website config file.

    cp thttpd.conf thttpd-website.conf

Edit your new website config file and change *dir*, *pidfile*, and *port*. The new config file *uncommented* lines should read as follows:

    dir=/share/hdd/data/website
    nochroot
    nosymlink
    user=root# default = nobody
    pidfile=/var/run/thttpd-website.pid
    cgipat=**.cgi
    port=80
    vhost=true

Create a startup script in /opt/etc/init.d, and make it executable:

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

Reboot. You should now be able to access your new website!

michaelebrown@bytered.com from NSLU2 website ByteRed.
December 12, 2005, at 08:10 PM by michaelebrown --
Added line 1:

Under construction by michaelebrown.

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