← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/trusty-setup into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/trusty-setup into lp:launchpad.

Commit message:
Update development Apache configuration for Apache 2.4.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/trusty-setup/+merge/245448

Update development Apache configuration for Apache 2.4.  This is not a promise that Launchpad now works on trusty, but it at least makes it minimally possible to get started there.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/trusty-setup into lp:launchpad.
=== modified file 'Makefile'
--- Makefile	2014-01-15 10:38:08 +0000
+++ Makefile	2014-12-30 15:35:32 +0000
@@ -442,10 +442,17 @@
 copy-apache-config:
 	# We insert the absolute path to the branch-rewrite script
 	# into the Apache config as we copy the file into position.
+	set -e; \
+	apachever="$$(dpkg-query -W --showformat='$${Version}' apache2)"; \
+	if dpkg --compare-versions "$$apachever" ge 2.4.1-1~; then \
+		base=local-launchpad.conf; \
+	else \
+		base=local-launchpad; \
+	fi; \
 	sed -e 's,%BRANCH_REWRITE%,$(shell pwd)/scripts/branch-rewrite.py,' \
 		-e 's,%LISTEN_ADDRESS%,$(LISTEN_ADDRESS),' \
 		configs/development/local-launchpad-apache > \
-		/etc/apache2/sites-available/local-launchpad
+		/etc/apache2/sites-available/$$base
 	touch $(CODEHOSTING_ROOT)/rewrite.log
 	chown -R $(SUDO_UID):$(SUDO_GID) $(CODEHOSTING_ROOT)
 	if [ ! -d /srv/launchpad.dev ]; then \
@@ -454,10 +461,11 @@
 	fi
 
 enable-apache-launchpad: copy-apache-config copy-certificates
+	[ ! -e /etc/apache2/mods-available/version.load ] || a2enmod version
 	a2ensite local-launchpad
 
 reload-apache: enable-apache-launchpad
-	/etc/init.d/apache2 restart
+	service apache2 restart
 
 TAGS: compile
 	# emacs tags

=== modified file 'configs/development/local-launchpad-apache'
--- configs/development/local-launchpad-apache	2012-05-04 07:14:15 +0000
+++ configs/development/local-launchpad-apache	2014-12-30 15:35:32 +0000
@@ -1,7 +1,14 @@
-NameVirtualHost %LISTEN_ADDRESS%:80
-NameVirtualHost %LISTEN_ADDRESS%:443
+<IfVersion < 2.3.11>
+  NameVirtualHost %LISTEN_ADDRESS%:80
+  NameVirtualHost %LISTEN_ADDRESS%:443
+</IfVersion>
 
-RewriteLock /var/tmp/rewrite-lock
+<IfVersion >= 2.3.4>
+  Mutex file:/var/tmp rewrite-map
+</IfVersion>
+<IfVersion < 2.3.4>
+  RewriteLock /var/tmp/rewrite-lock
+</IfVersion>
 
 # These have to be first so non-Host/non-SNI requests don't hit bazaar etc.
 # But they can't have a ServerAlias wildcard or they'll shadow bazaar.
@@ -21,8 +28,13 @@
   ServerAlias bugs.launchpad.dev code.launchpad.dev feeds.launchpad.dev
   ServerAlias translations.launchpad.dev xmlrpc.launchpad.dev testopenid.dev
   <Proxy *>
-    Order deny,allow
-    Allow from 127.0.0.0/255.0.0.0
+    <IfVersion >= 2.4>
+      Require ip 127.0.0.0/255.0.0.0
+    </IfVersion>
+    <IfVersion < 2.4>
+      Order deny,allow
+      Allow from 127.0.0.0/255.0.0.0
+    </IfVersion>
   </Proxy>
   SSLEngine On
   SSLCertificateFile /etc/apache2/ssl/launchpad.crt
@@ -55,8 +67,14 @@
 
   ProxyRequests off
   <Proxy *>
-    Order deny,allow
-    Allow from localhost 127.0.0.0/255.0.0.0
+    <IfVersion >= 2.4>
+      Require host localhost
+      Require ip 127.0.0.0/255.0.0.0
+    </IfVersion>
+    <IfVersion < 2.4>
+      Order deny,allow
+      Allow from localhost 127.0.0.0/255.0.0.0
+    </IfVersion>
   </Proxy>
   ProxyTimeout 20
 
@@ -91,8 +109,14 @@
 
   ProxyRequests off
   <Proxy *>
-    Order deny,allow
-    Allow from localhost 127.0.0.0/255.0.0.0
+    <IfVersion >= 2.4>
+      Require host localhost
+      Require ip 127.0.0.0/255.0.0.0
+    </IfVersion>
+    <IfVersion < 2.4>
+      Order deny,allow
+      Allow from localhost 127.0.0.0/255.0.0.0
+    </IfVersion>
   </Proxy>
   ProxyTimeout 20
 
@@ -114,9 +138,14 @@
 
   DocumentRoot /var/tmp/bazaar.launchpad.dev/mirrors
   <Directory /var/tmp/bazaar.launchpad.dev/mirrors/>
-    Order Deny,Allow
-    Deny from all
-    Allow from 127.0.0.0/255.0.0.0
+    <IfVersion >= 2.4>
+      Require ip 127.0.0.0/255.0.0.0
+    </IfVersion>
+    <IfVersion < 2.4>
+      Order Deny,Allow
+      Deny from all
+      Allow from 127.0.0.0/255.0.0.0
+    </IfVersion>
     Options SymLinksIfOwnerMatch
     AllowOverride None
     Options Indexes
@@ -139,9 +168,14 @@
 
   DocumentRoot /var/tmp/ppa
   <Directory /var/tmp/ppa/>
-    Order Deny,Allow
-    Deny from all
-    Allow from 127.0.0.0/255.0.0.0
+    <IfVersion >= 2.4>
+      Require ip 127.0.0.0/255.0.0.0
+    </IfVersion>
+    <IfVersion < 2.4>
+      Order Deny,Allow
+      Deny from all
+      Allow from 127.0.0.0/255.0.0.0
+    </IfVersion>
     AllowOverride AuthConfig
     Options Indexes
   </Directory>
@@ -153,9 +187,14 @@
 
   DocumentRoot /var/tmp/archive
   <Directory /var/tmp/archive/>
-    Order Deny,Allow
-    Deny from all
-    Allow from 127.0.0.0/255.0.0.0
+    <IfVersion >= 2.4>
+      Require ip 127.0.0.0/255.0.0.0
+    </IfVersion>
+    <IfVersion < 2.4>
+      Order Deny,Allow
+      Deny from all
+      Allow from 127.0.0.0/255.0.0.0
+    </IfVersion>
     Options Indexes
   </Directory>
 </VirtualHost>

=== modified file 'utilities/launchpad-database-setup'
--- utilities/launchpad-database-setup	2014-01-15 10:38:46 +0000
+++ utilities/launchpad-database-setup	2014-12-30 15:35:32 +0000
@@ -20,7 +20,7 @@
 
 for pgversion in 9.1 9.3
 do
-  sudo grep -q "^auto" /etc/postgresql/$pgversion/main/start.conf
+  sudo grep -qs "^auto" /etc/postgresql/$pgversion/main/start.conf
   if [ $? -eq 0 ]; then
     break
   fi


Follow ups