This page explain how to build a complete webserver using a Foxboard with CrisOs.
Before start you should install CrisOs on yuor Foxboard and login inside it.
Now, you can install lighttpd web server and php4 with this command:
opkg install lighttpd-mod-fastcgi php4-fastcgi
This operation install a lot of package and most important a webserver lighttpd and a fastgci version of php4.
You can easy configure your new http server editing /etc/lighttpd.conf enable mod-fastcgi and configure fastgci interpreter for php file.
Here you can download the configuration file with proposed changes: lighttpd.conf
Now, you need to disable default http daemon (busybox buildin) and enable lighhtpd at boot time; you can do this using:
/etc/init.d/httpd disable /etc/init.d/lighttpd enable
Start webserver a made first test:
/etc/init.d/lighttpd restart echo "<?php phpinfo(); ?>" > /www/index.php
We should be able to see a php presentation page at http://your_foxboard_ip , like:
PHP Version 4.3.11 |
| System | Linux OpenWrt 2.6.19.2 #3 Fri Feb 1 18:24:40 CET 2008 cris |
| Build Date | Feb 19 2008 21:57:51 |
| Configure Command | './configure' '--target=cris-linux' '--host=cris-linux' '--build=i486-linux-gnu' '--program-prefix=' '--program-suffix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--datadir=/usr/share' '--localstatedir=/var' '--mandir=/usr/man' '--infodir=/usr/info' '--disable-nls' '--enable-shared' '--disable-static' '--disable-rpath' '--disable-debug' '--without-pear' '--with-config-file-path=/etc' '--disable-ipv6' '--enable-magic-quotes' '--enable-memory-limit' '--disable-overload' '--disable-short-tags' '--disable-ctype' '--disable-dom' '--enable-ftp=shared' '--without-gettext' '--without-iconv' '--disable-mbstring' '--disable-mbregex' '--with-openssl=shared,/home/claudyus/sdk/crisos/trunk/staging_dir/cris/usr' '--with-kerberos=no' '--with-openssl-dir=/home/claudyus/sdk/crisos/trunk/staging_dir/cris/usr' '--enable-session=shared' '--enable-sockets=shared' '--disable-tokenizer' '--with-zlib=/home/claudyus/sdk/crisos/trunk/staging_dir/cris/usr' '--with-zlib-dir=/home/claudyus/sdk/crisos/trunk/staging_dir/cris/usr' '--without-curl' '--without-gd' '--without-gmp' '--without-ldap' '--without-mysql' '--without-pcre-regex' '--without-pgsql' '--without-sqlite' '--disable-xml' '--disable-cli' '--enable-cgi' '--enable-fastcgi' '--enable-force-cgi-redirect' '--enable-discard-path' |
| Server API | CGI/FastCGI |
| Virtual Directory Support | disabled |
| Configuration File (php.ini) Path | /etc/php.ini |
| PHP API | 20020918 |
| PHP Extension | 20020429 |
| Zend Extension | 20021010 |
| Debug Build | no |
| Thread Safety | disabled |
| Registered PHP Streams | php, http, ftp, compress.zlib |
|
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies |
If you don't like <?php open tag you may be interest to execute:
sed -i "s/;short_open_tag = Off/short_open_tag = On/g" /etc/php.ini
;)