summaryrefslogtreecommitdiffstats
path: root/.github/prepare_debian.sh
diff options
context:
space:
mode:
Diffstat (limited to '.github/prepare_debian.sh')
-rwxr-xr-x.github/prepare_debian.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh
index f7b6cf9f..15c2286c 100755
--- a/.github/prepare_debian.sh
+++ b/.github/prepare_debian.sh
@@ -24,6 +24,7 @@ apt-get -y install perl \
24 libpq-dev \ 24 libpq-dev \
25 libradcli-dev \ 25 libradcli-dev \
26 libnet-snmp-perl \ 26 libnet-snmp-perl \
27 libsnmp-dev \
27 procps \ 28 procps \
28 libdbi0-dev \ 29 libdbi0-dev \
29 libdbd-sqlite3 \ 30 libdbd-sqlite3 \
@@ -66,10 +67,10 @@ apt-get -y install perl \
66 libjson-perl 67 libjson-perl
67 68
68# remove ipv6 interface from hosts 69# remove ipv6 interface from hosts
69sed '/^::1/d' /etc/hosts > /tmp/hosts 70# sed '/^::1/d' /etc/hosts > /tmp/hosts
70cp -f /tmp/hosts /etc/hosts 71# cp -f /tmp/hosts /etc/hosts
71ip addr show 72# ip addr show
72cat /etc/hosts 73# cat /etc/hosts
73 74
74# apache 75# apache
75a2enmod ssl 76a2enmod ssl
@@ -79,6 +80,19 @@ a2ensite default-ssl
79rm /etc/ssl/certs/ssl-cert-snakeoil.pem 80rm /etc/ssl/certs/ssl-cert-snakeoil.pem
80rm /etc/ssl/private/ssl-cert-snakeoil.key 81rm /etc/ssl/private/ssl-cert-snakeoil.key
81openssl req -nodes -newkey rsa:2048 -x509 -sha256 -days 365 -nodes -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem -subj "/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=$(hostname)" 82openssl req -nodes -newkey rsa:2048 -x509 -sha256 -days 365 -nodes -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem -subj "/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=$(hostname)"
83# add a subdomain for testing
84cp tools/subdomain1/subdomain1.conf /etc/apache2/sites-available/
85mkdir -p /var/www/subdomain1
86cp tools/subdomain1/index.php /var/www/subdomain1/
87echo '127.0.0.1 subdomain1.localhost' >> /etc/hosts
88echo '127.0.0.1 subdomain1.localhost.com' >> /etc/hosts
89apache2ctl configtest
90a2ensite subdomain1.conf
91
92# Make it listen to both IPv4 on IPv6 on localhost
93sed -i 's/^Listen 80/Listen 0.0.0.0:80\nListen [::1]:80/' /etc/apache2/ports.conf
94sed -i 's/^[[:space:]]*Listen 443/Listen 0.0.0.0:443\nListen [::1]:443/' /etc/apache2/ports.conf
95
82service apache2 restart 96service apache2 restart
83 97
84# squid 98# squid
@@ -111,6 +125,8 @@ mkdir -p /var/lib/snmp/mib_indexes
111sed -e 's/^agentaddress.*/agentaddress 127.0.0.1/' -i /etc/snmp/snmpd.conf 125sed -e 's/^agentaddress.*/agentaddress 127.0.0.1/' -i /etc/snmp/snmpd.conf
112service snmpd start 126service snmpd start
113 127
128sed 's/^mibs ://' -i /etc/snmp/snmp.conf
129
114# start cron, will be used by check_nagios 130# start cron, will be used by check_nagios
115cron 131cron
116 132