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