
Here are the steps to run your own embedded web server with iMX233-OLinuXino-MAXI.
We assume you use ARCH Linux distribution:
1. Using pacman download the following packages:
lighttpd
# pacman -Sy lighttpd
mod_fastcgi
# pacman -Sy mod_fastcgi
php-cgi
# pacman -Sy php-cgi
2. Edit the lighttpd.conf file
#vi /etc/lighttpd/lighttpd.conf
NOTE: if you can’t find this file reboot the board and try again..
The file should look something like this
# This is a minimal example config
# See /usr/share/doc/lighttpd
# and http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions
server.port = 80
server.username = “http”
server.groupname = “http”
server.document-root = “/srv/http”
server.modules = (
“mod_access”,
“mod_fastcgi”,
“mod_accesslog”)
server.errorlog = “/var/log/lighttpd/error.log”
dir-listing.activate = “enable”
fastcgi.server = ( “.php” => ((
“bin-path” => “/usr/bin/php-cgi”,
“socket” => “/tmp/php.socket”
)))
index-file.names = ( “index.html” )
mimetype.assign = ( “.html” => “text/html”, “.htm” => “text/html”, “.txt” => “text/plain”, “.jpg” => “image/jpeg”, “.png” => “image/png”, “” => “application/octet-stream” )
Save and exit the editor. You can check the syntax with the command:
# lighttpd -t -f /etc/lighttpd/lighttpd.conf
With this configuration you should have working web-server at port 80 and implemented php
3. Reboot the board.
4. After the restart load the configuration file and start the daemon:
# lighhtpd -f /etc/lighttpd/lighttpd.conf
# /etc/rc.d/lighttpd start
You can see which daemons are started with the command:
# rc.d list
If you want to add this to autostart modify /etc/rc.conf and add lighttpd to DAEMONS array:
…
DAEMONS=(set-olinuxino-mac !hwclock syslog-ng network netfs crond sshd lighttpd)
5. Test the server
Now just open any browser and type the IP of the OlinuXino board and you should see “Hello” message. The folder containing the index.html is /srv/http. Just put your webpages there and your good to go.