Recipe for MCP FOG Server

  • VM in proxmox: 20 GB root, 4 CPU, 4096 MB RAM (in pve)
  • base netinst install of stretch - deselect everything from tasksel
    • hostname fog – domain mcp.lcl
    • root: 20 GB, noatime+discard
    • swap: remainder (1.5 GB)
    • opt out of popcon, deselect everything from tasksel
  • > /etc/motd
  • apt-get --no-install-recommends install aptitude
  • aptitude --without-recommends install ssh libpam-systemd ncurses-term && aptitude markauto libpam-systemd ncurses-term # this avoids krb5-locales, tcpd, xauth (this will pull in dbus, but that's okay)
  • aptitude install net-tools man-db less fbset screen rsync psmisc file patch ethtool strace tcpdump vim bzip2 xz-utils
  • aptitude --without-recommends install dnsutils
  • adduser tdobes adm
  • adduser tdobes systemd-journal
  • aptitude install dbus # this is pulled in by ssh, but leave it here just-in-case
  • mkdir -p /etc/systemd/system/getty\@tty1.service.d
    echo '[Service]' > /etc/systemd/system/getty\@tty1.service.d/noclear.conf
    echo 'TTYVTDisallocate=no' >> /etc/systemd/system/getty\@tty1.service.d/noclear.conf
  • sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet panic=5"/g' /etc/default/grub && update-grub
  • aptitude --without-recommends install sshfs
  • aptitude install lsof sysstat
  • aptitude --without-recommends install cifs-utils nfs-common
  • aptitude install git
  • aptitude install apache php-fpm php-mysql && a2enmod proxy_fcgi setenvif && a2enconf php7.0-fpm && systemctl reload apache2
  • aptitude install mariadb-server mariadb-client
  • do we need to manually create the db? try this out and see what install script does
  • rm /etc/apache/sites-enabled/000-default.conf # fog config doesn't work since the default one overrides it -- WTF?
    fog_interface=`ls /sys/class/net/ | grep -v lo | head -n 1`
    fog_address=`ip addr show $fog_interface | grep 'inet ' | awk '{print $2}' | cut -f 1 -d '/'`
    #fog_address=`ifconfig $fog_interface | grep 'inet ' | awk '{print $2}'`
    #fog_mask=`ifconfig $fog_interface | grep 'inet ' | awk '{print $4}'`
    fog_images=/mnt/images
    fog_dbpass=`date +%s | sha256sum | base64 | head -c 15` # this generates a random password
    mysqladmin create fog
    mysql -e "grant all on fog.* to fog@localhost identified by '$fog_dbpass';"
    mkdir -p $fog_images
    mkdir -p /opt/fog
    echo "ipaddress='$fog_address'" > /opt/fog/.fogsettings
    echo "interface='$fog_interface'" >> /opt/fog/.fogsettings
    echo "osid='2'" >> /opt/fog/.fogsettings # this means debian
    echo "osname='Debian'" >> /opt/fog/.fogsettings
    echo "dodhcp='N'" >> /opt/fog/.fogsettings # don't run a DHCP server
    echo "bldhcp='0'" >> /opt/fog/.fogsettings # don't run a DHCP server
    echo "blexports='1'" >> /opt/fog/.fogsettings # rebuild the NFS exports file
    echo "installtype='N'" >> /opt/fog/.fogsettings
    echo "snmysqluser='fog'" >> /opt/fog/.fogsettings
    echo "snmysqlpass='$fog_dbpass'" >> /opt/fog/.fogsettings
    echo "snmysqlhost='localhost'" >> /opt/fog/.fogsettings
    echo "installlang='0'" >> /opt/fog/.fogsettings
    echo "donate='0'" >> /opt/fog/.fogsettings
    echo "storageLocation='$fog_images'" >> /opt/fog/.fogsettings
    echo "webroot='fog/'" >> /opt/fog/.fogsettings # I wish this was at /, but that appears to be broken due to some sort of bug - argh!
    fog_interface=
    fog_address=
    fog_images=
    fog_dbpass=
    
    # hack to prevent this thing from installing/configuring outdated fastcgi module and mod_php (which forces an MPM change)
    sed -i.orig -e 's/libapache2-mod-php${php_ver}//g' -e 's/libapache2-mod-fastcgi//g' fogproject/lib/ubuntu/config.sh
    
    cd fogproject/bin
    ./installfog.sh -y
    # NOTE: If you run this multiple times, you end up having to comment out backupDB in installfog.sh because the backup function is stupid and fails the entire installation if the db doesn't exist yet.  WTF?
    
    ln -s /var/www/fog/lib/fog/config.class.php /etc/fog/ # making a symlink just so I can find this in the future without a struggle
  • Settings for manual install: 2 (debian), N (normal install type), {enter} (current IP), N (don't change default network interface), N (don't setup a router address), N (don't have dhcp handle dns), N (don't run a dhcp service), N (don't install language packs), Y (continue and run install)
  • You can now log in at http://fog.mcp.lcl/fog/management/ (username: “fog”, password: “password”)

See also:

Network booting

computer/mcp_fog_server.txt · Last modified: 2018/06/25 17:34 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS