Commit 523b40fcd1f462bd67fc2062661b5e605779e455

Authored by Rodrigo Souto
1 parent aaa0ee68

chat: move apache config to virtualhosts file

debian/apache2/virtualhost.conf
@@ -8,6 +8,14 @@ DocumentRoot "/usr/share/noosfero/public" @@ -8,6 +8,14 @@ DocumentRoot "/usr/share/noosfero/public"
8 8
9 RewriteEngine On 9 RewriteEngine On
10 10
  11 +# If your XMPP XMPP/BOSH isn't in localhost, change the config below to correct
  12 +# point to address
  13 +RewriteRule /http-bind http://localhost:5280/http-bind [P,QSA,L]
  14 +<Proxy http://localhost:5280/http-bind>
  15 + Order Allow,Deny
  16 + Allow from All
  17 +</Proxy>
  18 +
11 # Rewrite index to check for static index.html 19 # Rewrite index to check for static index.html
12 RewriteRule ^/$ /index.html [QSA] 20 RewriteRule ^/$ /index.html [QSA]
13 21
debian/update-noosfero-apache
@@ -17,13 +17,13 @@ if test -x /usr/share/noosfero/script/apacheconf; then @@ -17,13 +17,13 @@ if test -x /usr/share/noosfero/script/apacheconf; then
17 if ! test -e "$apache_site"; then 17 if ! test -e "$apache_site"; then
18 echo "Generating apache virtual host ..." 18 echo "Generating apache virtual host ..."
19 cd /usr/share/noosfero && su noosfero -c "RAILS_ENV=production ./script/apacheconf virtualhosts" > "$apache_site" 19 cd /usr/share/noosfero && su noosfero -c "RAILS_ENV=production ./script/apacheconf virtualhosts" > "$apache_site"
20 - else  
21 - pattern="Include \/etc\/noosfero\/apache\/virtualhost.conf"  
22 - include="Include \/usr\/share\/noosfero\/util\/chat\/apache\/xmpp.conf"  
23 - if ! cat $apache_site | grep "^ *$include" > /dev/null ; then  
24 - echo "Updating apache virtual host ..."  
25 - sed -i "s/.*$pattern.*/ $include\n&/" $apache_site  
26 - fi 20 + fi
  21 +
  22 + # remove old way to include chat config
  23 + pattern="Include \/usr\/share\/noosfero\/util\/chat\/apache\/xmpp.conf"
  24 + if cat $apache_site | grep "^ *$pattern" > /dev/null ; then
  25 + echo "Removing obsolete chat configuration ..."
  26 + sed -i "/.*$pattern.*/d" $apache_site
27 fi 27 fi
28 28
29 echo 'Noosfero Apache configuration updated.' 29 echo 'Noosfero Apache configuration updated.'
script/apacheconf
@@ -17,7 +17,6 @@ when &#39;virtualhosts&#39; @@ -17,7 +17,6 @@ when &#39;virtualhosts&#39;
17 puts " #{server_directive} #{domain.name}" 17 puts " #{server_directive} #{domain.name}"
18 server_directive = 'ServerAlias' 18 server_directive = 'ServerAlias'
19 end 19 end
20 - puts " Include /usr/share/noosfero/util/chat/apache/xmpp.conf"  
21 puts " Include /etc/noosfero/apache/virtualhost.conf" 20 puts " Include /etc/noosfero/apache/virtualhost.conf"
22 puts "</VirtualHost>" 21 puts "</VirtualHost>"
23 end 22 end
util/chat/apache/xmpp.conf
@@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
1 -# If your XMPP XMPP/BOSH isn't in localhost, change the config below to correct  
2 -# point to address  
3 -  
4 - RewriteEngine On  
5 - RewriteRule /http-bind http://localhost:5280/http-bind [P,QSA,L]  
6 - <Proxy http://localhost:5280/http-bind>  
7 - Order Allow,Deny  
8 - Allow from All  
9 - </Proxy>  
10 -  
11 -# vim: ft=apache