Actions

Process for manually installing Byzantium.: Difference between revisions

From HacDC Wiki

No edit summary
No edit summary
Line 50: Line 50:
* cp traffic_stats.sh /usr/local/bin
* cp traffic_stats.sh /usr/local/bin
* cd ../control_panel
* cd ../control_panel
* cp etc/rc.d/rc3.d/rc.byzantium /etc/rc.d/rc3.d
* cp etc/rc.d/rc.byzantium /tmp/fakeroot/etc/rc.d/
* cp etc/ssl/openssl.cnf /etc/ssl
* cp etc/ssl/openssl.cnf /etc/ssl
* cd ../porteus
* cd ../porteus

Revision as of 22:39, 8 January 2012

This process assumes:

  • You've booted a clean copy of Porteus Linux v1.0 or later.
  • You've checked the Porteus .xzm modules we built for Byzantium out of SVN, installed, and enabled them.
  • You've checked the source tree for Byzantium out of the Git repository.

The process of installing Byzantium has not been automated yet. These notes should be used in the development of the official installer, at least until we get the official byzantium.xzm module built. I get the feeling that it's going to be pretty big because we're going to have to package all of the dependencies along with it for efficiency's sake (at least, that's what Ben the Pyrate says because he's messed around with union mounts more than I).

Gotchas:

  • On first boot, syslinux might complain that it can't find video mode number 317. Entering the hex value "F00" (text mode, 80x25) will get around this.
    • At boot, you can also edit the kernel command line and change the value '791' to 'F00' prior to booting. We should make this the default.
  • If the USB device is formatted with a non-Linux file system, you will see the error "A Windows Filesystem (FAT, NTFS) or other non-posix compatible filesystem has been detected on /porteus/." If you intend on creating a save.dat file, you can press 'enter' and ignore it. Or, you can format the key with a Linux file system (/EXT[1-4]/, XFS) prior to installing Porteus.
  • On boot, Porteus Linux will mount all of the file systems it can see on the host machine. Use caution when deleting or copying files!
  • IMPORTANT: If your USB key is formatted with one of the FAT filesystems, you CANNOT create a persistent storage file larger than 1GB! Otherwise, you will get errors at boot-time about a missing persistent storage file! Set the slider no larger than 1024MB!
  • Do not set /etc/rc.d/rc.sshd +x, because it would then be executed by /etc/rc.d/rc.inet2 on startup. Seeing as how we don't have the initscript that changes the passwords in place yet, that would be a gaping security hole. The other fix at this time would be to check rc.inet2 into Git and manage it ourselves because we'd have to customize it.

These commands can be run as guest (which is logged in by default):

  • The wicd applet on the toolbar works well for setting up wireless. It's also polite enough to get out of your way once it's done. Use it to get online.
  • Open Firefox and download all of the modules from http://svn.virtadpt.net/byzantium. Put everything in /dev/sdb1/porteus/modules to save time and space
    • It will probably be /dev/sdb if you have only one drive in the host machine.
    • You will need to install the git package as well to check out the Byzantium source tree.
  • Set up a persistent storage file:
    • Porteus Menu -> System -> Porteus save.dat manager
    • Create a new save.dat file
    • Enter a filename for the persistent storage file (I like 'save' - the manager will automagically add the '.dat' extension).
    • Navigate to /mnt/sdb1/porteus - this is where save.dat will go.
    • The manager will confirm the location - say 'yes'.
    • Select a size for the save.dat file (see the above note!)
    • Wait. This can take a while. USB v2.0 isn't very fast...
    • When next that USB key is booted, hit the 'tab' key to edit the kernel command line and change the 'changes=' bit to read 'changes=/mnt/sdb1/porteus/save.dat'
    • Reboot.
  • After rebooting, set up your network connection with wicd again, because there wasn't a way to save it before.
  • After rebooting, check out the Byzantium source repository:

