Commit 6cd688f9 authored by Leigh B Stoller's avatar Leigh B Stoller

Start on the move from Apache 1.3 to 2.2 ...

* The httpd.conf file I started with came from Dave's linux-port branch,
  and subsequently whacked for FreeBSD installation. Sorry for not using
  git to bring the base version in.

* Configure changes to determine what version of apache is installed, and
  modify behaviour in makefiles accordingly.

* Along with Apache 2.2 comes the latest version of PHP5, and that requires
  a bogus timezone directive in php.ini to prevent endless warnings. So I
  moved the entire php,ini install from ops/boss-install to here.

Note that I had to use the 8.2 ports tree to build this stuff, and it the
usual headache cause options and directives have changed.
parent 850ceda0
...@@ -86,6 +86,7 @@ BRAINSTEM_DIR = @BRAINSTEM_DIR@ ...@@ -86,6 +86,7 @@ BRAINSTEM_DIR = @BRAINSTEM_DIR@
WITH_EMULAB = @WITH_EMULAB@ WITH_EMULAB = @WITH_EMULAB@
OPSVM_ENABLE = @OPSVM_ENABLE@ OPSVM_ENABLE = @OPSVM_ENABLE@
OPSVM_MOUNTPOINT= @OPSVM_MOUNTPOINT@ OPSVM_MOUNTPOINT= @OPSVM_MOUNTPOINT@
APACHE_VERSION = @APACHE_VERSION@
host_cpu = @host_cpu@ host_cpu = @host_cpu@
......
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2002-2010 University of Utah and the Flux Group. # Copyright (c) 2002-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
# #
...@@ -22,7 +22,18 @@ endif ...@@ -22,7 +22,18 @@ endif
include $(OBJDIR)/Makeconf include $(OBJDIR)/Makeconf
CONFIG_FILES = httpd.conf httpd.conf-ops CONFIG_FILES = httpd.conf-ops php.ini
#
# Move to Apache 22 ...
#
ifeq ($(APACHE_VERSION),22)
CONFIG_FILES += httpd.conf-v2
SCRIPT_HACK = 0
else
CONFIG_FILES += httpd.conf-v1
endif
INSTALL_PHP_CONFIG = /usr/local/etc
# #
# Force dependencies to make sure configure regenerates if the .in file # Force dependencies to make sure configure regenerates if the .in file
...@@ -46,8 +57,10 @@ $(INSTALL_APACHE_CONFIG)/%: % ...@@ -46,8 +57,10 @@ $(INSTALL_APACHE_CONFIG)/%: %
# #
# XXX ugh, do the same thing to detect php5... # XXX ugh, do the same thing to detect php5...
# #
httpd.conf.fixed: httpd.conf # Note that ths is not needed for apache22.
-@cp httpd.conf httpd.conf.fixed #
httpd.conf.fixed: httpd.conf-v1
-@cp httpd.conf-v1 httpd.conf.fixed
@if [ -x /usr/local/libexec/apache/mod_auth_mysql.so ]; then \ @if [ -x /usr/local/libexec/apache/mod_auth_mysql.so ]; then \
sed -i "" -e '/^LoadModule auth_mysql/s/libauth/mod_auth/' httpd.conf.fixed; \ sed -i "" -e '/^LoadModule auth_mysql/s/libauth/mod_auth/' httpd.conf.fixed; \
echo "Updated httpd.conf for auth_mysql"; \ echo "Updated httpd.conf for auth_mysql"; \
...@@ -92,14 +105,22 @@ ifeq ($(SCRIPT_HACK),1) ...@@ -92,14 +105,22 @@ ifeq ($(SCRIPT_HACK),1)
$(INSTALL) -m 755 $(SRCDIR)/apache-emulab /usr/local/etc/rc.d/apache.sh $(INSTALL) -m 755 $(SRCDIR)/apache-emulab /usr/local/etc/rc.d/apache.sh
endif endif
ifeq ($(APACHE_VERSION),22)
install: install-dirs install-scripts httpd.conf-v2
$(INSTALL_DATA) httpd.conf-v2 $(INSTALL_APACHE_CONFIG)/httpd.conf
else
install: install-dirs install-scripts httpd.conf.fixed install: install-dirs install-scripts httpd.conf.fixed
$(INSTALL_DATA) httpd.conf.fixed $(INSTALL_APACHE_CONFIG)/httpd.conf $(INSTALL_DATA) httpd.conf.fixed $(INSTALL_APACHE_CONFIG)/httpd.conf
endif
control-install: install-dirs install-scripts httpd.conf-ops.fixed control-install: install-dirs install-scripts httpd.conf-ops.fixed
$(INSTALL_DATA) httpd.conf-ops.fixed $(INSTALL_APACHE_CONFIG)/httpd.conf $(INSTALL_DATA) httpd.conf-ops.fixed $(INSTALL_APACHE_CONFIG)/httpd.conf
install-php-ini: php.ini
$(INSTALL_DATA) php.ini $(INSTALL_PHP_CONFIG)/php.ini
else else
install-scripts install control-install: install-scripts install control-install:
@echo "Cannot install Apache config in dev tree" @echo "Cannot install Apache config in dev tree"
endif endif
clean: clean:
rm -f $(CONFIG_FILES) *.fixed php.ini
This diff is collapsed.
[PHP]
;
; So that quotes are not escaped. Needed for netbuild application.
;
magic_quotes_gpc = Off
;
; Our scripts depend on this!
;
register_globals = On
;
; Turn off the feature of php that kills programs after a set execution time
;
max_execution_time = 0
;
; Redirect php errors someplace easier to see
;
display_errors = Off
log_errors = On
error_log = "@prefix@/log/php-errors.log"
;
; Starting at some point, PHP5 refuses to trust the system timezone
; and requires it be set. Otherwise it prints out warnings like crazy.
; How stupid is this?
;
date.timezone = @OURTIMEZONE@
...@@ -731,6 +731,7 @@ FSDIR_SCRATCH ...@@ -731,6 +731,7 @@ FSDIR_SCRATCH
FS_WITH_QUOTAS FS_WITH_QUOTAS
TRACK_INTERSWITCH_BANDWIDTH TRACK_INTERSWITCH_BANDWIDTH
TIMESTAMPS TIMESTAMPS
OURTIMEZONE
UNIFIED_BOSS_AND_OPS UNIFIED_BOSS_AND_OPS
DISABLE_NSE DISABLE_NSE
DISABLE_NAMED_SETUP DISABLE_NAMED_SETUP
...@@ -860,6 +861,7 @@ ASSIGN ...@@ -860,6 +861,7 @@ ASSIGN
SSH_ARGS SSH_ARGS
INSTALL_RCDIR INSTALL_RCDIR
INSTALL_APACHE_CONFIG INSTALL_APACHE_CONFIG
APACHE_VERSION
BRAINSTEM_DIR BRAINSTEM_DIR
OPT_CFLAGS OPT_CFLAGS
EVENTSYS EVENTSYS
...@@ -4952,6 +4954,7 @@ done ...@@ -4952,6 +4954,7 @@ done
# #
...@@ -5050,6 +5053,7 @@ SELFLOADER_DATA="__DATA__" ...@@ -5050,6 +5053,7 @@ SELFLOADER_DATA="__DATA__"
NEEDMROUTED=0 NEEDMROUTED=0
OPSVM_ENABLE=0 OPSVM_ENABLE=0
OPSVM_MOUNTPOINT="/ops" OPSVM_MOUNTPOINT="/ops"
OURTIMEZONE="America/Denver"
# #
# XXX You really don't want to change these! # XXX You really don't want to change these!
...@@ -5574,12 +5578,20 @@ if test "${with_apache_config_dir+set}" = set; then ...@@ -5574,12 +5578,20 @@ if test "${with_apache_config_dir+set}" = set; then
else else
INSTALL_APACHE_CONFIG="/usr/local/etc/apache" foo=`httpd -V | grep SERVER_CONFIG_FILE | grep 'apache2'`
if test "$foo" = ""; then
INSTALL_APACHE_CONFIG="/usr/local/etc/apache"
APACHE_VERSION="1.3"
else
INSTALL_APACHE_CONFIG="/usr/local/etc/apache22"
APACHE_VERSION="22"
fi
fi fi
# #
# Path to garcia installation # Path to garcia installation
# #
...@@ -7145,11 +7157,28 @@ $as_echo "$as_me: WARNING: protogeni/rspec-geni submodule not intialized yet" >& ...@@ -7145,11 +7157,28 @@ $as_echo "$as_me: WARNING: protogeni/rspec-geni submodule not intialized yet" >&
echo "Please cd into your source directory and run:" echo "Please cd into your source directory and run:"
echo " git submodule init" echo " git submodule init"
echo " git submodule update" echo " git submodule update"
echo "Then rerun configure" echo "Then rerun configure in your object tree"
exit 1; exit 1;
fi fi
fi fi
#
# Determine the timezone (stupidity in PHP5, see apache/php.ini)
#
if test -e "$srcdir/utils/gettimezone.pl"; then
echo -n "Checking to see what timezone we are ... ";
ZONE=`$srcdir/utils/gettimezone.pl`
if test $? -ne 0; then
{ $as_echo "$as_me:$LINENO: WARNING: Cannot find gettimezone script; defaulting to $OURTIMEZONE" >&5
$as_echo "$as_me: WARNING: Cannot find gettimezone script; defaulting to $OURTIMEZONE" >&2;};
fi
OURTIMEZONE=$ZONE
echo "$OURTIMEZONE"
else
{ $as_echo "$as_me:$LINENO: WARNING: Cannot find gettimezone script; defaulting to $OURTIMEZONE" >&5
$as_echo "$as_me: WARNING: Cannot find gettimezone script; defaulting to $OURTIMEZONE" >&2;};
fi
# #
# Merge build # Merge build
# #
...@@ -7312,7 +7341,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -7312,7 +7341,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
$eventfiles \ $eventfiles \
$winfiles \ $winfiles \
$pelabfiles \ $pelabfiles \
apache/GNUmakefile apache/httpd.conf \ apache/GNUmakefile apache/httpd.conf-v1 apache/httpd.conf-v2 apache/php.ini \
xmlrpc/GNUmakefile xmlrpc/emulabclient.py xmlrpc/emulabserver.py \ xmlrpc/GNUmakefile xmlrpc/emulabclient.py xmlrpc/emulabserver.py \
xmlrpc/sshxmlrpc_client.py xmlrpc/sshxmlrpc_server.py \ xmlrpc/sshxmlrpc_client.py xmlrpc/sshxmlrpc_server.py \
xmlrpc/sslxmlrpc_client.py xmlrpc/sslxmlrpc_server.py \ xmlrpc/sslxmlrpc_client.py xmlrpc/sslxmlrpc_server.py \
......
...@@ -129,6 +129,7 @@ AC_SUBST(FSDIR_SCRATCH) ...@@ -129,6 +129,7 @@ AC_SUBST(FSDIR_SCRATCH)
AC_SUBST(FS_WITH_QUOTAS) AC_SUBST(FS_WITH_QUOTAS)
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH) AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
AC_SUBST(TIMESTAMPS) AC_SUBST(TIMESTAMPS)
AC_SUBST(OURTIMEZONE)
AC_SUBST(UNIFIED_BOSS_AND_OPS) AC_SUBST(UNIFIED_BOSS_AND_OPS)
AC_SUBST(DISABLE_NSE) AC_SUBST(DISABLE_NSE)
AC_SUBST(DISABLE_NAMED_SETUP) AC_SUBST(DISABLE_NAMED_SETUP)
...@@ -324,6 +325,7 @@ SELFLOADER_DATA="__DATA__" ...@@ -324,6 +325,7 @@ SELFLOADER_DATA="__DATA__"
NEEDMROUTED=0 NEEDMROUTED=0
OPSVM_ENABLE=0 OPSVM_ENABLE=0
OPSVM_MOUNTPOINT="/ops" OPSVM_MOUNTPOINT="/ops"
OURTIMEZONE="America/Denver"
# #
# XXX You really don't want to change these! # XXX You really don't want to change these!
...@@ -664,9 +666,17 @@ AC_ARG_WITH(apache-config-dir, ...@@ -664,9 +666,17 @@ AC_ARG_WITH(apache-config-dir,
[ [
INSTALL_APACHE_CONFIG="$withval" INSTALL_APACHE_CONFIG="$withval"
],[ ],[
INSTALL_APACHE_CONFIG="/usr/local/etc/apache" foo=`httpd -V | grep SERVER_CONFIG_FILE | grep 'apache2'`
if test "$foo" = ""; then
INSTALL_APACHE_CONFIG="/usr/local/etc/apache"
APACHE_VERSION="1.3"
else
INSTALL_APACHE_CONFIG="/usr/local/etc/apache22"
APACHE_VERSION="22"
fi
]) ])
AC_SUBST(INSTALL_APACHE_CONFIG) AC_SUBST(INSTALL_APACHE_CONFIG)
AC_SUBST(APACHE_VERSION)
# #
# Path to garcia installation # Path to garcia installation
...@@ -870,6 +880,21 @@ if test "$PROTOGENI_SUPPORT" = "1"; then ...@@ -870,6 +880,21 @@ if test "$PROTOGENI_SUPPORT" = "1"; then
fi fi
fi fi
#
# Determine the timezone (stupidity in PHP5, see apache/php.ini)
#
if test -e "$srcdir/utils/gettimezone.pl"; then
echo -n "Checking to see what timezone we are ... ";
ZONE=`$srcdir/utils/gettimezone.pl`
if test $? -ne 0; then
AC_MSG_WARN([Cannot find gettimezone script; defaulting to $OURTIMEZONE]);
fi
OURTIMEZONE=$ZONE
echo "$OURTIMEZONE"
else
AC_MSG_WARN([Cannot find gettimezone script; defaulting to $OURTIMEZONE]);
fi
# #
# Merge build # Merge build
# #
...@@ -1032,7 +1057,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -1032,7 +1057,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
$eventfiles \ $eventfiles \
$winfiles \ $winfiles \
$pelabfiles \ $pelabfiles \
apache/GNUmakefile apache/httpd.conf \ apache/GNUmakefile apache/httpd.conf-v1 apache/httpd.conf-v2 apache/php.ini \
xmlrpc/GNUmakefile xmlrpc/emulabclient.py xmlrpc/emulabserver.py \ xmlrpc/GNUmakefile xmlrpc/emulabclient.py xmlrpc/emulabserver.py \
xmlrpc/sshxmlrpc_client.py xmlrpc/sshxmlrpc_server.py \ xmlrpc/sshxmlrpc_client.py xmlrpc/sshxmlrpc_server.py \
xmlrpc/sslxmlrpc_client.py xmlrpc/sslxmlrpc_server.py \ xmlrpc/sslxmlrpc_client.py xmlrpc/sslxmlrpc_server.py \
......
...@@ -823,6 +823,12 @@ Phase "apache", "Installing apache config file", sub { ...@@ -823,6 +823,12 @@ Phase "apache", "Installing apache config file", sub {
ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache install"); ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache install");
}; };
Phase "php.ini", "Installing php.ini file", sub {
DoneIfEdited($PHP_INI);
ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache install-php-ini");
AppendToFileFatal($PHP_INI, "# This file created by Emulab installaton");
};
Phase "rc.d", "Setting up rc.d scripts", sub { Phase "rc.d", "Setting up rc.d scripts", sub {
Phase "my-client", "Moving $RCDIR/mysql-client.sh", sub { Phase "my-client", "Moving $RCDIR/mysql-client.sh", sub {
DoneIfDoesntExist("$RCDIR/mysql-client.sh"); DoneIfDoesntExist("$RCDIR/mysql-client.sh");
...@@ -1394,20 +1400,6 @@ Phase "sudoers", "Editing $SUDOERS", sub { ...@@ -1394,20 +1400,6 @@ Phase "sudoers", "Editing $SUDOERS", sub {
"Defaults logfile=/var/log/sudo.log"); "Defaults logfile=/var/log/sudo.log");
}; };
Phase "php.ini", "Creating php.ini file", sub {
DoneIfExists($PHP_INI);
CreateFileFatal($PHP_INI,
"[PHP]","",
";",
"; So that quotes are not escaped. Needed for netbuild application.",
";",
"magic_quotes_gpc = Off","",
";",
"; Our scripts depend on this!",
";",
"register_globals = On");
};
Phase "ssh", "Setting up root ssh from boss to ops", sub { Phase "ssh", "Setting up root ssh from boss to ops", sub {
Phase "keygen", "Creating root private key", sub { Phase "keygen", "Creating root private key", sub {
DoneIfExists($ROOT_PRIVKEY); DoneIfExists($ROOT_PRIVKEY);
......
...@@ -241,6 +241,7 @@ my $SMBCONF_FILE = "/usr/local/etc/smb.conf"; ...@@ -241,6 +241,7 @@ my $SMBCONF_FILE = "/usr/local/etc/smb.conf";
my $SMBCONF_HEAD = "$SMBCONF_FILE.head"; my $SMBCONF_HEAD = "$SMBCONF_FILE.head";
my $APACHE_ETCDIR = "/usr/local/etc/apache"; my $APACHE_ETCDIR = "/usr/local/etc/apache";
my $HTTPD_CONF = "$APACHE_ETCDIR/httpd.conf"; my $HTTPD_CONF = "$APACHE_ETCDIR/httpd.conf";
my $PHP_INI = "/usr/local/etc/php.ini";
my $WWWDIR = "/usr/local/www/data"; my $WWWDIR = "/usr/local/www/data";
# For installing mysqld # For installing mysqld
...@@ -1160,6 +1161,11 @@ Phase "apache", "Installing apache config file", sub { ...@@ -1160,6 +1161,11 @@ Phase "apache", "Installing apache config file", sub {
DoneIfEdited("$HTTPD_CONF"); DoneIfEdited("$HTTPD_CONF");
ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache control-install"); ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache control-install");
}; };
Phase "php.ini", "Installing php.ini file", sub {
DoneIfEdited($PHP_INI);
ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache install-php-ini");
AppendToFileFatal($PHP_INI, "# This file created by Emulab installaton");
};
Phase "wikidocs", "Installing wikidocs redirect", sub { Phase "wikidocs", "Installing wikidocs redirect", sub {
PhaseSkip("wikidocs not supported on ops") PhaseSkip("wikidocs not supported on ops")
if ($FBSD_MAJOR == 4); if ($FBSD_MAJOR == 4);
...@@ -1392,7 +1398,7 @@ if ($BUGDBSUPPORT) { ...@@ -1392,7 +1398,7 @@ if ($BUGDBSUPPORT) {
my $FLYSPRAYDIR = "/usr/local/www/data/flyspray"; my $FLYSPRAYDIR = "/usr/local/www/data/flyspray";
my $FLYSPRAYURL = "http://$OUTER_BOSS/downloads/flyspray-0.9.9.tgz"; my $FLYSPRAYURL = "http://$OUTER_BOSS/downloads/flyspray-0.9.9.tgz";
my $FLYSPRAYCONF = "$ETCDIR/flyspray.conf.php"; my $FLYSPRAYCONF = "$ETCDIR/flyspray.conf.php";
my $PHPCONFIG = "/usr/local/etc/php.ini"; my $PHPCONFIG = $PHP_INI;
my $localtarfile = "/tmp/flyspray.tgz"; my $localtarfile = "/tmp/flyspray.tgz";
my $ADODBPATH = "/usr/local/share/adodb/adodb.inc.php"; my $ADODBPATH = "/usr/local/share/adodb/adodb.inc.php";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment