Volkszaehler in einer VMware mit OpenWRT installieren

keeping to this howto do this:

(Remark: in case you should wonder why we're using the latest RC of 10.03.1 - it's because that is the first release that sports the mysql-server package)

dd if=/dev/zero of=disk.img bs=1024M count=10
  • create an ext2 file system in that image
mkfs.ext2 sparedisk-1G.img
  • convert the image using qemu-img from the package „qemu“ (Ubuntu/Debian):
qemu-img convert -f raw sparedisk-1G.img -O vmdk sparedisk-1G.vmdk
config 'interface' 'lan'
  option 'ifname' 'eth0'
  option 'proto' 'dhcp'
  • restart your network using the new settings:
/etc/init.d/network restart
  • set a new root password:
  • retrieve current package list:
opkg update
  • mount overlay file system:
mount /dev/sdb1 /overlay
  • move dirs with high disk space requirements to overlay file system:
mkdir /overlay/mysql
mkdir /mnt/data
ln -s /overlay/mysql/ /mnt/data/
mkdir /overlay/libexec
ln -s /overlay/libexec/ /usr/
  • install required packages:
opkg install mysql-server php5-mod-mysql lighttpd coreutils-su php5-mod-pdo-mysql php5-mod-json php5-mod-sockets git bash php5-cgi libsqlite3 lighttpd-mod-fastcgi php5-mod-session lighttpd-mod-cgi php5-mod-ctype
  • remarks: bash for install script (temporary) (php → php-cli)
mkdir -p /mnt/data/mysql
ln -s /usr/bin/hostname /bin/
mysql_install_db --force (weil: /usr/bin/resolveip ist nicht da)
  • clone
cd /overlay
git clone git:\/\/
cd /overlay/
  • copy the config template and modify it to your needs:
cp volkszaehler.conf.template.php volkszaehler.conf.php
$config['db']['user']                           = '<db-user>';
$config['db']['password']                       = 'demo';
  • run installer:
bash /overlay/
  • set doctrine path to „/overlay/lib/doctrine“
  • set volkszaehler path to „/overlay/www/vz“
  • stop uhttpd before removing it
/etc/init.d/uhttpd stop
  • now remove uhttpd and all packages that depend on uhttpd:
opkg remove luci-core luci-uci luci-theme-openwrt luci-web luci-sgi-cgi luci-http luci-app-firewall luci-admin-core luci-sys luci-uvl luci-lmo luci-app-initmgr luci-ipkg luci-cbi luci-admin-mini luci-admin-full luci-ipkg luci-admin-core luci-cbi luci-uvl luci-i18n-english luci-uci uhttpd
  • modify /etc/lighttpd/lighttpd.conf:
server.document-root = "/overlay/www/"
index-file.names = ( "index.html", "index.php", "default.html", "index.htm", "default.htm" )
  • modify /etc/php.ini:
doc_root = "/overlay/www"
; Dynamic Extensions                    
  • enable (normal) cgi modify /etc/lighttpd/lighttpd.conf:
cgi.assign = ( ".php" => "/usr/bin/php-cgi" )    
  • or else enable fastcgi modify /etc/lighttpd/lighttpd.conf:
fastcgi.server = (                             
        ".php" => (            
                "localhost" => (                 
                        "socket" => "/tmp/php-fastcgi.socket",                 
                        "bin-path" => "/usr/bin/php-fcgi"
server.modules = (


  • mount /overlay at boot time
  • start mysqld at boot time („To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system“
    • cd /usr ; /usr/bin/mysqld & (ohne _safe, weil nicht da!)
    • /usr/bin/mysqladmin -u root password 'new-password'
    • /usr/bin/mysqladmin -u root -h backfire password 'new-password'
  • start lighttpd at boot time
howto/openwrt-vm.txt · Zuletzt geändert: 2013/02/17 15:01 von bgewehr