Apaches
(→Starting load-balancing ICPAgent) |
(→Stopping load-balancing ICPAgent) |
||
| Line 25: | Line 25: | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
==Logging== | ==Logging== | ||
Revision as of 21:56, 13 February 2009
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
- Ensure the server is in the netboot.cfg file located in /srv/autoinstall/netboot.cfg on khaldun in the apaches section.
- Ensure an entry exists in /etc/dhcpd.conf on zwinger.
- Netboot the server and install Ubuntu.
- SSH into the server and set the root password.
- Run the following on the server:
- apt-get update && apt-get dist-upgrade -y && apt-get install wikimedia-task-appserver && reboot && exit
- Wait for the server to come back online, ensure it starts apache correctly
- If the server is part of the memcached group, follow instructions on Memcached
- Run the setup of Ganglia
- If the server is new, you will need to do the following:
- Login to the LVS server for apaches (lvs3 as of 2009-02-13) and add the new servers to /etc/pybal/apaches
- If the server is not new do the following:
- Ensure the server is now enabled in pybal on the LVS server in the file /etc/pybal/apaches
- You will need to add the server to DSH groups if new, or check if they are commented, if the server is not new:
- Add/Uncomment the host to /usr/local/dsh/node_groups/apaches and mediawiki-installation, as well as any other groups needed (apaches_pmtpa perhaps?)
- Reload nagios to accept the changes to the node groups:
- cd /home/wikipedia/conf/nagios && ./sync
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 User-agent: testthing GET /wiki/Foo HTTP/1.1 Host: www.wikipedia.org User-agent: testthing GET / HTTP/1.1 Host: en2.wikipedia.org User-agent: testthing GET /wiki/Main_Page HTTP/1.1 Host: www.wikipedia.com User-agent: testthing GET / HTTP/1.1 Host: wikipedia.com User-agent: testthing GET / HTTP/1.1 Host: wikibooks.org User-agent: testthing GET / HTTP/1.1 Host: wikiquote.org User-agent: testthing GET / HTTP/1.1 Host: dk.wikipedia.org User-agent: testthing GET / HTTP/1.1 Host: foo.wikipedia.org User-agent: testthing GET /wiki/Main_Page HTTP/1.1 Host: test.wikipedia.org User-agent: testthing GET / HTTP/1.1 Host: webshop.wikipedia.org User-agent: testthing GET / HTTP/1.1 Host: boards.wikimedia.org User-agent: testthing GET /wiki/Foo HTTP/1.1 Host: en.wikipedia.org User-Agent: Exalead GET /wiki/Foo HTTP/1.1 Host: meta.wikimedia.org User-agent: testthing GET / HTTP/1.1 Host: en.wiktionary.org User-agent: testthing