*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: XO as Webserver  (Read 7921 times)

XO as Webserver

anna
Master Contributor
***
Posts: 326


May 22, 2008, 08:09:51 PM

I haven't seen mention of this yet, but it's really neato.  I'm not gonna take credit - someone on the chat server told me about it.

su -
yum -y install boa

It's only 100K, too.

Now put your index.html in /var/www

Find your XOs IP.  Still as root:

ifconfig

Look next to eth0 for 192.168.whatever (for example)

Go to another machine on your LAN and type your XOs IP into your browser.  There's your XO serving up a webpage!

Logged

#1 Re: XO as Webserver

Mike Lee
Global Moderator
Master Contributor
****
Posts: 348


I'm curious about everything.


WWW
May 22, 2008, 08:19:57 PM

Anna,

Thanks for sharing this great tip! I've been hoping for a lightweight http server for XO for a while. I can't wait to try the installation.

Mike
Logged

Member of the OLPC Learning Club - Washington, D.C., and a sponsor of the Simplicity Research Consortium at the MIT Media Lab.

#2 Re: XO as Webserver

kostmo
New

Posts: 3


May 22, 2008, 10:19:31 PM

I am looking forward to getting a lightweight web server running.

I followed the given instructions exactly and got boa installed.  However, when I try to visit the XO's IP address (which happens to be 192.168.6.2 in this case), the server was not listening.  Firefox reports a "Failed to Connect": Firefox can't establish a connection to the server at 192.168.2.6.

I tried again after restarting the XO, with no success.  "ps ax | grep boa" reports no instance of boa running.  I then tried starting boa manually (as the superuser), resulting in the following error message:
bash-3.2# /usr/sbin/boa
[23/May/2008:17:14:20 +0000] log.c:53 (open_logs) - unable to open error log: No such file or directory

I'm not sure how to find out where this supposed error log would be located.  I am running build 656.

Is anyone else able to run this web server on build 656?
Karl
Logged

#3 Re: XO as Webserver

anna
Master Contributor
***
Posts: 326


May 23, 2008, 08:03:46 AM

Sorry - this is what I get for not fully testing under Sugar.  It "just works" under Ubuntu.

In regular old 656, as root:

cd /var/log
mkdir boa
/usr/sbin/boa

Now it should work.  I verified it under 656.

The configuration file is in /etc/boa if, for instance you want to change where  your content lives.
Logged

#4 Re: XO as Webserver

rossisen
Commenter

Posts: 5


May 23, 2008, 01:04:17 PM

That is really cool.  Thanks for sharing.  For me the pages had to be in /var/www/boa/html.

It also seemed that /var/log/boa directory had to be recreated on restart - is that your experience?
Logged

#5 Re: XO as Webserver

anna
Master Contributor
***
Posts: 326


May 30, 2008, 07:31:05 AM

It also seemed that /var/log/boa directory had to be recreated on restart - is that your experience?

Yes, that is annoying to have to recreate /var/log/boa.  I went into /etc/boa/boa.conf and changed these two lines like so:

ErrorLog /dev/null
AccessLog /dev/null

I'm not terribly concerned about logging, but if you are, then you can probably do something else.

Boa wasn't starting automatically, so as root, I:

chkconfig --level 345 boa on

Now it works on startup under Sugar.
Logged

#6 Re: XO as Webserver

anna
Master Contributor
***
Posts: 326


June 12, 2008, 02:05:30 PM

I just set up boa so I can download files from /home/olpc between XOs or other machines on the LAN.  This is really handy instead of messing around with ssh or USB drives.

In /etc/boa.conf:

Change the User and Group like so:

User olpc
Group olpc

Change the document root from /var/www/boa/html to the dir you want to share:

DocumentRoot /home/olpc

Comment out the Directory index line:

#DirectoryIndex index.html

service boa restart
Logged

#7 Re: XO as Webserver

anna
Master Contributor
***
Posts: 326


July 12, 2008, 01:05:38 PM

Just edited boa.conf to see if I could poke around in everything within the XO file structure, and it works.

Quote
Change the User and Group like so:

User root
Group root

Change the document root from /var/www/boa/html to the dir you want to share:

DocumentRoot /

Changing the user and group to root even lets me look at the stuff in /security.  This is not the most secure way to do this, but probably won't hurt behind my own LAN.
Logged

#8 Re: XO as Webserver

jrghoull
Contributor
*
Posts: 72


my XO icon looks like a TMNT


July 13, 2008, 07:58:56 PM

computer schmuk here..how do i put my "index.html in /var/www"

by the way are you using the "in" command or are you saying the word "in"?
Logged

is it a virus even if it says "i love you"?

#9 Re: XO as Webserver

AuntiMame
Master Contributor
***
Posts: 418



WWW
July 31, 2008, 12:37:41 PM

Quote
how do i put my "index.html in /var/www"

by the way are you using the "in" command or are you saying the word "in"?

jrghoull,
There are no schmuck questions. And is anyone gives you grief for asking, they are the schmuck!
(stepping off of soap box) Wink

Now, to answer your question. Anna was saying the word "in". Do you have Midnight Commander installed on your XO (which makes copying files a bit easier)?

If yes, then use MC to copy the index.html file into the /var/www/boa/html directory.
If no, then start the Terminal activity and type the following command ---->   

cp /path/to/index.html /var/www/boa/html

Basically the command says "copy from the /path/to/ directory, specifically the index.html file, into the directory /var/www/boa/html"

Aunti
Logged

Shop for XO accessories and swag at www.XOExplosion.com

Life is a banquet, and most poor suckers are starving to death!
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 30
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 20
Total: 20