Time to upgrade the server again, getting numerous failures, so need to re-install the whole system…
Quick Overview of Steps to Commission the Server:
- Burn Gentoo 2011.0 Minimal CD, and boot server using it.
- Partition Hard Disk
Device Boot Start End Blocks Id System Mount
/dev/hda1 * 1 7 56196 83 Linux [/boot]
/dev/hda2 8 70 506047+ 82 Linux swap [swap]
/dev/hda3 71 800 5863725 83 Linux [/]
/dev/hda4 801 9729 71722192+ 5 Extended
/dev/hda5 801 1530 5863693+ 83 Linux [/mnt/portage]
/dev/hda6 1531 2260 5863693+ 83 Linux [/home]
/dev/hda7 2261 2869 4891761 83 Linux [/mnt/root]
/dev/hda8 Remainder [/shared/]
- Follow Gentoo Installation Instructions
Use backed up files from old installation as reference to various steps in the Gentoo install guide (/etc/conf.d/*, /etc/fstab, /etc/make.conf, and so on).
Ensure kernel has support for all filesystems ext2/3, xfs, nfs server. Ensure drivers built for all key components (use lspci -v to get key ones), correct CPU is chosen, hardware sensors and CPU powersaving.
Copy across all /etc/portage files before emerging the following packages.
Once complete will have the following services running:
- apache2
- asterisk
- dahdi
- lm_sensors
- local
- mysql
- mythbackend
- net.eth0
- netmount
- nfs
- nfsmount
- ntp-client
- ntpd
- sshd
- syslog-ng
- udev-postmount
- vixie-cron
- xinetd
Use /usr/lib/portage/world as a guide as to what packages to install.
Top level services that need to be installed:
- MythTV Backend
- Apache Web Server
- Asterisk PBX
- Squeezebox Server
- MySQL Database
Key components to support the above:
Order of Installation:
Utilties
- syslog-ng
- vixie-cron
- gentoolkit
- logrotate
- vim
- ntpd & ntp-client
- ssmtp
Hardware Control
lm_sensors – follow installation instructions and install appropriate modules
CPU Frequency control – Use kernel modules if possible, explore /sys/devices/system/cpu/cpu0/cpufreq/
NFS Exports
Install and restore exports file from backup, TODO: Check for portmapper/rpcbind.
-
emerge –ask nfs-utils
-
cp /backups/exports /etc/exports
-
/etc/init.d/nfs start
-
rc-update add nfs default
Mysql
- Install the server: See the Gentoo Docs
- Update /etc/mysql/my.cnf based on previous tweaks (Mark updates with comments!)
- Start the server:
-
rc-update add mysql default
-
/etc/init.d/mysql start
- Import user privileges using this useful script:
-
mygrants()
-
{
-
mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
-
'SHOW GRANTS FOR ''', user, '''@''', host, ''';'
-
) AS query FROM mysql.user" | \
-
mysql $@ | \
-
sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
-
}
- Import ‘working’ copy of various databases (asterisk, mail & mythconverg).
Asterisk
See the previous post on Asterisk upgrade.
Also install the latest phpagi
Install sox for increasing gain on voicemail.
Get British audio from Enicomms, put in /var/lib/asterisk/sounds/en_GB
Apache
Install as per Gentoo instructions, and restore backed up www files. (including .htaccess). TODO:
-
emerge apache
-
emerge php
-
/etc/init.d/apache2 start
-
rc-update add apache2 default
-
cp -r /backups/www /var/www/localhost/htdocs/
-
htpasswd -c /var/www/localhost/htdigest username
Download and install, and configure useful tools:
Copy across bespoke tools:
- Asterisk Manager
- Share Research
Mythtv
Only really need backend support, but still need all the dependencies, so get portage to add them all. Ensure version we want is enabled in portage, update package.keywords
echo "media-tv/mythtv ~x86" >> package.keywords
emerge --onlydeps --ask mythtv
emerge --noreplace mythtv
Restore /root/.mythtv settings.
Also need xmltv for listings, with imdb support:
emerge --ask xmltv
tv_imdb --download --imdbdir /shared/imdb --prepStage all
Kernel Drivers if possible:
Copy backed up udev rules to ensure known adapter names. cp backups/etc/11-dvb.rules /etc/udev/rules.d/11-dvb.rules
Other Bits n Bobs
- ctorrent – For downloading torrents
- lftp – For website backups
- netkit-ftpd & xinetd – For FTP access
- dvd+rw-tools – For Backup to DVD
- git – For access to MythTV repo
- svn – For access to WordPress repo
- hdparm – For shutting down drives
- xfsutils – For xfs maintenance
- xpdf – To support research note download
- ethtool – In support of Wake-on-LAN