Commit 4d7e527f authored by Patrick J Cherry's avatar Patrick J Cherry
Browse files

ServerAliases and symlinks are now handled sanely.

parent c77ca96f
......@@ -21,10 +21,12 @@ NameVirtualHost <%= ip %>:80
#
ServerName <%= domain %>
#
# And server alias in place
#
ServerAlias www.<%= domain %>
<%= server_aliases %>
#
# Allow users to override settings via .htaccess
......
......@@ -26,10 +26,11 @@ NameVirtualHost <%= ip %>:80
#
ServerName <%= domain %>
#
# And server alias in place
#
ServerAlias www.<%= domain %>
<%= server_aliases %>
SSLEngine On
......@@ -87,10 +88,12 @@ NameVirtualHost <%= ip %>:80
#
ServerName <%= domain %>
#
# And server alias in place
#
ServerAlias www.<%= domain %>
<%= server_aliases %>
% if mandatory_ssl?
#
......
......@@ -192,7 +192,7 @@ PageType php
# "yes" or "no". Default is "no". Note: this does not suppress
# warnings and errors (which are printed to stderr).
#Quiet no
Quiet yes
# ReallyQuiet will supress all messages including errors and
# warnings. Values can be 'yes' or 'no' with 'no' being the
......@@ -377,13 +377,16 @@ PageType php
# "*mama.com" and "www.your*" will all match.
# Your own site should be hidden
HideSite <%= domain %>
HideSite www.<%= domain %>
HideSite localhost
% domain.aliases.each do |domain_alias|
HideSite <%= domain_alias %>
HideReferrer <%= domain_alias %>/
% end
# Your own site gives most referrals
HideReferrer <%= domain %>/
HideReferrer www.<%= domain %>/
#
# Also hide localhost.
HideSite localhost
# This one hides non-referrers ("-" Direct requests)
HideReferrer Direct Request
......
......@@ -10,8 +10,11 @@ symbiosis-httpd (2012:0208) stable; urgency=low
* Fixed verbose logging in symbiosis-create-mass-hosting-sites
* Fixed force recreate in symbiosis-make-logs
* Postinst now removes old SSL configuration test if present.
* ServerAliases are now added when they actually exist as symlinks.
* Symlinks are handled better by logging -- extra filehandles are not
opened.
-- Patrick J Cherry <patrick@bytemark.co.uk> Tue, 07 Feb 2012 17:10:47 +0000
-- Patrick J Cherry <patrick@bytemark.co.uk> Wed, 08 Feb 2012 15:23:32 +0000
symbiosis-httpd (2012:0202) stable; urgency=low
......
......@@ -194,6 +194,14 @@ module Symbiosis
end
end
#
#
# Return a ServerAlias snippet for all server aliases for a domain.
#
def server_aliases
domain.aliases.collect{|a| "ServerAlias #{a}"}.join("\n ")
end
#
# Returns the certificate, key, and bundle configuration lines.
#
......
......@@ -278,11 +278,6 @@ processing_thread = Thread.new do
# unless the domain is sane. We can only do this if we're root.
#
if 0 == Process.uid and (domain = Symbiosis::Domains.find(domain_name))
#
# Change the domain name to the correct one.
#
domain_name = domain.name
#
# Fetch the log filename
#
......
......@@ -171,6 +171,11 @@ Symbiosis::Domains.each do |domain|
next unless domains_to_configure.empty? or domains_to_configure.include?(domain.name)
if domain.is_alias?
verbose "\tSkipping as #{domain.symlink} is a link to #{domain.directory}."
next
end
begin
sites_available_file = File.join(apache2_dir, "sites-available","#{domain.name}.conf")
sites_enabled_file = File.join(apache2_dir, "sites-enabled","#{domain.name}.conf")
......
......@@ -139,8 +139,8 @@ Symbiosis::Domains.each do |domain|
#
# Skip symlinks
#
if ( File.symlink?(domain.directory) )
verbose "\tSkipping as it is a symlink elsewhere."
if ( domain.is_alias? )
verbose "\tSkipping as it is an symlink to #{domain.directory}."
next
end
......
Supports Markdown
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