Bittylicious Setup: Difference between revisions

From GigaTux Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:


#Install Wheezy
#Install Wheezy
#apt-get install php5 mysql-server apache2 emacs23-nox php-pear php5-curl php5-geoip php5-dev
#apt-get install php5 mysql-server apache2 emacs23-nox php-pear php5-curl php5-geoip php5-dev php-apc
#apt-get install openssh-server phpmyadmin fail2ban less libapache2-modsecurity
#apt-get install openssh-server phpmyadmin fail2ban less libapache2-modsecurity
#dpkg-reconfigure locales (and choose en_GB UTF-8)
#dpkg-reconfigure locales (and choose en_GB UTF-8)
Line 9: Line 9:
#Change /etc/hosts to have bittylicious.com as the main 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\$ '''
#Change /root/.bashrc to have the line ''export PS1=${RED}'\u'${LGRAY}@${LBLUE}'bittylicious.com'${LGRAY}'>_'${NO_COL}' \w\$ '''
#Change UMASK in /etc/login.defs to read 077


==MySQL==
==MySQL==
Line 41: Line 42:
#pear install Mail
#pear install Mail
#pear install Net_SMTP
#pear install Net_SMTP
#Change the ''session.gc_maxlifetime'' variable in ''/etc/php5/apache2/php.ini'' to ''259200'' (72 hours).
#a2enmod headers


==Bittylicious programs==
==Bittylicious programs==
Line 52: Line 55:
#pecl install intl
#pecl install intl
#Alias /help /var/lib/mediawiki to Apache config
#Alias /help /var/lib/mediawiki to Apache config
#Add ''extension=intl.so'' to php.ini


==If you have been compromised==
==If you have been compromised==


#Change all API keys
#Change all API keys

Latest revision as of 09:22, 10 October 2013

Base OS

  1. Install Wheezy
  2. apt-get install php5 mysql-server apache2 emacs23-nox php-pear php5-curl php5-geoip php5-dev php-apc
  3. apt-get install openssh-server phpmyadmin fail2ban less libapache2-modsecurity
  4. dpkg-reconfigure locales (and choose en_GB UTF-8)
  5. Install csf/lfd and copy config
  6. echo bittylicious.com > /etc/hostname
  7. Change /etc/hosts to have bittylicious.com as the main hostname
  8. Change /root/.bashrc to have the line export PS1=${RED}'\u'${LGRAY}@${LBLUE}'bittylicious.com'${LGRAY}'>_'${NO_COL}' \w\$ '
  9. Change UMASK in /etc/login.defs to read 077

MySQL

  1. Configure MySQL bittylicious and bittyuser users
  2. Copy across privilege tables - they're quite complicated
  3. Copy MySQL data
  4. Change phpmyadmin path by changing /etc/apache/conf.d/phpmyadmin.conf and editing the line to read Alias /803693 /usr/share/phpmyadmin
  5. Also add the following just underneath the first <Directory directive: AllowOverride AuthConfig
  6. Add the following to .htaccess in /usr/share/phpmyadmin
AuthUserFile /usr/share/phpmyadmin/.htpasswd
AuthName "Restricted"
AuthType Basic
require valid-user
  1. Generate a suitable .htpasswd as well
  2. 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

  1. Copy /etc/apache/sites-available/default, default-ssl and dev
  2. Copy SSL certificates: cp -rav /oldroot/etc/ssl/startssl private /etc/ssl/
  3. In /etc/apache2/mods-enabled run ln -s ../mods-available/ssl.* . and ln -s ../mods-available/rewrite.load .
  4. pear channel-discover pear.apache.org/log4php
  5. pear install log4php/Apache_log4php
  6. Add NameVirtualHost *:443 to /etc/apache2/ports.conf
  7. pear install Mail
  8. pear install Net_SMTP
  9. Change the session.gc_maxlifetime variable in /etc/php5/apache2/php.ini to 259200 (72 hours).
  10. a2enmod headers

Bittylicious programs

  1. touch /var/log/bittylicious-web.log
  2. chown www-data /var/log/bittylicious-web.log

Wiki

  1. apt-get install mediawiki libicu-dev g++ make
  2. pecl install intl
  3. Alias /help /var/lib/mediawiki to Apache config
  4. Add extension=intl.so to php.ini

If you have been compromised

  1. Change all API keys