Thanks for the guide, I've installed it successfully. But every time I access my webpage into the browser (i.e. 192.168.0.145:8081) it says "404 - Not Found". Any help would be appreciated. :)
How To Run a Web Server on Your Pogoplug With Lighttpd and OpenPogo
Categories: Pogoplug PogoPlug Development
*** UPDATE: Note that OpenPogo has been updated to PlugApps, and there are numerous compatibility issues with the upgraded V2 Pogoplug. These instructions apply to V1 Pogoplugs only, at the state OpenPogo was in when the article was written. For more information on the current state of PlugApps for both versions of Pogoplug, click here and here. ***
Basically everyone has a personal website these days, in addition to a blog and various other online properties. Often, individuals (like myself) have a variety of personal sites as well as a professional site. A virtually infinite quantity of web hosting services are available, and they are truly great solutions, but there are those times where one might prefer to host their website themselves.
The Pogoplug makes a surprisingly great platform for a simple web server that even supports MySQL and PHP, and can use websites hosted on your attached USB drive. Let's learn how to do this with the OpenPogo software package and Lighttpd (pronounced "Lighty.")
Installing Lighttpd on OpenPogo
Ready to begin? This is much easier than you might think. First, you'll need to SSH or PuTTY into your Pogoplug. Then, run this command:
ipkg install lighttpd nano

If successful, you will see a terminal output like you see displayed above. Now, run this command:
mkdir -p /var/run/
Optionally, if your website needs PHP, you can run this command:
ipkg install lighttpd nano php fcgi php-fcgi

If successful, you'll see an output like you see above.
Configuring Lighttpd
Go ahead and type this into your Terminal or PuTTY now:
nano /opt/etc/lighttpd/lighttpd.conf
This will open the Lighttpd configuration file in the Nano text editor... if you've installed other OpenPogo applications before, you'll be familiar with this.

First, scroll down to the area of the file that you see above, the server.document-root property. This tells Lighttpd where your website is located. You can choose to dump the files in that area, but I preferred to set the location to my attached USB drive. If you have one drive connected with one partition, you will use this location:
/tmp/.cemnt/mnt_sda1/Website
"Website" is the directory where your website will be held on your USB drive. You can name this whatever you like, but it will not be created automatically, so make sure you create it. If you have more than one partition on your USB connected drive, "mnt_sda1" is the first partition, "mnt_sda2" is the second, and so on. If you have more than one USB drive attached, "mnt_sdb1" is the first partition on the second drive, and so on.

Next, as shown in the photo above, look for the server.port setting. This cannot be set to port 80! Change it to 8081, which is your best bet for this situation and is open, but I'm betting you could use other open ports. In my setup, this was actually the default setting, but if it isn't for you, then you must change it.

Optionally, if you want to enable PHP, locate the setting above and uncomment it.
Once you're finished, press Ctrl-X, Yes, then Enter to save your changes.
Running Lighttpd
Ok, now you need to start the web server! Here's the command:
/opt/etc/init.d/S80lighttpd start

If successful, you will see the screen above - your web server is now running. You can test it out by uploading a website to the directory you specified earlier, then navigating to your Pogoplug's IP address with port 8081.

You can see in the photo above that my installation was successful.
Accessing your Pogoplug Hosted Site Externally
Of course, none of this does you any good if users cannot access the site over the Internet. The easiest way to get this going quickly is with DynDNS - a service that allows you, for free, to choose a custom domain name that will forward to your WAN IP from outside of your network.

Before you do that, though, you'll need to open port 8081 on your router to allow external clients to access the site stored on your Pogoplug... and accept the risks involved in doing this. Shown above are my port forwarding settings in my router - simply forward port 8081 to the IP address of your Pogoplug.
Once this is complete, and you have DynDNS set up, you'll be able to access your site from outside your network using the following type of address, which you will choose when you register:
http://yourusername.yourdyndnsdomain.org:8081
Moving Forward
There are many other possibilities, such as purchasing your own custom domain and forwarding it to your website stored on your Pogoplug, that you can explore on your own. This solution is probably best for a website for your own personal use or something shared with family and friends (i.e., low bandwidth.) I have not conducted any tests as far as to how much traffic the Pogoplug can handle properly, and I'd be interested to hear from site users who are utilizing the Pogoplug for a site with large amounts of traffic.
Cheers, and enjoy your new $99 web server! Many thanks for OpenPogo for continued development of these great applications.
Hmm, as long as you have indicated the correct directory in lighttpd's config file, you should be good to go.
Upload your site into the root of the directory you indicated; that is, not nested inside another folder. I believe lighttpd looks for the index.html file to load up your site. It worked for me just fine.
If you have a different type of site, such as a Wiki, you may have to point it to an individual PHP file to get it to load your site.
Thanks for that quick reply. I was able to load my website already. I forgot to change the directory in the config file. ><
This works great, thanks for the guide! I'm only doing this as a hobby for now, mainly just to see if it works, and to use occasionally to share pictures with friends and family. If I'm only going to use it occasionally, it's ok to send the URL out in this format isn't it?
http://66.xxx.xx.xx:8081
It's not as friendly as using a domain name with DynDNS, but it should be ok for occasional use shouldn't it? There's nothing inherently wrong is there, other than I have to be aware in case the IP address changes?
There's nothing "wrong" with that, but you're correct that if the IP changes, you would need to give out the new IP.
Personally, even if it were just with friends and family, I would only give out a forwarded (i.e., DynDNS) address. I think it's usually a bad idea to share your WAN IP address in general.
Truthfully, DynDNS is so easy to use (and free) I can't see why you wouldn't want to use it - especially since it's dynamic and you wouldn't have to worry about a changing IP.
Now, for personal use (like if you were using it for a GTD app or a personal wiki or something like that) that would of course be no big deal.
OK thanks, you've convinced me; I'll use DynDNS. I'll sign up for their free service and use the update client in my router.
Thanks,
Lee
I've got an error message after:
-bash-3.2# /opt/etc/init.d/S80lighttpd start
Starting web server: lighttpd
2010-04-09 20:44:48: (server.c.657) opening pid-file failed: /var/run/lighttpd.pid No such file or directory
may you help me?
Wow this is a great web server for sure. I am using hostings to host my websites for sure, but while they are in the developing process I am using only server based on my own computer. It would be really hard to upload new information every time when I change something to the FTP. That's why those local servers are really useful. I have used the local server called "Denver" earlier: it is something with Apache in the pack. Now I see that Lighttpd on Openpogo may be the better choice for sure. I will definitely try it out in the nearest future. Thanks for such a detailed and informative tutorial on Lighttpd. It is always easier to use something new when it is well explained. I will be waiting for more nice articles from you in the future too. Good luck!
Regards, Craig Turner from web development
@over.unity - create a directory named "run" under /var then issue the command: /opt/etc/init.d/S80lighttpd start
The top of the article states: "These instructions apply to V1 Pogoplugs only, at the state OpenPogo was in when the article was written. For more information on the current state of PlugApps for both versions of Pogoplug, click here and here."
I clicked those two links and found nothing about running a web server on V2 Pogoplugs. So does it work on V2 or not??
RSS


