How to install Nokia N900 web interface
Disclaimer: This is very old and is a great example how to NOT think about security…oh well, archive purposes..
These are the steps needed to make everything work, most of the examples are run from command line, because I like to do things from there. Of course you can install these apps from application manager also. Scripts are pretty ‘raw’ because at first this was just my leisure project, but scripts work, thats the main thing right? =) There may be some errors, but just let me know about them and I’ll try to fix them. Basicly this is just a compilation of different programs that are used via simple scripts.
When I first made this, there was not php5 package in repositories, so I found another way to do this (see section 3 Install PHP, url). I tried to install php5 from repositories and made this work, but didn’t find pdo and pdo_sqlite modules for it. I had it working already, so didn’t bother to research it very much, maybe someone knows how to install php5 package from repositories with pdo and pdo_sqlite modules? Anyway, the php-cgi and php.ini file that you need is inside the .zip file (see bottom of the post).
Feel free to make your own scripts and add them to your own interface. Hope you release your .php and/or .py scripts here too.
Okay, here is somekind of tutorial how to make this work (hopefully!).
1. Install rootsh
– from application manager
2. Install and configure lighttpd
– apt-get install lighttpd
– mkdir /var/log/lighttpd
– mkdir /var/www/passwd
– mkdir /var/www/htdocs
– edit following lines of /etc/lighttpd.conf – file:
o server.document-root = “/var/www/htdocs/” # Change and create to whatever you want, remember to change doc_root in php.ini to match this.
o server.errorlog = “/var/log/lighttpd/error.log” # for error logs
o accesslog.filename = “/var/log/lighttpd/access.log” # for access logs
o server.tag = “N900 WWW-interface server” # name of your web server
o server.port = 80 # You can also change this if you like, I prefer to keep my www-interface port to something else than 80, just remember to point your browser to a port you assign.
o #auth.backend = “plain” #comment this line
o #auth.backend.plain.userfile = “/etc/lighttpd.user” #comment this line
o Add folowing lines before “auth.require = (”
auth.backend = “htpasswd”
auth.backend.htpasswd.userfile = “/var/www/passwd/.htpasswd”
auth.require = ( “/” =>
(
“method” => “basic”,
“realm” => “Quick share folder”,
“require” => “valid-user”
)
)
– Now we have to make a password file above a line with “auth.backend.htpasswd.userfile = “/var/www/passwd/.htpasswd”” says where we store password.
* You can easily make a .htpasswd file here: http://www.htaccesstools.com/htpasswd-generator/]http://www.htaccesstools.com/htpasswd-generator/
* Copy paste resulting text to a .htpasswd file and save it to /var/www/passwd/.htpasswd
o Copy .php and .html files (from .zip – file below) to a /var/www/htdocs/ – directory.
o Make shared folder to memory card, issue:
* mkdir /media/mmc1/www-share
3. Install PHP
– Copy files included in the .zip file to following locations:
* php-cgi ==> /usr/bin/php-cgi
* php.ini ==> /etc/php.ini
– php-cgi executable is from a .deb file from here: [url=http://talk.maemo.org/showpost.php?p=235084&postcount=19]http://talk.maemo.org/showpost.php?p=235084&postcount=19[/url] , thanks jolouis
4. Install ‘phone-control’ for locking, taking photos etc.
– apt-get install phone-control
– Thanks to Mohammad ( http://maemo.org/packages/view/phone-control/ )
4. Install python-location for GPS to work via web interface.
– apt-get install python-location
– Link: http://wiki.maemo.org/PyMaemo/Using_Location_API
5. Install x11vnc to enable remote control of N900.
– apt-get install x11vnc
6. Install gstreamer-tools for taking photos with front / back camera.
– apt-get install gstreamer-tools
To-Do:
* Clean and make contacs display nicer
* Add functionality, stop / start services etc (althought this is allready possible by issuing a custom command..)
* Improve GPS script
* Improve everything =)
And here is the .zip file that includes all the necessary files: http://www.vesiluoma.com/n900-www-interface-1.0.zip
To test it, point your N900 browser to 127.0.0.1 (if you changed your port to anything other than 80, point it to 127.0.0.1:## where ## is the port you assigned). You can also install a widget that shows your N900 ip-number on your devices desktop and check the interface from a desktop computer. And of course if you don’t like to install any widgets, open terminal and issue ‘ifconfig’ and get your IP-address from there…or you can point your N900 browser to http://www.whatismyip.org/ and get your IP-address from there. Whatever suits you best. =)