Browse code

Fixes running horizon on fedora 18 and above

Fixes bug: 1167066
Summary:

1. Starting with fedora 18 the httpd.conf has
<Directory />
AllowOverride none
Require all denied
</Directory>
which requires you to explicitly permit access to web content
directories in other <Directory> blocks

2. Install nodejs on fedora 18 and above

Change-Id: I487a7a74bad6627d32c1081dcbe48630a704a106

Sunil Thaha authored on 2013/04/10 13:11:44
Showing 2 changed files
... ...
@@ -17,6 +17,7 @@
17 17
 
18 18
     <Directory %HORIZON_DIR%/>
19 19
         Options Indexes FollowSymLinks MultiViews
20
+        %HORIZON_REQUIRE%
20 21
         AllowOverride None
21 22
         Order allow,deny
22 23
         allow from all
... ...
@@ -102,6 +102,7 @@ function init_horizon() {
102 102
     sudo mkdir -p $HORIZON_DIR/.blackhole
103 103
 
104 104
 
105
+    HORIZON_REQUIRE=''
105 106
     if is_ubuntu; then
106 107
         APACHE_NAME=apache2
107 108
         APACHE_CONF=sites-available/horizon
... ...
@@ -115,6 +116,12 @@ function init_horizon() {
115 115
     elif is_fedora; then
116 116
         APACHE_NAME=httpd
117 117
         APACHE_CONF=conf.d/horizon.conf
118
+
119
+        if [[ "$os_RELEASE" -ge "18" ]]; then
120
+            # fedora 18 has Require all denied  in its httpd.conf
121
+            # and requires explicit Require all granted
122
+            HORIZON_REQUIRE='Require all granted'
123
+        fi
118 124
         sudo sed '/^Listen/s/^.*$/Listen 0.0.0.0:80/' -i /etc/httpd/conf/httpd.conf
119 125
     elif is_suse; then
120 126
         APACHE_NAME=apache2
... ...
@@ -132,6 +139,7 @@ function init_horizon() {
132 132
         s,%HORIZON_DIR%,$HORIZON_DIR,g;
133 133
         s,%APACHE_NAME%,$APACHE_NAME,g;
134 134
         s,%DEST%,$DEST,g;
135
+        s,%HORIZON_REQUIRE%,$HORIZON_REQUIRE,g;
135 136
     \" $FILES/apache-horizon.template >/etc/$APACHE_NAME/$APACHE_CONF"
136 137
 
137 138
 }
... ...
@@ -156,6 +164,9 @@ function install_horizon() {
156 156
         if [[ ! -e "/usr/bin/node" ]]; then
157 157
             install_package nodejs-legacy
158 158
         fi
159
+    elif is_fedora && [[ "$os_RELEASE" -ge "18" ]]; then
160
+        # fedora 18 and higher gets nodejs
161
+        install_package nodejs
159 162
     fi
160 163
 
161 164
     git_clone $HORIZON_REPO $HORIZON_DIR $HORIZON_BRANCH $HORIZON_TAG