Apaches

From Wikitech
Revision as of 08:18, 12 June 2005 by 80.190.240.126 (Talk)

Jump to: navigation, search

Contents

Restarting

All

Connect to zwinger and type apache-graceful-all. If you see permission denied or a password request, say which server name appears in the error message or password request in the IRC channel and one of the roots will add you to that server.

One, to test a change

Either connect to zwinger and ssh wherever or connect to the web server you want to test on. Then type apache-graceful to restart apache on that web server only. Test your change with telnet, as with this foundation example, with what you type in italics:


telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /fundraising HTTP/1.1
Host:wikimediafoundation.org
(an empty line)

The raw HTML for the page will now be displayed in your window. You can copy and paste that into a file on your hard drive and open it with your browser to see the effect. Host is the name of the web site after the http:// part in your browser URL area. GET /fundraising is the part after the site name. The example gets http://wikimediafoundation.org/fundraising.

Restarting httpd

If httpd is broken, sudo apache-restart to restart a single httpd. Use dsh to apply it to all. If you get hundreds of instances counted by ps aux|grep httpd|wc -l and the server is having problems you might need to do this.

Starting load-balancing ICPAgent

This is started automatically when the computer restarts and is necessary for the Apache to take any work. To start:

  • use /usr/local/bin/icpagent, has the right timings for each host


Logging

Text output on stderr from various external commands, as well as some apache errors, are in /apache/logs/error_log on each server. PHP errors are in /apache/logs/php-errors . Most apache error messages, such as file not found errors, are in hostname-error_log, for example /apache/logs/en.wikipedia.org-error_log .

Apache access logs are mostly disabled. Webalizer statistics are made using the squids logs instead.


Apache setup checklist

automated procedure

New apache deployments (on FC3) may be done with deployment scripts. Before you do anything, please add DNS entries and set up NFS ACLs. Then:

mount 10.0.0.4:/home /home
cd /home/wikipedia/deployment/apache
sh prepare-host
reboot

Hey, yeah, you've got a running apache with all checklists below executed...

main apache farm

  • Install apt-get
  • Add server to export lists at zwinger:/etc/exports and yongle:/etc/exports
  • Update fstab, mount file systems
  • install apache from /home/wikipedia/src/apache_1.3.33
    • doesn't work on ariel
  • install PHP from /home/wikipedia/src/php/php-4.3.10 (is this the right version? yes)
    • doesn't work on ariel
    • how to setup Turck MMcache?
      • /home/wikipedia/src/turck (choose the right version for the php)
  • tex, tidy, imagemagick: apt-get install tetex*
apt-get install ImageMagick tetex tetex-latex tetex-fonts tetex-dvips tidy libtidy sendmail-cf
  • for EasyTimeline, install ploticus: scp /usr/local/bin/pl from one of the other machines to /usr/local/bin/
  • sudo
  • configure sendmail
    • in /etc/mail/sendmail.mc, set
define(`SMART_HOST',`smtp.pmtpa.wmnet')
    • in /etc/mail, call make
  • database permissions
    • Add the host to maintenance/ourusers.php
    • Run the file and source the resulting SQL as root
  • add hostname to appropriate files in /usr/local/dsh/node_groups/ on zwinger
  • ganglia
ln -sf /home/wikipedia/gmond/internal_apache.conf /etc/gmond.conf
  • ICPAgent:
    • scp zwinger:/usr/local/bin/icpagent /usr/local/bin
    • add /usr/local/bin/icpagent to /etc/rc.local
    • possibly adjust the weight in /usr/local/bin/icpagent a bit if the default (5.0) isn't right

download.wikimedia.org etc

  • currently on zwinger

Test cases

Here are some test cases you can use to test the apache configuration after changing something.

GET /wiki/Foo HTTP/1.1
Host: en.wikipedia.org

GET /wiki/Foo HTTP/1.1
Host: www.wikipedia.org

GET / HTTP/1.1
Host: en2.wikipedia.org

GET /wiki/Main_Page HTTP/1.1
Host: www.wikipedia.com

GET / HTTP/1.1
Host: wikipedia.com

GET / HTTP/1.1
Host: wikibooks.org

GET / HTTP/1.1
Host: wikiquote.org

GET / HTTP/1.1
Host: dk.wikipedia.org

GET / HTTP/1.1
Host: foo.wikipedia.org

GET /wiki/Main_Page HTTP/1.1
Host: test.wikipedia.org

GET / HTTP/1.1
Host: webshop.wikipedia.org

GET / HTTP/1.1
Host: boards.wikimedia.org

GET /wiki/Foo HTTP/1.1
Host: en.wikipedia.org
User-Agent: Exalead

GET /wiki/Foo HTTP/1.1
Host: meta.wikimedia.org

GET / HTTP/1.1
Host: en.wiktionary.org



Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox