forked from credativ/omdb-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathenableCGI.sh
More file actions
executable file
·38 lines (29 loc) · 819 Bytes
/
enableCGI.sh
File metadata and controls
executable file
·38 lines (29 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Enable OMDB CGI on Debian via Apache
set -e
if ! test -f omdb.cgi; then
echo "Could not find omdb.cgi!"
echo "Make sure it's within PWD"
exit 1
fi
# install and configure apache2
apt-get install apache2 \
libcgi-pm-perl \
libdbd-pg-perl \
libtemplate-perl
a2enmod cgi
sed -i -e 's/SymLinksIfOwnerMatch/FollowSymLinks/g' /etc/apache2/conf-available/serve-cgi-bin.conf
# restart apache (reloading is not enough on stretch)
service apache2 restart
# install CGI script
rm -f /usr/lib/cgi-bin/omdb
ln -s $PWD/omdb.cgi /usr/lib/cgi-bin/omdb
chmod +x omdb.cgi
# create PostgreSQL user
su -c 'createuser www-data' postgres || :
cat <<EOF
#######################################
The OMDB CGI script has been installed:
http://localhost/cgi-bin/omdb
#######################################
EOF