waja

waja / gist:9e8d82d3639b4d1b942593b70b37b328

Last active 3 months ago

Like 0

Jan Wagner revised this gist 4 years ago · 5661570

4 files changed, 3 insertions, 240 deletions

README.md (file created)
@@ -0,0 +1,3 @@
1 + # New location
2 +
3 + Head over to https://github.com/waja/debian-update-cheatsheets/blob/wheezy2jessie/wheezy2jessie.sh
wheezy2jessie.sh (file deleted)

Diff is too large to be shown

x_fix_apache2.4_slash_docroot.sh (file deleted)
@@ -1,11 +0,0 @@
1 - # when <Directory > config is applied on / instead of DocumentRoot, we need to fix that
2 - cat > /tmp/a2conf_dir_migrate << EOF
3 - grep -i "<directory />" /etc/apache2/sites-enabled/*
4 - for HOST in \$(grep -i "<directory />" /etc/apache2/sites-enabled/* | grep -v 000-default | awk -F':' '{print \$1}' | sed "s/.conf//" | sed "s#^/etc/apache2/sites-enabled/##"); do
5 - DOCROOT=\$(grep DocumentRoot /etc/apache2/sites-enabled/\${HOST} | awk '{print \$2}');
6 - sed -i "s#<Directory />#<Directory \${DOCROOT}>#" /etc/apache2/sites-available/\${HOST};
7 - done
8 - echo -e "Migration done.\nRemaining problematic configurations, please investigate:"
9 - grep -i "<directory />" /etc/apache2/sites-enabled/*
10 - EOF
11 - sh /tmp/a2conf_dir_migrate
z_apache2.0to2.4.md (file deleted)
@@ -1,17 +0,0 @@
1 - # Migrating the Apache config files into new places and naming scheme
2 -
3 - see https://gist.github.com/waja/86a3a055c1fedfba3c58#file-wheezy2jessie-sh
4 -
5 - # Upstream changes
6 -
7 - * [Order](http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#order), [Allow](http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#allow), [Deny](http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#deny) and [Satisfy](http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#satisfy) are obsolete, you should read [Run-Time Configuration Changes](http://httpd.apache.org/docs/2.4/upgrading.html#run-time) or [Beyond just authorization](http://httpd.apache.org/docs/2.4/howto/auth.html#beyond)
8 - * Mixing [Options](http://httpd.apache.org/docs/current/mod/core.html#options) with a + or - with those without is not valid syntax, and will be rejected during server startup by the syntax check with an abort.
9 - * Certificate handleing has changed, obsoletes [SSLCertificateChainFile](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcertificatechainfile), please use [SSLCertificateFile](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcertificatefile), it may also include intermediate CA certificates, sorted from leaf to root now
10 - * Several other changes can be found in the [Upgrading to 2.4 from 2.2](http://httpd.apache.org/docs/2.4/upgrading.html) documentation
11 -
12 -
13 - # Some more other handy resources
14 -
15 - https://www.digitalocean.com/community/tutorials/migrating-your-apache-configuration-from-2-2-to-2-4-syntax
16 - https://www.linode.com/docs/security/upgrading/updating-virtual-host-settings-from-apache-2-2-to-apache-2-4
17 - http://linoxide.com/linux-how-to/apache-migration-2-2-to-2-4-ubuntu-14-04/

Jan Wagner revised this gist 7 years ago · 8671813

1 file changed, 1 insertion, 1 deletion

wheezy2jessie.sh
@@ -1,4 +1,4 @@
1 - Please also refer to http://www.debian.org/releases/jessie/releasenotes and use your brain!
1 + Please also refer to http://www.debian.org/releases/jessie/releasenotes and use your brain! If you can’t figure out what one of the commands below does, this is not for you. Expert mode only :)
2 2
3 3
4 4 # upgrade to UTF-8 locales (http://www.debian.org/releases/jessie/amd64/release-notes/ap-old-stuff.en.html#switch-utf8)

Jan Wagner revised this gist 7 years ago · e73e5d2

1 file changed, 2 insertions, 2 deletions

wheezy2jessie.sh
@@ -175,8 +175,8 @@ wget https://gist.githubusercontent.com/waja/d9e176f712ae6a6e4442486df80a13ba/ra
175 175
176 176 # remove old squeeze packages left around (keep eyes open!)
177 177 apt-get autoremove && \
178 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding|smarty' | awk '/^i *A/ { print $3 }') && \
179 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding|smarty' | awk '/^i/ { print $2 }') && \
178 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding|smarty|dehydrated' | awk '/^i *A/ { print $3 }') && \
179 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding|smarty|dehydrated' | awk '/^i/ { print $2 }') && \
180 180 apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \
181 181 apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \
182 182 apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \

Jan Wagner revised this gist 7 years ago · f0c1396

1 file changed, 3 insertions

wheezy2jessie.sh
@@ -170,6 +170,9 @@ pg_dropcluster 9.1 main
170 170 [ $(grep "^(vif-script vif-bridge-local" /etc/xen/xend-config.sxp | wc -l) -gt 0 ] && \
171 171 sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf
172 172
173 + # enable unattended upgrades
174 + wget https://gist.githubusercontent.com/waja/d9e176f712ae6a6e4442486df80a13ba/raw/deploy_unattended-upgrades.sh -O /tmp/a && sh /tmp/a
175 +
173 176 # remove old squeeze packages left around (keep eyes open!)
174 177 apt-get autoremove && \
175 178 apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding|smarty' | awk '/^i *A/ { print $3 }') && \

Jan Wagner revised this gist 7 years ago · be35641

1 file changed, 1 insertion

wheezy2jessie.sh
@@ -22,6 +22,7 @@ sed -i "s/ stable/ jessie/g" /etc/apt/sources.list*
22 22 sed -i s/wheezy/jessie/g /etc/apt/preferences*
23 23 sed -i s/wheezy/jessie/g /etc/apt/sources.list.d/*wheezy*
24 24 rename s/wheezy/jessie/g /etc/apt/sources.list.d/*wheezy*
25 + wget https://gist.githubusercontent.com/waja/d6f8715b0a187796212e012bf2289033/raw/jessie_fix_source_lists.sh -O /tmp/a && sh /tmp/a
25 26 aptitude update
26 27
27 28 # Set for example a package on hold

Jan Wagner revised this gist 8 years ago · 88761d9

1 file changed, 2 insertions, 2 deletions

wheezy2jessie.sh
@@ -171,8 +171,8 @@ pg_dropcluster 9.1 main
171 171
172 172 # remove old squeeze packages left around (keep eyes open!)
173 173 apt-get autoremove && \
174 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding' | awk '/^i *A/ { print $3 }') && \
175 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding' | awk '/^i/ { print $2 }') && \
174 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding|smarty' | awk '/^i *A/ { print $3 }') && \
175 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding|smarty' | awk '/^i/ { print $2 }') && \
176 176 apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \
177 177 apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \
178 178 apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \

Jan Wagner revised this gist 8 years ago · abaedd3

1 file changed, 2 insertions, 2 deletions

wheezy2jessie.sh
@@ -171,8 +171,8 @@ pg_dropcluster 9.1 main
171 171
172 172 # remove old squeeze packages left around (keep eyes open!)
173 173 apt-get autoremove && \
174 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli' | awk '/^i *A/ { print $3 }') && \
175 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli' | awk '/^i/ { print $2 }') && \
174 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding' | awk '/^i *A/ { print $3 }') && \
175 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|xen-system|check-openmanage|mailscanner|hp-health|hpacucli|check-linux-bonding' | awk '/^i/ { print $2 }') && \
176 176 apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \
177 177 apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \
178 178 apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \

Jan Wagner revised this gist 8 years ago · 3a84215

1 file changed, 2 insertions, 1 deletion

wheezy2jessie.sh
@@ -101,7 +101,8 @@ sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" $CFG
101 101 sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" $CFG
102 102
103 103 # maybe we want to change some shorewall config stuff again
104 - sed -i s/^startup=0/startup=1/ /etc/default/shorewall
104 + if [ -f /etc/default/shorewall.dpkg-new ]; then CFG=/etc/default/shorewall.dpkg-new; else CFG=/etc/default/shorewall; fi
105 + sed -i 's/^startup=0/startup=1/' $CFG
105 106 # nat helper needs to be install (http://shorewall.net/Helpers.html#idp8854577312)
106 107 ucf /usr/share/shorewall/configfiles/conntrack /etc/shorewall/conntrack
107 108

Jan Wagner revised this gist 8 years ago · cff2c8f

1 file changed, 1 insertion

wheezy2jessie.sh
@@ -36,6 +36,7 @@ dpkg --get-selections | grep hold
36 36 aptitude unmarkauto vim && \
37 37 aptitude unmarkauto monitoring-plugins-standard monitoring-plugins-common monitoring-plugins-basic && \
38 38 aptitude unmarkauto open-vm-tools-dkms ifenslave && \
39 + aptitude unmarkauto xen-system-amd64 && aptitude unmarkauto $(dpkg-query -W 'xen-linux-system-*' | cut -f1) \
39 40 aptitude unmarkauto $(dpkg-query -W 'linux-image-3.2.*' | cut -f1)
40 41
41 42 # have a look into required and free disk space

Jan Wagner revised this gist 8 years ago · a635e87

1 file changed, 2 insertions, 2 deletions

wheezy2jessie.sh
@@ -81,8 +81,8 @@ sed -i "s/^ rocommunity6 public/# rocommunity6 public/" $CFG
81 81 sed -i "s/agentAddress udp:127/#agentAddress udp:127/" $CFG
82 82
83 83 # fix our xen modification
84 - rm -rf /etc/grub.d/09_linux_xen
85 - dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen
84 + [ -f /etc/grub.d/20_linux_xen ] && rm -rf /etc/grub.d/09_linux_xen && \
85 + dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen
86 86
87 87 # chrony update
88 88 if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; else CFG=/etc/chrony/chrony.conf; fi