Ms4
ArielGlenn (Talk | contribs) (→other files) |
ArielGlenn (Talk | contribs) (→other files) |
||
| Line 66: | Line 66: | ||
You get this from the toolserver repo. Check out the spec files (tyou need a bunch so just get them all): | You get this from the toolserver repo. Check out the spec files (tyou need a bunch so just get them all): | ||
svn co https://svn.toolserver.org/svnroot/toolserver/trunk/ts-specs | svn co https://svn.toolserver.org/svnroot/toolserver/trunk/ts-specs | ||
| − | Do the build by: | + | Do the build (as a non-root user)by: |
pkgtool -v build-only --autodeps --download www/TSphp52.spec www/TScurl security/TSlibmcrypt.spec | pkgtool -v build-only --autodeps --download www/TSphp52.spec www/TScurl security/TSlibmcrypt.spec | ||
| + | Do the install of packages that get built (some need to be installed before the rest will build) by: | ||
| + | pkgadd -d /home/my-username-here/packages/PKGS TSpackagename-here | ||
== changing config files == | == changing config files == | ||
Revision as of 23:36, 20 August 2009
Ms4 is a Sun something-or-other. I'll put more information in here soon.
Ms4 is going to be our primary server for thumbnails. Currently it servers some of them; the filesystem is nfs-mounted on the apaches and on ms1, and some of the thumb directories on the ms1 share are sym links to the ms4 locations.
Contents |
Web server set up
install
We are running the Sun Java Web Server 7. To get this:
- Make sure you have a login at sunsolve (I wonder if you need this); you can create it for free.
- One the left where it says "Change Contract" click that, and add our contract number. You are supposed to log out and log back in for it to take effect.
- Go to Sun and download the software. We just need the plain web server, not all the rest. To do this, click through to the point where you actually click to download; when the download starts, interrupt it, right click on the link in the page to copy it and then use wget on ms4 to retrieve the file. (Uploading it form the office is going to be too slow.) The session token is only good for a few minutes.
- Install info: [1]. In a nutshell: unpack the tarball someplace convenient for you, cd into the directory and run ./setup --console
- The install root will be /opt/webserver7, hostname ms4, port 80, runtime id apache, /export/thumbs for the document root.
config files
If you need to go fool with the configuration later, the file you want is server.xml and it's in /opt/webserver7/https-ms4/config.
If you wind up copying the /opt/webserver7/https-*/config files to another host, you will have to move the directory to reflect the new hostname and then edit all of the scripts under /opt/webserver7/https-*/bin to change the hostname as well. If you're not using /export/thumbs on the new host, edit that too. Also, edit /opt/webserver7/https-*/config/server.xml to change the hostname there. You may also need to tweak /opt/webserver7/https-*/obj.conf to change directory paths and so on.
Copies of the config files are on /home/wikipedia/conf/webserver7 in the directory with the hostname. (It would be nice to have a repo!)
startup
If you need the web server to start on boot and you didn't specify it at install time, you're going to go looking for /etc/init.d/webserver7 and it won't be there. Steal one from another Sun box running Solaris (if anyone knows the right way, please add it here :-P) Then cd into /etc/rc2.d and
ln -s ../init.d/webserver7 K05webserver7
and cd into /etc/rc3.d and
ln -s ../init.d/webserver7 S75webserver7
The new services management system under Solaris 10 uses svcs but this is a legacy app so it uses scripts in init.d. You should have a look at the scripts bin/startserv and bin/stopserv because they may, depending on how the webserver was installed, contain a lot of cruft about SERVER_FMRI, SERVER_SVC_START_CMD, SERVER_SVC_STOP_CMD without there actually being an svc instance for the webserver. Run svcs -a to see if there is an instance (probably not). You can toss that junk. If you don't, the script will claim to succeed but actually no webserver will start.
(If someone has the info on how to add the legacy scripts to svcs... and whether we want that... please add it here. It seems to want an xml file in /var/svc/manifest, couldn't find one to steal from; how is it running on ms1??)
other files
You need the /opt/webserver7/https-ms4/cgi-bin directory (it contains oggz-chop). This in turn needs /top/ts/lib/libogg* and /opt/ogzz/lib/liboggz* (we should see how these are supposed to be installed, maybe from ts repo?)
If you want to be able to look at the access logs live (hint: yes, you do!), you need some dtrace stuff: go to /home/wikipedia/conf/sunwebserver/optlocalshare and put the files over to /opt/local/share on the thumb server. Also put dtrace.so from /home/wikipedia/conf/sunwebserver/optwebserver7/plugins and put it into /opt/webserver7/plugins on the thumb server.
You need to have a place for the thumbs; assuming we are running Solaris, and that we put them in /export/thumbs, you need:
- zpool create export raidz1 /dev/......
- creates the top level zfs pool (see Zfs for more information).
- zfs create export/thumbs
- creates the zfs filesystem where the thumbs and the scripts will live
The filesystem needs to be exported everywhere:
- zfs share
It needs to be mounted everywhere (apaches, scalers, anywhere else?):
- prestuff 'list' with apaches, scalers, zwinger, whatever else needs it mounted, then
- dsh -f -w $list -e 'echo "ms4.wikimedia.org:/export/thumbs /mnt/thumbs nfs bg,soft,tcp,rsize=8192,wsize=8192,timeo=14 0 0" >> /etc/fstab'
For snapshots, replication, and some metrics you need the files in /home/wikipedia/conf/zfs-tools/; scp over the ones in opttsbin to /opt/ts/bin/ and in optlocalbin to /opt/local/bin. Then look at one of the crontabs on the /home/wikipedia/conf/zfs-tools/crontab directory and ad what you need to the crontab on the thumb host. (Please make a subdir for it and scp it back over to /home/wikipedia/conf/zfs-tools/crontab/server-name if this is a new host.)
We need rsync to be in a standard place, right now it/s in /opt/ts/bin, so symlink it into /opt/local/bin and /usr/bin on your host.
You need to make the directory sync-from-home in /export/thumbs, and you should symlink it to "scripts" in that same directory. Then push over the contents: from /home/wikipedia/upload-scripts check the sync script, add your server to it if needed, and run (hey, it might be nice if it could sync to just one server, huh? Maybe later.)
Additional things you need/want:
- hdtool
This is in the sun package SUNWhd and you get it by grabbing the cd of firmware and tools for the X4500 or X4540 or whatever yourmodel is. The X4540 software is here [2] and the X4500 is here [3]. When you get to the point where you are downloading in Firefox, you can stop the download, go to your host and wget there; you'll need to do wget -O filename url because otherwise it will complain that the filename is too long. Once retrieved, install it with pkgadd -d ./SUNWhd-version-number-here.pkg It installs in /usr/bin/hd with doc in /opt/SUNWhd/hd/bin/hd.html
- php
You get this from the toolserver repo. Check out the spec files (tyou need a bunch so just get them all):
svn co https://svn.toolserver.org/svnroot/toolserver/trunk/ts-specs
Do the build (as a non-root user)by:
pkgtool -v build-only --autodeps --download www/TSphp52.spec www/TScurl security/TSlibmcrypt.spec
Do the install of packages that get built (some need to be installed before the rest will build) by:
pkgadd -d /home/my-username-here/packages/PKGS TSpackagename-here
changing config files
If you wind up editing the config files on a running instance of the webserver, you don't kill -HUP to get it to reread the config files. Instead, you run /opt/webserver7/https-servername/bin/reconfig ro force the reread.
This doesn't work in all cases; see [4] (primarily if you touch certain things in the server.xml file). In this case you will have to /etc/init.d/webserver7 restart (hrd stop and restart of the server).
More info:
- [5]: Sun FAQ on installing