All of these commands must be run as root. You should do an `su -` here and get it over with.

  • mkdir -p /srv/controlpanel/graphs
  • cp -rv ~guest/Byzantium/control_panel/srv/controlpanel/* /srv/controlpanel
  • mkdir /etc/controlpanel
  • cp ~guest/Byzantium/control_panel/etc/controlpanel/* /etc/controlpanel
  • mkdir -p /var/db/controlpanel
  • cp -rv ~guest/Byzantium/control_panel/var/db/controlpanel/* /var/db/controlpanel
  • mkdir -p /tmp/fakeroot/usr/share/wicd/cli
  • cp ~guest/Byzantium/porteus/wicd/usr/share/wicd/cli/wicd-cli.py /usr/share/wicd/cli/
  • cd ~guest/Byzantium/scripts
  • mkdir -p /tmp/fakeroot/etc/udev/rules.d
  • cp 11-media-by-label-auto-mount.rules /etc/udev/rules.d
  • Where do the [pre,post]-disk-mount scripts go? --DrWho
  • cp rc.local rc.mysqld rc.ssl rc.setup_mysql /etc/rc.d
  • chmod +x /tmp/fakeroot/etc/rc.d/rc.*
  • cp traffic_stats.sh /usr/local/bin
  • cd ../control_panel
  • cp etc/rc.d/rc.byzantium /tmp/fakeroot/etc/rc.d/
  • cp etc/ssl/openssl.cnf /etc/ssl
  • cd ../porteus
  • cp -rv apache/etc/httpd/* /etc/httpd
  • cp babel/babeld.conf /etc
  • cp dnsmasq/dnsmasq.conf /etc
  • cp etherpad-lite/rc.etherpad-lite /etc/rc.d
  • cp -rv ifplugd/etc/ifplugd/* /etc/ifplugd
  • cp mysql/my.cnf /etc
  • cp ngircd/ngircd.conf /etc
  • cp ngircd/rc.ngircd /etc/rc.d
  • cp php/etc/httpd/php.ini /etc/httpd
  • cp qwebirc/config.py /opt/qwebirc
  • cp qwebirc/rc.qwebirc /etc/rc.d
  • chmod +x /etc/rc.d/rc.qwebirc
  • chmod +x /etc/rc.d/rc.dnsmasq
  • chmod +x /etc/rc.d/rc.ifplugd
  • chmod +x /etc/rc.d/rc.httpd
  • chmod +x /etc/rc.d/rc.local
  • chmod +x /etc/rc.d/rc.mysqld
  • chmod -x /etc/rc.d/rc.cups
  • chmod -x /etc/rc.d/rc.gpm
  • mysql_install_db --user=mysql
  • /etc/rc.d/rc.mysqld start
  • mysqladmin -u root password "new password here"
  • /usr/bin/mysql_secure_installation
    • Do not change root password.
    • Remove anonymous users.
    • Disallow remote root logins to MySQL server.
    • Remote test database.
    • Reload privilege table.
  • mysqladmin -u root -p create etherpad
  • mysqladmin -u root -p create statusnet
  • cd ~guest/Byzantium/databases
  • mysql -h localhost -u root -p
    • Give root password.
    • use etherpad
    • source etherpad.sql
    • use statusnet
    • source statusnet.sql
    • grant all on statusnet.* to 'statusnet'@'localhost' identified by 'password';
    • grant all on etherpad.* to 'etherpad'@'localhost' identified by 'password';
    • flush privileges;
  • useradd -c "Etherpad-Lite Pseudouser" -d /opt/etherpad-lite -g users -M -u 1001 etherpad
  • passwd -l etherpad
  • mkdir /var/run/ngircd
  • useradd -c "ngircd Pseudouser" -d /var/empty -g users -M -u 1002 -s /bin/false ngircd
  • passwd -l ngircd
  • chown ngircd.root /var/run/ngircd
  • chmod 0750 /var/run/ngircd
  • mkdir -p /srv/captiveportal
  • mkdir -p /etc/captiveportal
  • cd ~guest/Byzantium/captive_portal
  • cp captive_portal.py /usr/local/sbin
  • cp captive-portal.sh /usr/local/sbin
  • cp etc/captiveportal/captiveportal.conf /etc/captiveportal/
  • cp srv/captiveportal/* /srv/captiveportal/

For the control panel to work, NO network interfaces should be configured at the outset. The Porteus configuration apps make this easy, but conflict with our needs. When testing, it's easier to shut everything down by hand and then put fresh copies of the .sqlite databases into /var/db/controlpanel.

Ideally, to do everything right you'd have to reboot at this point. That would, in theory, run the right initscripts in the right order (or skip them, as the case may be).