Apaches

From Wikitech
(Difference between revisions)
Jump to: navigation, search
(main apache farm: apt-get command)
(mention apache-restart)
Line 17: Line 17:
  
 
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.
 
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.
  
 
==Logging==
 
==Logging==

Revision as of 09:27, 20 October 2004

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.

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

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.29
    • doesn't work on ariel
  • install PHP from /home/wikipedia/src/php-4.3.4 (is this the right version?)
    • doesn't work on ariel
    • how to setup Turck MMcache?
  • tex, tidy, imagemagick: apt-get install tetex*
apt-get install ImageMagick tetex tetex-latex tetex-fonts tetex-dvips tidy libtidy
  • ploticus: scp /usr/local/bin/pl from one of the other machines to /usr/local/bin/
  • sudo
  • configure sendmail
  • database permissions
    • Command to run in mysql shell (on master) to allow connections from the new apache :
      • grant all on %wiki.* to wikiuser@apachename identified by 'password';
      • grant all on %wiktionary.* to wikiuser@apachename identified by 'password';
      • grant all on %wikibooks.* to wikiuser@apachename identified by 'password';
      • grant all on %wikiquote.* to wikiuser@apachename identified by 'password';
      • what about webshop?? and Board ??
  • add hostname to appropriate files in /usr/local/dsh/node_groups/ on zwinger
  • ganglia

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