The PhP code is in ~www/php
.
The source code resides in a svn repository on
repo.eecs.berkeley.edu
in the gsrc
project:
We do our work as the www
user on
moog
,
so there is no need for individual logins on source
.
That said, if you wanted to check out the php source for some reason, use:
svn co https://repo.eecs.berkeley.edu/svn/projects/gsrc/php/
/usr/local/apache/conf/httpd.conf
is
consulted. This file maps the different website
urls to different locations. This file also
makes Apache aware of PhP files.
/usr/local/apache/conf/extra/httpd-vhosts.conf
contains sections for each
host.
/usr/local/apache/conf/extra/httpd-ssl.conf
.
SSL is used by the login page.
httpd-vhosts.conf
file contains
Include "/usr/local/apache/conf/rewrite.conf"
/usr/local/apache/conf/rewrite.conf
file handles rewrites for thinks like bugzilla
and the wiki.
The last line is:
RewriteRule ^(.*)$ /home/www/php/get.php [L,NS]This line says that if the request has not been handled elsewhere, read
/home/www/php/get.php
/usr/local/apache/conf/rewrite_log
If you need to view that file, you might want to
use tail
and grep
tail -10000 /usr/local/apache/logs/rewrite_log | grep events/11/symposium2011_notice.pdfThe above command might return:
128.32.48.155 - - [06/Oct/2011:11:52:59 --0700] [www.e3s-center.org/sid#3d7070][rid#7e4558/subreq] (2) init rewrite engine with requested uri /e3scenter//events/11/symposium2011_notice.pdf 128.32.48.155 - - [06/Oct/2011:11:52:59 --0700] [www.e3s-center.org/sid#3d7070][rid#7e4558/subreq] (1) pass through /e3scenter//events/11/symposium2011_notice.pdf 128.32.48.155 - - [06/Oct/2011:11:52:59 --0700] [www.e3s-center.org/sid#3d7070][rid#5fd0b8/initial] (2) init rewrite engine with requested uri /events/11/symposium2011_notice.pdf 128.32.48.155 - - [06/Oct/2011:11:52:59 --0700] [www.e3s-center.org/sid#3d7070][rid#5fd0b8/initial] (2) rewrite '/events/11/symposium2011_notice.pdf' -> '/home/www/php/get.php'Note that the above rewrites to
/home/www/php/get.php
, which is where most files end up.
/home/www/php/get.php
looks at the
server portion of the URL and then includes the
corresponding get.php
file.
if ($sites[$_SERVER['SERVER_NAME']]) { include "${_SERVER['SERVER_NAME']}/get.php"; } else { html_unknown($_SERVER['SCRIPT_URL']); }If the URL is
http://chess.eecs.berkeley.edu
,
then
$_SERVER['SERVER_NAME']
will be set to
chess.eecs.berkeley.edu
, so
/home/www/php/chess.eecs.berkeley.edu/get.php
will be read.
get.php
file.
layout/html.inc.php
file, for example, /home/www/php/chess.eecs.berkeley.edu/layout/html.inc.php
.
/home/www/php
directory has two
major subdirectories:
/home/www/php/include
- common includes,
such as arrays that define strings
/home/www/php/subpages
- used for
subpages such as the admin pages.