Subversion Repositories wimsdev

Rev

Rev 824 | Rev 8509 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 824 Rev 8375
Line 37... Line 37...
37
Please first install Apache (>=1.3).
37
Please first install Apache (>=1.3).
38
 
38
 
39
@
39
@
40
 exit
40
 exit
41
fi
41
fi
42
conffile=`$httpdname -V | grep SERVER_CONFIG_FILE | awk -F'=' '{print $2}' \
42
conffile=`$httpdname -V | grep SERVER_CONFIG_FILE | awk -F'=' '{print $2}'  | tr -d ' "'`
43
 | tr -d ' "'`
-
 
44
confdir=`dirname $conffile`
43
confdir=`dirname $conffile`
45
if [ -z "$confdir" ]; then
44
if [ -z "$confdir" ]; then
46
 cat <<@
45
 cat <<@
47
 
46
 
48
Unknown web server. Version too early?
47
Unknown web server. Version too early?
49
Please first update your web server to Apache >=1.3.
48
Please first update your web server to Apache >=1.3.
50
 
49
 
51
@
50
@
52
 exit
51
 exit
53
fi
52
fi
54
 
53
 
55
case $distro in
54
case $distro in
56
 debian) conffile=$confdir/conf.d/wims.conf
55
 debian) conffile=$confdir/conf.d/wims.conf
57
 
56
 
58
 ;;
57
 ;;
59
esac
58
esac
60
 
59
 
61
cd `dirname $0`/..
60
cd `dirname $0`/..
62
wimshome=`pwd`
61
wimshome=`pwd`
63
 
62
 
64
if [ ! -e public_html/wims.cgi ] || [ ! -e bin/apache-config ]; then
63
if [ ! -e public_html/wims.cgi ] || [ ! -e bin/apache-config ]; then
65
 echo Error: wrong directory. File wims.cgi not found.
64
 echo Error: wrong directory. File wims.cgi not found.
66
 echo
65
 echo
67
 exit
66
 exit
68
fi
67
fi
69
 
68
 
70
httpdroot=`$httpdname -V | grep HTTPD_ROOT | awk -F'=' '{print $2}' \
69
httpdroot=`$httpdname -V | grep HTTPD_ROOT | awk -F'=' '{print $2}' \
71
 | tr -d ' "'`
70
 | tr -d ' "'`
72
if [ ! -z "$httpdroot" ]; then cd $httpdroot; fi
71
if [ ! -z "$httpdroot" ]; then cd $httpdroot; fi
73
 
72
 
Line 121... Line 120...
121
# Otherwise the addition will be erased in next update.
120
# Otherwise the addition will be erased in next update.
122
#
121
#
123
  AddHandler cgi-script .cgi
122
  AddHandler cgi-script .cgi
124
@
123
@
125
 
124
 
-
 
125
# $vtest looks like "Server version: Apache/X.Y.Z (Unix)"
-
 
126
# $vmajor will be XY
-
 
127
 
126
vtest=`echo $vtest | grep 'pache/1\.2'`
128
vmajor=`echo $vtest | grep 'pache' | perl -pe 's/.*pache\/([\d]+).([\d]+).*/$1$2/'`
-
 
129
 
-
 
130
# Apache version == 1.2
127
if [ ! -z "$vtest" ]; then
131
if [ "$vmajor" = "12" ]; then
128
 cat >>$tmpfile <<@
132
  cat >>$tmpfile <<@
129
  ScriptAlias /wims/wims.cgi $wimshome/public_html/wims.cgi
133
  ScriptAlias /wims/wims.cgi $wimshome/public_html/wims.cgi
130
  ScriptAlias /wims/wims.html $wimshome/public_html/wims.cgi
134
  ScriptAlias /wims/wims.html $wimshome/public_html/wims.cgi
131
  ScriptAlias /wims/index.html $wimshome/public_html/wims.cgi
135
  ScriptAlias /wims/index.html $wimshome/public_html/wims.cgi
132
  ScriptAlias /wims/wims.gif $wimshome/public_html/wims.cgi
