1 / 11

AP 專題 : web server & FSM

AP 專題 : web server & FSM. Student: 余尚哲 Perfessor: 李正帆教授. agenda. install usb key install web server filters Monitor FSM. install usb key (1). #Insert USB stick killall stupid-ftpd umount /tmp/harddisk/ fdisk /dev/discs/disc0/disc

terri
Download Presentation

AP 專題 : web server & FSM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AP專題 : web server & FSM Student: 余尚哲 Perfessor: 李正帆教授

  2. agenda • install usb key • install web server • filters • Monitor FSM

  3. install usb key (1) • #Insert USB stick killall stupid-ftpdumount /tmp/harddisk/fdisk /dev/discs/disc0/disc • #add two partition {3GB ext3, 1GB swap}fdisk /dev/discs/disc0/discmke2fs -j /dev/discs/disc0/part1mkswap /dev/discs/disc0/part2 reboot

  4. install usb key (2) • #Post-boot Scriptmount /dev/discs/disc0/part1 /optswapon /dev/discs/disc0/part2touch /usr/local/sbin/post-boottouch /usr/local/sbin/commitchmod +x /usr/local/sbin/*vi /usr/local/sbin/post-bootvi /usr/local/sbin/commitcommit /usr/local/sbin/commit #!/bin/shflashfs saveflashfs commitflashfs enablereboot

  5. install usb key (3) /usr/local/sbin/post-boot #!/bin/sh # Install USB serial communication insmod usbserial insmod pl2303 mknod /dev/ttyUSB0 c 188 0 chmod 666 /dev/ttyUSB0 /bin/sh < /dev/ttyUSB0 > /dev/ttyUSB0 2>&1 # wait for /opt to mount mount /dev/discs/disc0/part1 /opt i=0 while [ $i -le 30 ] && ! [ -d /opt/etc ]; do sleep 1 i=`expr $i + 1` done # Activate swap swapon /dev/discs/disc0/part2 # Run all active services /opt/etc/init.d/rc.unslung

  6. install web server (1) /opt/etc/thttpd.confdir=/opt/share/www port=81 user=nobody nochroot nosymlink novhost logfile=/opt/var/log/thttpd.log pidfile=/opt/var/run/thttpd.pid • mkdir /opt/tmpmkdir /opt/tmp/ipkgipkg.sh updateipkg.sh install ipkg/opt/bin/ipkg update/opt/bin/ipkg install libiconv/opt/bin/ipkg install php-thttpdmkdir /opt/share/mkdir /opt/share/wwwvi /opt/etc/thttpd.conf mkdir /opt/varmkdir /opt/var/logmkdir /opt/var/runvi /opt/share/www/index.php /opt/share/www/index.php <?phpphpinfo();?>

  7. install web server (2)

  8. Filter channel Name Type : TCP, HTTP GET From : 192.168.0.0/255.255.0.0 To : stat.ppstream.com(210.51.188.91), port 80 Data : pattern =>GET /action/notice.php?....&cn= <channel NAME> Filter Peerlist Type : UDP From :{60.28.213.175,61.172.196.108,121.9.201.98,125.46.57.13}, port 8000 To : <Host IP> Data : (offset = data frame offset ) Peer Number => offset 0x40, 1 Byte N th Peer IP =>offset 0x41+(16*(N-1)), 4 Byte N th Peer Port =>offset 0x41+(16*(N-1))+4, 2 Byte Filter

  9. Monitor FSM (1) • Problem: • Only first play has HTTP request ,witch contained Channel Name • Idea: • On first play session: (Ch name & Peer List)Associate Peer List with Channel Name • On replay session: (Peer List)Looking for similar Peer List => find Channel Name

  10. Web UI

More Related