[1058] | 1 | # This document is a how-to for installing a Fedora scripts.mit.edu server. |
---|
[181] | 2 | |
---|
[1063] | 3 | set -e -x |
---|
| 4 | |
---|
| 5 | [ -e /scripts-boot-count ] || echo 0 > /scripts-boot-count |
---|
| 6 | |
---|
| 7 | source_server="old-faithful.mit.edu" |
---|
| 8 | |
---|
| 9 | boot=${1:$(cat /scripts-boot-count)} |
---|
| 10 | |
---|
| 11 | doreboot() { |
---|
| 12 | echo $(( $boot + 1 )) > /scripts-boot-count; |
---|
| 13 | shutdown -r now "Rebooting for step $(cat /scripts-boot-count)" |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | YUM() { |
---|
| 17 | NSS_NONLOCAL_IGNORE=1 yum "$@" |
---|
| 18 | } |
---|
| 19 | |
---|
[1058] | 20 | # Helper files for the install are located in server/fedora/config. |
---|
[861] | 21 | |
---|
[1058] | 22 | # Start with a normal install of Fedora. |
---|
[861] | 23 | |
---|
[1063] | 24 | if [ $boot = 0 ]; then |
---|
[1058] | 25 | # When the initial configuration screen comes up, under "Firewall |
---|
| 26 | # configuration", disable the firewall, and under "System services", leave |
---|
| 27 | # enabled (as of Fedora 9) acpid, anacron, atd, cpuspeed, crond, |
---|
| 28 | # firstboot, fuse, haldaemon, ip6tables, iptables, irqbalance, |
---|
| 29 | # kerneloops, mdmonitor, messagebus, microcode_ctl, netfs, network, nscd, ntpd, |
---|
| 30 | # sshd, udev-post, and nothing else. |
---|
[1063] | 31 | echo "--disabled" > /etc/sysconfig/system-config-firewall |
---|
| 32 | for i in NetworkManager avahi-daemon bluetooth cups isdn nfslock pcscd restorecond rpcbind rpcgssd rpcidmapd sendmail; do |
---|
| 33 | chkconfig "$i" off |
---|
| 34 | done |
---|
[1056] | 35 | |
---|
[1058] | 36 | # Edit /etc/selinux/config so it has SELINUX=disabled and reboot. |
---|
[1063] | 37 | sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config |
---|
| 38 | doreboot |
---|
| 39 | fi |
---|
[861] | 40 | |
---|
[1063] | 41 | if [ $boot = 1 ]; then |
---|
| 42 | # Create a scripts-build user account, and set up rpm to build in |
---|
| 43 | # $HOME by doing a |
---|
| 44 | # cp config/home/scripts-build/.rpmmacros /home/scripts-build/ |
---|
| 45 | # (If you just use the default setup, it will generate packages |
---|
| 46 | # in /usr/src/redhat.) |
---|
| 47 | adduser scripts-build |
---|
| 48 | |
---|
[1058] | 49 | # Check out the scripts.mit.edu svn repository. Configure svn not to cache |
---|
| 50 | # credentials. |
---|
[387] | 51 | |
---|
[1063] | 52 | YUM install -y subversion |
---|
| 53 | |
---|
| 54 | cd /srv |
---|
| 55 | svn co svn://$source_server/ repository |
---|
| 56 | |
---|
| 57 | sed -i 's/^(# *)*store-passwords.*/store-passwords = no/' /root/.subversion/config |
---|
| 58 | sed -i 's/^(# *)*store-auth-creds.*/store-auth-creds = no/' /root/.subversion/config |
---|
| 59 | |
---|
| 60 | chown -R scripts-build /srv/repository |
---|
| 61 | |
---|
[1058] | 62 | # cd to server/fedora in the svn repository. |
---|
[1063] | 63 | cd /srv/repository/server/fedora |
---|
[387] | 64 | |
---|
[1058] | 65 | # Run "make install-deps" to install various prereqs. Nonstandard |
---|
| 66 | # deps are in /mit/scripts/rpm. |
---|
[1063] | 67 | make install-deps |
---|
[387] | 68 | |
---|
[1063] | 69 | # Install bind |
---|
| 70 | YUM install -y bind |
---|
[934] | 71 | |
---|
[1063] | 72 | # Check out the scripts /etc configuration |
---|
| 73 | cd /root |
---|
| 74 | svn co svn://scripts.mit.edu/server/fedora/config/etc etc |
---|
| 75 | \cp -a etc / |
---|
[785] | 76 | |
---|
[1058] | 77 | # env NSS_NONLOCAL_IGNORE=1 yum install scripts-base |
---|
[1063] | 78 | YUM install -y scripts-base |
---|
[387] | 79 | |
---|
[1058] | 80 | # Rebuild mit-zephyr on a 32-bit machine, like the one at Joe's home. |
---|
[796] | 81 | |
---|
[1058] | 82 | # Remember to set NSS_NONLOCAL_IGNORE=1 anytime you're setting up |
---|
| 83 | # anything, e.g. using yum. Otherwise useradd will query LDAP in a stupid way |
---|
| 84 | # that makes it hang forever. |
---|
[881] | 85 | |
---|
[1058] | 86 | # Install and configure bind |
---|
| 87 | # - env NSS_NONLOCAL_IGNORE=1 yum install bind |
---|
| 88 | # - chkconfig named on |
---|
| 89 | # - service named start |
---|
[861] | 90 | |
---|
[1058] | 91 | # Reload the iptables config to take down the restrictive firewall |
---|
| 92 | # service iptables restart |
---|
[862] | 93 | |
---|
[1058] | 94 | # Copy over root's dotfiles from one of the other machines. |
---|
[803] | 95 | |
---|
[1058] | 96 | # Replace rsyslog with syslog-ng by doing: |
---|
| 97 | # # rpm -e --nodeps rsyslog |
---|
| 98 | # # yum install syslog-ng |
---|
[861] | 99 | |
---|
[1058] | 100 | # Install various dependencies of the scripts system, including syslog-ng, |
---|
| 101 | # glibc-devel.i386, python-twisted-core, mod_fcgid, nrpe, nagios-plugins-all. |
---|
[788] | 102 | |
---|
[1058] | 103 | # Disable NetworkManager with chkconfig NetworkManager off. Configure |
---|
| 104 | # networking on the front end and back end, and the routing table to send |
---|
| 105 | # traffic over the back end. Make sure that chkconfig reports "network" on, so |
---|
| 106 | # that the network will still be configured at next boot. |
---|
[788] | 107 | |
---|
[1058] | 108 | # Fix the openafs /usr/vice/etc <-> /etc/openafs mapping by changing |
---|
| 109 | # /usr/vice/etc/cacheinfo to contain: |
---|
| 110 | # /afs:/usr/vice/cache:10000000 |
---|
[788] | 111 | |
---|
[1058] | 112 | # Figure out why Zephyr isn't working. Most recently, it was because there |
---|
| 113 | # was a 64-bit RPM installed; remove it and install Joe's 32-bit one |
---|
[861] | 114 | |
---|
[1058] | 115 | # Install the full list of RPMs that users expect to be on the |
---|
| 116 | # scripts.mit.edu servers. See server/doc/rpm and |
---|
| 117 | # server/doc/rpm_snapshot. (Note that this is only a snapshot, and not |
---|
| 118 | # all packages may in fact be in use.) |
---|
[387] | 119 | |
---|
[1058] | 120 | # Install the full list of perl modules that users expect to be on the |
---|
| 121 | # scripts.mit.edu servers. See server/doc/perl and |
---|
| 122 | # server/doc/perl_snapshot. |
---|
[387] | 123 | |
---|
[1058] | 124 | # - export PERL_MM_USE_DEFAULT=1 |
---|
| 125 | # - Run 'cpan', accept the default configuration, and do 'o conf |
---|
| 126 | # prerequisites_policy follow'. |
---|
| 127 | # - Parse the output of perldoc -u perllocal | grep head2 on an existing |
---|
| 128 | # server, and "notest install" them from the cpan prompt. |
---|
[812] | 129 | |
---|
[1058] | 130 | # Install the Python eggs and Ruby gems and PEAR/PECL doohickeys that are on |
---|
| 131 | # the other scripts.mit.edu servers and do not have RPMs. |
---|
| 132 | # - Look at /usr/lib/python2.5/site-packages for Python eggs and modules. |
---|
| 133 | # - Look at `gem list` for Ruby gems. |
---|
| 134 | # - Look at `pear list` for Pear fruits (or whatever they're called). |
---|
[785] | 135 | |
---|
[1058] | 136 | # echo 'import site, os.path; site.addsitedir(os.path.expanduser("~/lib/python2.5/site-packages"))' > /usr/lib/python2.5/site-packages/00scripts-home.pth |
---|
[812] | 137 | |
---|
[1058] | 138 | # Install the credentials (machine keytab, daemon.scripts keytab, SSL |
---|
| 139 | # certs). |
---|
[387] | 140 | |
---|
[1058] | 141 | # If you are setting up a test server, pay attention to |
---|
| 142 | # /etc/sysconfig/network-scripts and do not bind scripts' IP address. |
---|
| 143 | # You will also need to modify /etc/ldap.conf, /etc/nss-ldapd.conf, |
---|
| 144 | # /etc/openldap/ldap.conf, and /etc/httpd/conf.d/vhost_ldap.conf to |
---|
| 145 | # use scripts.mit.edu instead of localhost. |
---|
[562] | 146 | |
---|
[1058] | 147 | # Install fedora-ds-base and set up replication (see ./HOWTO-SETUP-LDAP |
---|
| 148 | # and ./fedora-ds-enable-ssl-and-kerberos.diff). |
---|
[785] | 149 | |
---|
[1058] | 150 | # Make the services dirsrv, nslcd, nscd, postfix, and httpd start at |
---|
| 151 | # boot. Run chkconfig to make sure the set of services to be run is |
---|
| 152 | # correct. |
---|
[818] | 153 | |
---|
[1058] | 154 | # Run fmtutil-sys --all, which does something that makes TeX work. |
---|
[803] | 155 | |
---|
[1058] | 156 | # Ensure that PHP isn't broken: |
---|
| 157 | # # mkdir /tmp/sessions |
---|
| 158 | # # chmod 01777 /tmp/sessions |
---|
[954] | 159 | |
---|
[1058] | 160 | # Reboot the machine to restore a consistent state, in case you |
---|
| 161 | # changed anything. |
---|
[875] | 162 | |
---|
[1058] | 163 | # (Optional) Beat your head against a wall. |
---|
[562] | 164 | |
---|
[1058] | 165 | # Possibly perform other steps that I've neglected to put in this |
---|
| 166 | # document. |
---|