| [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 |  | 
|---|
| [1259] | 11 | # XXX: let 'branch' be the current svn branch you are on | 
|---|
|  | 12 |  | 
|---|
| [1063] | 13 | doreboot() { | 
|---|
|  | 14 | echo $(( $boot + 1 )) > /scripts-boot-count; | 
|---|
|  | 15 | shutdown -r now "Rebooting for step $(cat /scripts-boot-count)" | 
|---|
|  | 16 | } | 
|---|
|  | 17 |  | 
|---|
|  | 18 | YUM() { | 
|---|
|  | 19 | NSS_NONLOCAL_IGNORE=1 yum "$@" | 
|---|
|  | 20 | } | 
|---|
|  | 21 |  | 
|---|
| [1058] | 22 | # Helper files for the install are located in server/fedora/config. | 
|---|
| [861] | 23 |  | 
|---|
| [1058] | 24 | # Start with a normal install of Fedora. | 
|---|
| [861] | 25 |  | 
|---|
| [1063] | 26 | if [ $boot = 0 ]; then | 
|---|
| [1058] | 27 | # When the initial configuration screen comes up, under "Firewall | 
|---|
|  | 28 | # configuration", disable the firewall, and under "System services", leave | 
|---|
|  | 29 | # enabled (as of Fedora 9) acpid, anacron, atd, cpuspeed, crond, | 
|---|
|  | 30 | # firstboot, fuse, haldaemon, ip6tables, iptables, irqbalance, | 
|---|
|  | 31 | # kerneloops, mdmonitor, messagebus, microcode_ctl, netfs, network, nscd, ntpd, | 
|---|
|  | 32 | # sshd, udev-post, and nothing else. | 
|---|
| [1063] | 33 | echo "--disabled" > /etc/sysconfig/system-config-firewall | 
|---|
| [1382] | 34 | for i in NetworkManager avahi-daemon bluetooth cups isdn nfslock nfs pcscd restorecond rpcbind rpcgssd rpcidmapd sendmail; do | 
|---|
| [1063] | 35 | chkconfig "$i" off | 
|---|
|  | 36 | done | 
|---|
| [1056] | 37 |  | 
|---|
| [1381] | 38 | # Turn on network, so we can connect at boot | 
|---|
|  | 39 | chkconfig network on | 
|---|
|  | 40 |  | 
|---|
| [1058] | 41 | # Edit /etc/selinux/config so it has SELINUX=disabled and reboot. | 
|---|
| [1063] | 42 | sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config | 
|---|
|  | 43 | doreboot | 
|---|
|  | 44 | fi | 
|---|
| [861] | 45 |  | 
|---|
| [1063] | 46 | if [ $boot = 1 ]; then | 
|---|
|  | 47 | # Create a scripts-build user account, and set up rpm to build in | 
|---|
|  | 48 | # $HOME by doing a | 
|---|
|  | 49 | # cp config/home/scripts-build/.rpmmacros /home/scripts-build/ | 
|---|
|  | 50 | # (If you just use the default setup, it will generate packages | 
|---|
|  | 51 | # in /usr/src/redhat.) | 
|---|
|  | 52 | adduser scripts-build | 
|---|
|  | 53 |  | 
|---|
| [1058] | 54 | # Check out the scripts.mit.edu svn repository. Configure svn not to cache | 
|---|
|  | 55 | # credentials. | 
|---|
| [387] | 56 |  | 
|---|
| [1063] | 57 | YUM install -y subversion | 
|---|
|  | 58 |  | 
|---|
|  | 59 | cd /srv | 
|---|
| [1259] | 60 | svn co svn://$source_server/$branch repository | 
|---|
| [1063] | 61 |  | 
|---|
|  | 62 | sed -i 's/^(# *)*store-passwords.*/store-passwords = no/' /root/.subversion/config | 
|---|
|  | 63 | sed -i 's/^(# *)*store-auth-creds.*/store-auth-creds = no/' /root/.subversion/config | 
|---|
| [1237] | 64 | # The same tweaks should be made on /home/scripts-build/.subversion/config | 
|---|
|  | 65 | # once it exists (do something with svn as scripts-build) | 
|---|
| [1063] | 66 |  | 
|---|
|  | 67 | chown -R scripts-build /srv/repository | 
|---|
|  | 68 |  | 
|---|
| [1058] | 69 | # cd to server/fedora in the svn repository. | 
|---|
| [1063] | 70 | cd /srv/repository/server/fedora | 
|---|
| [387] | 71 |  | 
|---|
| [1058] | 72 | # Run "make install-deps" to install various prereqs.  Nonstandard | 
|---|
|  | 73 | # deps are in /mit/scripts/rpm. | 
|---|
| [1259] | 74 | YUM install -y make | 
|---|
| [1063] | 75 | make install-deps | 
|---|
| [387] | 76 |  | 
|---|
| [1063] | 77 | # Install bind | 
|---|
|  | 78 | YUM install -y bind | 
|---|
| [934] | 79 |  | 
|---|
| [1063] | 80 | # Check out the scripts /etc configuration | 
|---|
|  | 81 | cd /root | 
|---|
| [1259] | 82 | svn co svn://scripts.mit.edu/$branch/server/fedora/config/etc etc | 
|---|
|  | 83 | # backslash to make us not use the alias | 
|---|
| [1063] | 84 | \cp -a etc / | 
|---|
| [785] | 85 |  | 
|---|
| [1381] | 86 | # NOTE: You will have just lost DNS resolution and the ability | 
|---|
|  | 87 | # to do password SSH in.  If you managed to botch this step without | 
|---|
|  | 88 | # having named setup, you can do a quick fix by frobbing /etc/resolv.conf | 
|---|
|  | 89 | # with a non 127.0.0.1 address for the DNS server.  Be sure to revert it once | 
|---|
|  | 90 | # you have named. | 
|---|
| [1259] | 91 |  | 
|---|
|  | 92 | service named start | 
|---|
|  | 93 | chkconfig named on | 
|---|
|  | 94 |  | 
|---|
|  | 95 | # In the case of the Kerberos libraries, you'll be told that | 
|---|
|  | 96 | # there are conflicting files with the 64-bit versions of the packages, | 
|---|
|  | 97 | # which we scriptsify.  You'll have to use --force to install those | 
|---|
|  | 98 | # rpms despite the conflicts.  After doing that, you may want to | 
|---|
|  | 99 | # install the corresponding 64-bit scriptsified versions again, just | 
|---|
|  | 100 | # to be safe in case the 32-bit versions overwrite files that differ. | 
|---|
|  | 101 | # When you try this, it will complain that you already have the same | 
|---|
|  | 102 | # version installed; again, you'll need to use --force to do it anyway. | 
|---|
|  | 103 |  | 
|---|
|  | 104 | # We need yumdownloader to force some RPMs | 
|---|
|  | 105 | # XXX: This might be wrong. Sanity check what packages ou | 
|---|
|  | 106 | # have when done | 
|---|
|  | 107 | YUM install -y yum-utils | 
|---|
|  | 108 | yumdownloader krb5-libs | 
|---|
|  | 109 | # XXX: These version numbers are hardcoded, need some cli-fu to generalize | 
|---|
|  | 110 | rpm -i krb5-libs-*.i586.rpm | 
|---|
|  | 111 | rpm -U --force krb5-libs-*.scripts.1138.x86_64.rpm | 
|---|
|  | 112 |  | 
|---|
| [1058] | 113 | # env NSS_NONLOCAL_IGNORE=1 yum install scripts-base | 
|---|
| [1063] | 114 | YUM install -y scripts-base | 
|---|
| [387] | 115 |  | 
|---|
| [1058] | 116 | # Remember to set NSS_NONLOCAL_IGNORE=1 anytime you're setting up | 
|---|
|  | 117 | # anything, e.g. using yum. Otherwise useradd will query LDAP in a stupid way | 
|---|
| [1259] | 118 | # that makes it hang forever. (This is why we're using YUM, not yum) | 
|---|
| [881] | 119 |  | 
|---|
| [1058] | 120 | # Reload the iptables config to take down the restrictive firewall | 
|---|
| [1259] | 121 | service iptables restart | 
|---|
| [862] | 122 |  | 
|---|
| [1058] | 123 | # Copy over root's dotfiles from one of the other machines. | 
|---|
| [1259] | 124 | # Perhaps a useful change is to remove the default aliases | 
|---|
|  | 125 | # On 2009-07-01, the dotfiles to transfer where: | 
|---|
| [1381] | 126 | #   .bashrc .ldapvirc (<- HAS PRIVILEDGED DATA) | 
|---|
|  | 127 | #   .screenrc .ssh (<- directory) .vimrc | 
|---|
| [1259] | 128 | # Trying to scp from server to server won't work, as scp | 
|---|
|  | 129 | # will attempt to negotiate a server-to-server connection. | 
|---|
|  | 130 | # Instead, scp to your trusted machine as a temporary file, | 
|---|
|  | 131 | # and then push to the other server | 
|---|
| [1381] | 132 | # You'll need some way to authenticate to the server, and since | 
|---|
|  | 133 | # password logins are disabled, you'll need some way of | 
|---|
|  | 134 | # temporarily giving yourself credentials.  On a test server, | 
|---|
|  | 135 | # reenabling password authentication is ok: frob /etc/pam.d/sshd | 
|---|
|  | 136 | # and reverse apply r1068. | 
|---|
| [803] | 137 |  | 
|---|
| [1058] | 138 | # Replace rsyslog with syslog-ng by doing: | 
|---|
| [1259] | 139 | rpm -e --nodeps rsyslog | 
|---|
|  | 140 | YUM install -y syslog-ng | 
|---|
|  | 141 | chkconfig syslog-ng on | 
|---|
| [861] | 142 |  | 
|---|
| [1259] | 143 | # Install various dependencies of the scripts system, including | 
|---|
|  | 144 | # glibc-devel.i586 (ezyang: already installed for me), | 
|---|
|  | 145 | # python-twisted-core (ditto), mod_fcgid, nrpe, nagios-plugins-all. | 
|---|
|  | 146 | YUM install -y mod_fcgid | 
|---|
|  | 147 | YUM install -y nrpe | 
|---|
|  | 148 | YUM install -y nagios-plugins-all | 
|---|
| [788] | 149 |  | 
|---|
| [1058] | 150 | # Disable NetworkManager with chkconfig NetworkManager off. Configure | 
|---|
|  | 151 | # networking on the front end and back end, and the routing table to send | 
|---|
|  | 152 | # traffic over the back end. Make sure that chkconfig reports "network" on, so | 
|---|
|  | 153 | # that the network will still be configured at next boot. | 
|---|
| [1259] | 154 | # ezyang: For me, NetworkManager was not installed at this point, and | 
|---|
|  | 155 | # we had already done the basic config for networking front end and | 
|---|
|  | 156 | # back end (because I wanted ssh access, and not just conserver access) | 
|---|
| [788] | 157 |  | 
|---|
| [1058] | 158 | # Fix the openafs /usr/vice/etc <-> /etc/openafs mapping by changing | 
|---|
|  | 159 | #  /usr/vice/etc/cacheinfo to contain: | 
|---|
|  | 160 | #       /afs:/usr/vice/cache:10000000 | 
|---|
| [1178] | 161 | # Also fix ThisCell to contain athena.mit.edu in both directories | 
|---|
| [1382] | 162 | # WARNING: if you're installing a test server, this needs to be much | 
|---|
|  | 163 | # smaller; the max filesize on XVM is 10GB.  Pick something like | 
|---|
|  | 164 | # 500000 | 
|---|
| [1259] | 165 | echo "/afs:/usr/vice/cache:10000000" > /usr/vice/etc/cacheinfo | 
|---|
|  | 166 | # ezyang: ThisCell on b-k and c-w don't have anything special | 
|---|
|  | 167 | # written here | 
|---|
| [1382] | 168 | # If you're making a test server, some of the AFS parameters are | 
|---|
|  | 169 | # kind of retarded (and if you're low on disk space, will actually | 
|---|
|  | 170 | # exhaust our inodes). | 
|---|
|  | 171 | # Edit the parameters in /etc/sysconfig/openafs | 
|---|
| [788] | 172 |  | 
|---|
| [1058] | 173 | # Figure out why Zephyr isn't working. Most recently, it was because there | 
|---|
|  | 174 | # was a 64-bit RPM installed; remove it and install Joe's 32-bit one | 
|---|
| [1259] | 175 | YUM erase -y mit-zephyr | 
|---|
|  | 176 | # mit-zephyr has a spurious dependency on mit-krb-config | 
|---|
|  | 177 | yumdownloader mit-zephyr.i386 | 
|---|
|  | 178 | # if deps change, this breaks | 
|---|
| [1381] | 179 | YUM install -y libXaw.i586 libXext.i586 libXmu.i586 ncurses-libs.i586 readline.i586 | 
|---|
| [1259] | 180 | rpm -i --nodeps mit-zephyr-2.1-6-linux.i386.rpm | 
|---|
| [1381] | 181 | # test if it worked by sending an un-authed message | 
|---|
|  | 182 | zwrite -d -c scripts -i test | 
|---|
| [861] | 183 |  | 
|---|
| [1178] | 184 | # Install the athena-base, athena-lprng, and athena-lprng-misc RPMs | 
|---|
|  | 185 | # from the Athena 9 build (these are present in our yum repo).  Note | 
|---|
|  | 186 | # that you will have to use --nodeps for at least one of the lprng | 
|---|
|  | 187 | # ones because it thinks it needs the Athena hesiod RPM.  It doesn't | 
|---|
|  | 188 | # really.  Before doing this, run it without --nodeps and arrange to | 
|---|
|  | 189 | # install the rest of the things it really does depend on.  This will | 
|---|
|  | 190 | # include a bunch of 32-bit rpms; go ahead and install the .i586 versions | 
|---|
| [1259] | 191 | # of them. | 
|---|
|  | 192 | YUM install -y athena-base | 
|---|
|  | 193 | YUM install -y athena-lprng | 
|---|
|  | 194 | yumdownloader athena-lprng-misc | 
|---|
|  | 195 | # ezyang: I couldn't find any deps for this that existed in the repos | 
|---|
|  | 196 | # You might get a "find: `/usr/athena/info': No such file or directory" | 
|---|
|  | 197 | # error; this is fine | 
|---|
|  | 198 | rpm -i --nodeps athena-lprng-misc-9.4-0.i386.rpm | 
|---|
| [1178] | 199 |  | 
|---|
| [1058] | 200 | # Install the full list of RPMs that users expect to be on the | 
|---|
| [1259] | 201 | # scripts.mit.edu servers. | 
|---|
| [387] | 202 |  | 
|---|
| [1259] | 203 | # on another server, run: | 
|---|
|  | 204 | rpm -qa --queryformat "%{Name}.%{Arch}\n" | sort > packages.txt | 
|---|
|  | 205 | # arrange for packages.txt to be passed to the server, then run: | 
|---|
|  | 206 | # notice that yum is not capitalized | 
|---|
|  | 207 | # Also notice skip-broken | 
|---|
|  | 208 | cat packages.txt | NSS_NONLOCAL_IGNORE=1 xargs yum install -y --skip-broken | 
|---|
|  | 209 |  | 
|---|
| [1190] | 210 | # Check which packages are installed on your new server that are not | 
|---|
|  | 211 | # in the snapshot, and remove ones that aren't needed for some reason | 
|---|
|  | 212 | # on the new machine.  Otherwise, aside from bloat, you may end up | 
|---|
|  | 213 | # with undesirable things for security, like sendmail. | 
|---|
| [1259] | 214 | rpm -qa --queryformat "%{Name}.%{Arch}\n" | sort > newpackages.txt | 
|---|
|  | 215 | diff -u packages.txt newpackages.txt  | less | 
|---|
|  | 216 | # if all went well, you'll probably see multiple kernel versions | 
|---|
|  | 217 | # as the only diff | 
|---|
|  | 218 | # ezyang: I got exim installed as another package | 
|---|
| [1382] | 219 | # here's a cute script that removes all extra packages | 
|---|
|  | 220 | diff -u packages.txt newpackages.txt  | grep '+' | cut -c2- | grep -v "@" | grep -v "++" | xargs yum erase -y | 
|---|
| [1190] | 221 |  | 
|---|
| [1237] | 222 | # Check out the scripts /usr/vice/etc configuration | 
|---|
|  | 223 | cd /root | 
|---|
|  | 224 | mkdir vice | 
|---|
|  | 225 | cd vice | 
|---|
|  | 226 | svn co svn://scripts.mit.edu/trunk/server/fedora/config/usr/vice/etc etc | 
|---|
|  | 227 | \cp -a etc /usr/vice | 
|---|
|  | 228 |  | 
|---|
| [1058] | 229 | # Install the full list of perl modules that users expect to be on the | 
|---|
| [1108] | 230 | # scripts.mit.edu servers. | 
|---|
| [1058] | 231 | # - export PERL_MM_USE_DEFAULT=1 | 
|---|
|  | 232 | # - Run 'cpan', accept the default configuration, and do 'o conf | 
|---|
|  | 233 | #   prerequisites_policy follow'. | 
|---|
|  | 234 | # - Parse the output of perldoc -u perllocal | grep head2 on an existing | 
|---|
|  | 235 | #   server, and "notest install" them from the cpan prompt. | 
|---|
| [1109] | 236 | # TO DO THIS: | 
|---|
|  | 237 | # On another server, run: | 
|---|
| [1178] | 238 | # perldoc -u perllocal | grep head2 | cut -f 3 -d '<' | cut -f 1 -d '|' | sort -u | perl -ne 'chomp; print "notest install $_\n" if system("rpm -q --whatprovides \"perl($_)\" >/dev/null 2>/dev/null")' > /mit/scripts/config/perl-packages.txt | 
|---|
| [1109] | 239 | # Then on the server you're installing, | 
|---|
| [1190] | 240 | #    cat perl-packages.txt | perl -MCPAN -e shell | 
|---|
| [1259] | 241 | export PERL_MM_USE_DEFAULT=1 | 
|---|
|  | 242 | # XXX: Some interactive gobbeldygook | 
|---|
|  | 243 | cpan | 
|---|
|  | 244 | o conf prerequisites_policy follow | 
|---|
|  | 245 | o conf commit | 
|---|
|  | 246 | # on a reference server | 
|---|
|  | 247 | perldoc -u perllocal | grep head2 | cut -f 3 -d '<' | cut -f 1 -d '|' | sort -u | perl -ne 'chomp; print "notest install $_\n" if system("rpm -q --whatprovides \"perl($_)\" >/dev/null 2>/dev/null")' > perl-packages.txt | 
|---|
|  | 248 | # arrange for perl-packages.txt to be transferred to server | 
|---|
|  | 249 | cat perl-packages.txt | perl -MCPAN -e shell | 
|---|
| [812] | 250 |  | 
|---|
| [1058] | 251 | # Install the Python eggs and Ruby gems and PEAR/PECL doohickeys that are on | 
|---|
|  | 252 | # the other scripts.mit.edu servers and do not have RPMs. | 
|---|
| [1259] | 253 | # The general mode of operation will be to run the "list" command | 
|---|
|  | 254 | # on both servers, see what the differences are, check if those diffs | 
|---|
|  | 255 | # are packaged up as rpms, and install them (rpm if possible, native otherwise) | 
|---|
| [1178] | 256 | # - Look at /usr/lib/python2.6/site-packages and | 
|---|
|  | 257 | #           /usr/lib64/python2.6/site-packages for Python eggs and modules. | 
|---|
| [1259] | 258 | #   There will be a lot of gunk that was installed from packages; | 
|---|
|  | 259 | #   easy-install.pth will tell you what was easy_installed. | 
|---|
| [1178] | 260 | #   First use 'yum search' to see if the relevant package is now available | 
|---|
|  | 261 | #   as an RPM, and install that if it is.  If not, then use easy_install. | 
|---|
| [1432] | 262 | #   Pass -Z to easy_install to install them unzipped, as some zipped eggs | 
|---|
|  | 263 | #   want to be able to write to ~/.python-eggs.  (Also makes sourcediving | 
|---|
|  | 264 | #   easier.) | 
|---|
| [1058] | 265 | # - Look at `gem list` for Ruby gems. | 
|---|
| [1178] | 266 | #   Again, use 'yum search' and prefer RPMs, but failing that, 'gem install'. | 
|---|
| [1259] | 267 | #       ezyang: rspec-rails depends on rspec, and will override the Yum | 
|---|
|  | 268 | #       package, so... don't use that RPM yet | 
|---|
| [1058] | 269 | # - Look at `pear list` for Pear fruits (or whatever they're called). | 
|---|
| [1178] | 270 | #   Yet again, 'yum search' for RPMs before resorting to 'pear install'.  Note | 
|---|
|  | 271 | #   that for things in the beta repo, you'll need 'pear install package-beta'. | 
|---|
| [1259] | 272 | #   (you might get complaints about the php_scripts module; ignore them) | 
|---|
| [1190] | 273 | # - Look at `pecl list` for PECL things.  'yum search', and if you must, | 
|---|
| [1462] | 274 | #   'pecl install' needed items. If it doesn't work, try 'pear install | 
|---|
|  | 275 | #   pecl/foo' or 'pecl install foo-beta' or those two combined. | 
|---|
| [1259] | 276 | # Automating this... will require a lot of batonning between | 
|---|
|  | 277 | # the servers. Probably best way to do it is to write an actual | 
|---|
|  | 278 | # script. | 
|---|
| [785] | 279 |  | 
|---|
| [1259] | 280 | # Setup some Python config | 
|---|
|  | 281 | echo 'import site, os.path; site.addsitedir(os.path.expanduser("~/lib/python2.6/site-packages"))' > /usr/lib/python2.6/site-packages/00scripts-home.pth | 
|---|
| [812] | 282 |  | 
|---|
| [1178] | 283 | # Install the credentials.  There are a lot of things to remember here: | 
|---|
| [1259] | 284 | #   o This will be different if you're setting up our build/update server. | 
|---|
| [1178] | 285 | #   o You probably installed the machine keytab long ago | 
|---|
| [1259] | 286 | ls -l /etc/krb5.keytab | 
|---|
| [1178] | 287 | #   o Use ktutil to combine the host/scripts.mit.edu and | 
|---|
|  | 288 | #     host/scripts-vhosts.mit.edu keys with host/this-server.mit.edu in | 
|---|
|  | 289 | #     the keytab.  Do not use 'k5srvutil change' on the combined keytab | 
|---|
| [1259] | 290 | #     or you'll break the other servers. (real servers only) | 
|---|
| [1178] | 291 | #   o The daemon.scripts keytab | 
|---|
| [1259] | 292 | ls -l /etc/daemon.keytab | 
|---|
|  | 293 | #   o The SSL cert private key (real servers only) | 
|---|
|  | 294 | #   o The LDAP password for the signup process (real servers only) | 
|---|
|  | 295 | #   o The SQL password for the signup process (real servers only) | 
|---|
| [1320] | 296 | #   o The whoisd password (real servers only) | 
|---|
| [1259] | 297 | #   o The LDAP keytab for this server, which will be used later (real servers only) | 
|---|
|  | 298 | #   o Replace the ssh host keys with the ones common to all scripts servers (real servers only) | 
|---|
|  | 299 | #   o You'll install an LDAP certificate signed by the scripts CA later (real servers only) | 
|---|
| [1178] | 300 | #   o Make sure root's .k5login is correct | 
|---|
| [1259] | 301 | cat /root/.k5login | 
|---|
|  | 302 | #   o Make sure logview's .k5login is correct (real servers only) | 
|---|
| [387] | 303 |  | 
|---|
| [1058] | 304 | # If you are setting up a test server, pay attention to | 
|---|
|  | 305 | # /etc/sysconfig/network-scripts and do not bind scripts' IP address. | 
|---|
| [1259] | 306 | # You will also need to modify: | 
|---|
|  | 307 | #   o /etc/ldap.conf | 
|---|
|  | 308 | #       add: host scripts.mit.edu | 
|---|
|  | 309 | #   o /etc/nss-ldapd.conf | 
|---|
|  | 310 | #       replace: uri ***** | 
|---|
|  | 311 | #       with: uri ldap://scripts.mit.edu/ | 
|---|
|  | 312 | #   o /etc/openldap/ldap.conf | 
|---|
|  | 313 | #       add: URI ldap://scripts.mit.edu/ | 
|---|
|  | 314 | #            BASE dc=scripts,dc=mit,dc=edu | 
|---|
|  | 315 | #   o /etc/httpd/conf.d/vhost_ldap.conf | 
|---|
|  | 316 | #       replace: VhostLDAPUrl **** | 
|---|
|  | 317 | #       with: VhostLDAPUrl "ldap://scripts.mit.edu/ou=VirtualHosts,dc=scripts,dc=mit,dc=edu" | 
|---|
| [1450] | 318 | #   o /etc/postfix/virtual-alias-{domains,maps}-ldap.cf | 
|---|
|  | 319 | #       replace: server_host ***** | 
|---|
|  | 320 | #       with: server_host = ldap://scripts.mit.edu | 
|---|
| [1259] | 321 | # to use scripts.mit.edu instead of localhost. | 
|---|
|  | 322 | # XXX: someone should write sed scripts to do this | 
|---|
| [562] | 323 |  | 
|---|
| [1259] | 324 | # If you are setting up a test server, afsagent's cronjob will attempt | 
|---|
|  | 325 | # to be renewing with the wrong credentials (daemon.scripts). Change this: | 
|---|
|  | 326 | vim /home/afsagent/renew # replace all mentions of daemon.scripts.mit.edu | 
|---|
|  | 327 |  | 
|---|
| [1296] | 328 | # Install 389-ds-base and set up replication (see ./HOWTO-SETUP-LDAP | 
|---|
|  | 329 | #   and ./389-ds-enable-ssl-and-kerberos.diff). | 
|---|
| [785] | 330 |  | 
|---|
| [1058] | 331 | # Make the services dirsrv, nslcd, nscd, postfix, and httpd start at | 
|---|
|  | 332 | # boot. Run chkconfig to make sure the set of services to be run is | 
|---|
|  | 333 | # correct. | 
|---|
| [1259] | 334 | chkconfig dirsrv on | 
|---|
|  | 335 | chkconfig nslcd on | 
|---|
|  | 336 | chkconfig nscd on | 
|---|
|  | 337 | chkconfig postfix on | 
|---|
|  | 338 | chkconfig httpd on | 
|---|
| [818] | 339 |  | 
|---|
| [1259] | 340 | # Postfix doesn't actually deliver mail; fix this | 
|---|
|  | 341 | cd /etc/postfix | 
|---|
|  | 342 | postmap virtual | 
|---|
| [1178] | 343 |  | 
|---|
| [1451] | 344 | # Munin might not be monitoring packages that were installed after it | 
|---|
|  | 345 | munin-node-configure --suggest --shell | sh | 
|---|
|  | 346 |  | 
|---|
| [1058] | 347 | # Run fmtutil-sys --all, which does something that makes TeX work. | 
|---|
| [1259] | 348 | fmtutil-sys --all | 
|---|
|  | 349 | # ezyang: I got errors on xetex | 
|---|
| [803] | 350 |  | 
|---|
| [1058] | 351 | # Ensure that PHP isn't broken: | 
|---|
| [1259] | 352 | mkdir /tmp/sessions | 
|---|
|  | 353 | chmod 01777 /tmp/sessions | 
|---|
| [954] | 354 |  | 
|---|
| [1481] | 355 | # Ensure fcgid isn't broken | 
|---|
| [1482] | 356 | chmod 755 /var/run/mod_fcgid # ezyang: I suspect this is no longer necessary | 
|---|
| [1259] | 357 |  | 
|---|
|  | 358 | # Fix etc by making sure none of our config files got overwritten | 
|---|
|  | 359 | cd /etc | 
|---|
|  | 360 | svn status | grep M | 
|---|
| [1382] | 361 | # ezyang: I had to revert krb5.conf (not with latest), nsswitch.conf and sysconfig/openafs | 
|---|
| [1259] | 362 |  | 
|---|
| [1382] | 363 | # ThisCell got clobbered, replace it with athena.mit.edu | 
|---|
|  | 364 | echo "athena.mit.edu" > /usr/vice/etc/ThisCell | 
|---|
|  | 365 |  | 
|---|
| [1058] | 366 | # Reboot the machine to restore a consistent state, in case you | 
|---|
|  | 367 | # changed anything. | 
|---|
| [1259] | 368 | # ezyang: When I rebooted, the following things happened: | 
|---|
|  | 369 | #   o Starting kdump failed (this is ok) | 
|---|
|  | 370 | #   o postfix mailbombed us | 
|---|
|  | 371 | #   o firstboot configuration screen popped up (ignored; manually will do | 
|---|
|  | 372 | #     chkconfig after the fact) | 
|---|
| [875] | 373 |  | 
|---|
| [1058] | 374 | # (Optional) Beat your head against a wall. | 
|---|
| [562] | 375 |  | 
|---|
| [1058] | 376 | # Possibly perform other steps that I've neglected to put in this | 
|---|
|  | 377 | # document. | 
|---|
| [1259] | 378 | #   o For some reason, syslog-ng wasn't turning on automatically, so we weren't | 
|---|
|  | 379 | #     getting spew | 
|---|
|  | 380 |  | 
|---|
|  | 381 | # Some info about changing hostnames: it appears to be in: | 
|---|
|  | 382 | #   o /etc/sysconfig/network | 
|---|
|  | 383 | #   o your lvm thingies; probably don't need to edit | 
|---|
| [1382] | 384 |  | 
|---|
|  | 385 | # More stuff for test servers | 
|---|
|  | 386 | #   - You need a self-signed SSL cert.  Generate with: | 
|---|
|  | 387 | openssl req -new -x509 -keyout /etc/pki/tls/private/scripts.key -out /etc/pki/tls/certs/scripts.cert -nodes | 
|---|
|  | 388 | #     Also make /etc/pki/tls/certs/ca.pem match up | 
|---|
|  | 389 | #   - Make (/etc/aliases) root mail go to /dev/null, so we don't spam people | 
|---|
|  | 390 | #   - Edit /etc/httpd/conf.d/scripts-vhost-names.conf to have scripts-fX-test.xvm.mit.edu | 
|---|
|  | 391 | #     be an accepted vhost name | 
|---|
|  | 392 | #   - Look at the old test server and see what config changes are floating around | 
|---|