136
  ScriptAlias /wims/wims.gif $wimshome/public_html/wims.cgi
133
  ScriptAlias /wims/wims.png $wimshome/public_html/wims.cgi
137
  ScriptAlias /wims/wims.png $wimshome/public_html/wims.cgi
134
  ScriptAlias /wims/wims.jpeg $wimshome/public_html/wims.cgi
138
  ScriptAlias /wims/wims.jpeg $wimshome/public_html/wims.cgi
135
  ScriptAlias /wims/wims.jpg $wimshome/public_html/wims.cgi
139
  ScriptAlias /wims/wims.jpg $wimshome/public_html/wims.cgi
136
@
140
@
137
else	# newer versions of Apache
141
# newer versions of Apache
-
 
142
else
138
 cat >>$tmpfile <<@
143
  cat >>$tmpfile <<@
139
  ScriptAliasMatch ^/~wims/wims\.(.*) $wimshome/public_html/wims.cgi
144
  ScriptAliasMatch ^/~wims/wims\.(.*) $wimshome/public_html/wims.cgi
140
  ScriptAliasMatch ^/wims/wims\.(.*) $wimshome/public_html/wims.cgi
145
  ScriptAliasMatch ^/wims/wims\.(.*) $wimshome/public_html/wims.cgi
141
  ScriptAliasMatch ^/~wims/index\.(.*) $wimshome/public_html/wims.cgi
146
  ScriptAliasMatch ^/~wims/index\.(.*) $wimshome/public_html/wims.cgi
142
  ScriptAliasMatch ^/wims/index\.(.*) $wimshome/public_html/wims.cgi
147
  ScriptAliasMatch ^/wims/index\.(.*) $wimshome/public_html/wims.cgi
143
  ScriptAliasMatch ^/~wims/.._(.*).html $wimshome/public_html/wims.cgi
148
  ScriptAliasMatch ^/~wims/.._(.*).html $wimshome/public_html/wims.cgi
Line 145... Line 150...
145
  ScriptAliasMatch ^/~wims/getfile/(.*) $wimshome/public_html/wims.cgi
150
  ScriptAliasMatch ^/~wims/getfile/(.*) $wimshome/public_html/wims.cgi
146
  ScriptAliasMatch ^/wims/getfile/(.*) $wimshome/public_html/wims.cgi
151
  ScriptAliasMatch ^/wims/getfile/(.*) $wimshome/public_html/wims.cgi
147
  ScriptAlias /wims/....\.cgi $wimshome/public_html/wims.cgi
152
  ScriptAlias /wims/....\.cgi $wimshome/public_html/wims.cgi
148
@
153
@
149
fi
154
fi
-
 
155
 
-
 
156
# Apache version >= 2.4
-
 
157
if [ "$vmajor" -ge "24" ]; then
-
 
158
  require_line="Require all granted"
-
 
159
# Older Apache versions
-
 
160
else
-
 
161
  require_line="allow from all"
-
 
162
fi
-
 
163
 
150
cat >>$tmpfile <<@
164
cat >>$tmpfile <<@
151
  Alias /wims $wimshome/public_html
165
  Alias /wims $wimshome/public_html
152
  Alias /~wims $wimshome/public_html
166
  Alias /~wims $wimshome/public_html
153
 
167
 
154
  <Directory $wimshome/public_html>
168
  <Directory $wimshome/public_html>
155
  Options FollowSymLinks ExecCGI -Indexes
169
    Options +FollowSymLinks +ExecCGI -Indexes
156
  AllowOverride All
170
    AllowOverride All
157
  allow from all
171
    $require_line
158
  </Directory>
172
  </Directory>
159
  <Directory $wimshome/public_html/modules>
173
  <Directory $wimshome/public_html/modules>
160
  Options FollowSymLinks
174
    Options FollowSymLinks
161
  AllowOverride Limit
175
    AllowOverride Limit
162
  </Directory>
176
  </Directory>
163
 
177
 
164
###### $endl! ######
178
###### $endl! ######
165
@
179
@
166
 
180