Base OS
- Install Wheezy
- apt-get install php5 mysql-server apache2 emacs23-nox php-pear php5-curl php5-geoip php5-dev
- apt-get install openssh-server phpmyadmin fail2ban less libapache2-modsecurity
- dpkg-reconfigure locales (and choose en_GB UTF-8)
- Install csf/lfd and copy config
- echo bittylicious.com > /etc/hostname
- Change /etc/hosts to have bittylicious.com as the main hostname
- Change /root/.bashrc to have the line export PS1=${RED}'\u'${LGRAY}@${LBLUE}'bittylicious.com'${LGRAY}'>_'${NO_COL}' \w\$ '
MySQL
- Configure MySQL bittylicious and bittyuser users
- Copy across privilege tables - they're quite complicated
- Copy MySQL data
- Change phpmyadmin path by changing /etc/apache/conf.d/phpmyadmin.conf and editing the line to read Alias /803693 /usr/share/phpmyadmin
- Also add the following just underneath the first <Directory directive: AllowOverride AuthConfig
- Add the following to .htaccess in /usr/share/phpmyadmin
AuthUserFile /usr/share/phpmyadmin/.htpasswd
AuthName "Restricted"
AuthType Basic
require valid-user
- Generate a suitable .htpasswd as well
- In my.cnf, change the following:
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes
log_bin = /var/log/mysql/mysql-bin.log
general_log_file = /var/log/mysql/mysql.log
general_log = 1
Apache
- Copy /etc/apache/sites-available/default, default-ssl and dev
- Copy SSL certificates: cp -rav /oldroot/etc/ssl/startssl private /etc/ssl/
- In /etc/apache2/mods-enabled run ln -s ../mods-available/ssl.* . and ln -s ../mods-available/rewrite.load .
- pear channel-discover pear.apache.org/log4php
- pear install log4php/Apache_log4php
- Add NameVirtualHost *:443 to /etc/apache2/ports.conf
- pear install Mail
- pear install Net_SMTP
Bittylicious programs
- touch /var/log/bittylicious-web.log
- chown www-data /var/log/bittylicious-web.log
Wiki
- apt-get install mediawiki libicu-dev
- pecl install intl
- Alias /help /var/lib/mediawiki to Apache config
If you have been compromised
- Change all API keys