Changes between Version 19 and Version 20 of configure_new_server


Ignore:
Timestamp:
Nov 29, 2007, 5:44:23 PM (16 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • configure_new_server

    v19 v20  
    22= Setup Debian Server for May First/People Link =
    33
    4 NOTE: This page is currently deprecated as I work on [ticket:241 writing a script to do these things]. I'm making small modifications to the script and not reflecting them on this page. Stay tuned for the updated (and much shorter) instructions.
    5 
    6 == Purchase an ssl certificate ==
    7 
    8  * Generate a private key and certificate signing request.
     4The process for setting up a new MFPL shared server is now automated via [source:trunk/pumpkin pumpkin]. To setup a new server, cd into the root directory and type:
    95
    106{{{
    11 openssl genrsa -out server.mayfirst.org.key 4096
    12 openssl req -new -key server.mayfirst.org.key -out server.mayfirst.org.csr
     7aptitude install svn
     8svn co https://svn.mayfirst.org/mfpl/trunk/pumpkin
     9cd pumpkin
     10./setup-new-server [server-name] /
    1311}}}
    14 
    15  * Change the domain@mayfirst.org email alias to point to your address.
    16 
    17  * Go to RapidSSL to purchase a certificate for server.mayfirst.org. This will take a day or so to be generated.
    18 
    19  * Concat the CRT and KEY file into a file called: server.mayfirst.org.pem (replace server with the name of the server being setup)
    20 
    21  * Then add dh paramaters with:
    22 
    23 {{{
    24 openssl gendh >> server.mayfirst.org.pem
    25 }}}
    26 
    27  * Copy into /etc/ssl/private/
    28 
    29  * Copy the .crt file to /etc/ssl/
    30 
    31 == Use volatile for SA and clamav ==
    32 
    33  * Edit /etc/apt/sources.list. Add the following:
    34 {{{
    35 # clamav (volatile) and spam assassin (volatile-sloppy)
    36 deb http://volatile.debian.org/debian-volatile etch/volatile main
    37 deb http://volatile.debian.org/debian-volatile etch/volatile-sloppy main
    38 }}}
    39 
    40 == Install debian packages ==
    41 
    42 {{{
    43 $ sudo apt-get install apache2 libapache2-mod-suphp cvs amavisd-new clamav clamav-daemon spamassassin maildrop courier-imap-ssl courier-pop-ssl scponly logcheck logcheck-database cron-apt awstats razor libnet-dns-perl dcc-client phpmyadmin php5-mysql php5-imap php5-gd mysql-server-5.0 mysql-client-5.0 squirrelmail php-mail php-db fail2ban aspell aspell-en aspell-es php5-mcrypt php-auth iproute  bzip2 imagemagick php-pear php-log imp4 turba2 ingol php-file
    44 }}}
    45 
    46 == Configure HE routes ==
    47 
    48 In order to route traffic directly from computer to computer (across different subnetworks) we need to add the different routes
    49 
    50  * Create a file called add-he-routes with the following contents. Replace CANONICAL-IP with the IP that you want the server to use as it's src ip. It should be the same as the IP you use when setting up the host DNS record.
    51 
    52 {{{
    53 #!/bin/bash
    54 # add routes for alternate blocks in rack src CANONICAL-IP
    55 #ip route add 209.51.172.0/28 dev eth0 src CANONICAL-IP
    56 ip route add 209.51.169.80/28 dev eth0 src CANONICAL-IP
    57 #ip route add 209.51.163.192/28 dev eth0 src CANONICAL-IP
    58 ip route add 209.51.180.16/28 dev eth0 src CANONICAL-IP
    59 ip route add 209.51.163.0/27 dev eth0 src CANONICAL-IP
    60 }}}
    61 
    62  * Comment out the line representing the network this server is on
    63 
    64  * Save the file in /etc/network/if-up.d and chmod it to 755
    65 
    66  * And add a corresponding file:
    67 
    68 {{{
    69 #!/bin/bash
    70 # remove routes for alternate blocks in rack
    71 ip route del 209.51.172.0/28
    72 ip route del 209.51.169.80/28
    73 ip route del 209.51.163.192/28
    74 #ip route del 209.51.180.16/28
    75 ip route del 209.51.163.0/27
    76 }}}
    77 
    78  * Save the file in /etc/network/if-down.d and chmod it to 755
    79 
    80 == Configure suPHP ==
    81 
    82 
    83  * Use dpkg-statoverride to change the ownership of our common php web programs (horde, phpmyadmin, and squirrelmail). This script will do it all for you:
    84 {{{
    85 #!/bin/bash -e
    86 
    87 #
    88 # phpmyadmin
    89 #
    90 # use /var/lib/phpmyadmin as home dir because it already exists
    91 
    92 if ! (getent passwd phpmyadmin) ; then
    93 adduser --system --disabled-login --quiet --home /var/lib/phpmyadmin --shell /bin/false -gid 65534 phpmyadmin
    94 fi
    95 #userdel phpmyadmin
    96 phpmyadmin_files =`dpkg -L phpmyadmin | grep '\.php'`
    97 
    98 for file in $phpmyadmin_files; do
    99 dpkg-statoverride --add --update --force --quiet phpmyadmin nogroup 444 $file
    100 # #dpkg-statoverride --remove $file
    101 done
    102 
    103 #
    104 # horde: share one user between horde and imp and any other horde apps
    105 #
    106 # use /var/log/horde as home directory because it already exists
    107 if ! (getent passwd horde) ; then
    108 adduser --system --disabled-login --quiet --home /var/log/horde --shell /bin/false -gid 65534 horde
    109 fi
    110 #userdel horde
    111 
    112 # chown the directory recursively to get existing logs
    113 # it is written to by the web process
    114 chown -R horde /var/log/horde
    115 chown horde /etc/horde/horde3/conf.php
    116 #chmod 600 /etc/horde/horde3/conf.php
    117 
    118 # add it to the mix
    119 dpkg-statoverride --add --update --force --quiet  horde nogroup 644 /var/log/horde
    120 #dpkg-statoverride --remove /var/log/horde
    121 
    122 # ack - this is not mainainable!
    123 perl -pi -e 's/www-data www-data/horde nogroup/g' /etc/logrotate.d/horde3
    124 
    125 horde_files =`dpkg -L horde3 | grep '\.php'`
    126 imp_files =`dpkg -L imp4 | grep '\.php'`
    127 turba_files =`dpkg -L turba2 | grep '\.php'`
    128 ingo_files =`dpkg -L ingo1 | grep '\.php'`
    129 all_horde_files ="$horde_files $imp_files $turba_files $ingo_files"
    130 
    131 for file in $all_horde_files; do
    132 dpkg-statoverride --add --update --force --quiet horde nogroup 444 $file
    133 #dpkg-statoverride --remove $file
    134 done
    135 
    136 if ! (getent passwd|grep squirrelmail) ; then
    137 adduser --system --disabled-login --quiet --home /var/lib/squirrelmail/data --shell /bin/false -gid 65534 squirrelmail
    138 fi
    139 #userdel squirrelmail
    140 sm_files =`dpkg -L squirrelmail | grep '\.php'`
    141 
    142 chown -R squirrelmail:nogroup /var/lib/squirrelmail/data
    143 dpkg-statoverride --add --update --force --quiet squirrelmail nogroup 700 /var/lib/squirrelmail/data
    144 
    145 #dpkg-statoverride --remove /var/lib/squirrelmail/data
    146 
    147 for file in $sm_files; do
    148 dpkg-statoverride --update --add --force squirrelmail nogroup 444 $file
    149 #dpkg-statoverride --remove $file
    150 done
    151 }}}
    152  * Edit /etc/suphp/suphp.conf
    153 {{{
    154 [global]
    155 ;Path to logfile
    156 logfile =/var/log/suphp/suphp.log
    157 
    158 ;Loglevel
    159 loglevel = info
    160 
    161 ;User Apache is running as
    162 webserver_user = www-data
    163 
    164 ;Path all scripts have to be in
    165 docroot =/
    166 
    167 ;Path to chroot() to before executing script
    168 ;chroot =/mychroot
    169 
    170 ; Security options
    171 ;allow_file_group_writeable = false
    172 allow_file_group_writeable = true
    173 ;allow_file_others_writeable = false
    174 allow_file_others_writeable = true
    175 ;allow_directory_group_writeable = false
    176 allow_directory_group_writeable = true
    177 ;allow_directory_others_writeable = false
    178 allow_directory_others_writeable = true
    179 
    180 ;Check wheter script is within DOCUMENT_ROOT
    181 ;check_vhost_docroot = true
    182 check_vhost_docroot = false
    183 
    184 ;Send minor error messages to browser
    185 errors_to_browser = false
    186 
    187 ;PATH environment variable
    188 env_path =/bin:/usr/bin
    189 
    190 ;Umask to set, specify in octal notation
    191 ;umask =0077
    192 umask =0022
    193 
    194 ; Minimum UID
    195 min_uid =100
    196 
    197 ; Minimum GID
    198 min_gid =100
    199 
    200 
    201 [handlers]
    202 ;Handler for php-scripts
    203 x-httpd-php = php:/usr/bin/php-cgi
    204 
    205 ;Handler for CGI-scripts
    206 x-suphp-cgi = execute:!self
    207 }}}
    208 
    209 
    210 == Configure fail2ban ==
    211 
    212 Create /etc/fail2ban/jail.local. Modify the following lines, by adding them to the jail.local file that you just created:
    213 {{{
    214 [DEFAULT]
    215 bantime  = 200
    216 
    217 action = iptables[name =%(__name__)s, port =%(port)s]
    218 mail-whois[name =%(__name__)s, dest =%(destemail)s]
    219 
    220 }}}
    221 
    222 == Install Red ==
    223 
    224  * Edit /etc/apt/sources.list - make sure non-free is there, e.g.: deb !http://http.us.debian.org/debian stable main contrib non-free. If you are adding anything to this line, run sudo apt-get update afterwards.
    225 {{{
    226 $ sudo apt-get install ucspi-tcp-src
    227 $ sudo build-ucspi-tcp
    228 }}}
    229 
    230  * Create a user in the red database with (change sylvia to name of server):
    231 
    232 {{{
    233 GRANT SELECT on seso.* to 'red-sylvia'@'sylvia.mayfirst.org' identified by 'secret';
    234 GRANT UPDATE on seso.red_item to 'red-sylvia'@'sylvia.mayfirst.org';
    235 GRANT INSERT on seso.red_error_log to 'red-sylvia'@'sylvia.mayfirst.org';
    236 }}}
    237 
    238  * Download the source from cvs
    239 
    240  * Copy and paste the following commands
    241 
    242 {{{
    243 $ cd /usr/local/share
    244 $ sudo cvs -d:ext:mayfirst@mayfirst.org:/srv/cvsroot co red
    245 $ sudo ln -s /usr/local/share/red/server/sbin/red_server_cli /usr/local/sbin/
    246 $ sudo ln -s /usr/local/share/red/server/sbin/pinky /usr/local/sbin/
    247 $ sudo chmod 755 /usr/local/share/red/server/sbin/red_server_cli
    248 $ sudo chmod 755 /usr/local/share/red/server/sbin/pinky
    249 $ sudo mkdir /usr/local/etc
    250 $ sudo mkdir /usr/local/etc/red
    251 $ cd /usr/local/share/red/server/etc/red
    252 $ sudo cp /usr/local/share/red/server/etc/red/* /usr/local/etc/red/
    253 $ cd /usr/local/etc/red
    254 $ for file in `ls *.sample`; do sudo cp $file /usr/local/etc/red/${file%.sample}; done;
    255 }}}
    256 
    257  * Edit the file called pinky. Change ip address to machine's real ip address. also edit red_server.conf, to add the database user and password.
    258 
    259  * Launch pinky with:
    260 {{{
    261 $ sudo /usr/local/sbin/pinky &
    262 }}}
    263 
    264 
    265 == Postfix setup ==
    266 
    267  * Create aliases in /etc/aliases
    268 
    269 {{{
    270 www: www-data
    271 www-data: apache@mayfirst.org
    272 root: root@mayfirst.org
    273 }}}
    274 
    275  * Don't forget to run newaliases!
    276 
    277  * Create empty access, virtual_alias_maps and virtual_alias_domains files in /etc/postfix
    278 
    279 {{{
    280 sudo touch virtual_alias_maps virtual_alias_domains access
    281 }}}
    282 
    283 Create an empty access database (later we can add entries in access to restrict or allow senders):
    284 
    285 {{{
    286 sudo postmap access
    287 }}}
    288 
    289  * Create /var/lib/postfix (used by tls), owned by root
    290 
    291 {{{
    292 mkdir /var/lib/postfix
    293 }}}
    294 
    295  * Add the following to the bottom of the /etc/postfix/main.cf file (change SERVER to the server name)
    296 
    297 {{{
    298 # May First custom config
    299 # file based virtual hosting configuration
    300 # List of virtual domain names
    301 virtual_alias_domains = hash:/etc/postfix/virtual_alias_domains
    302 
    303 # list of email address -> unix account mappings
    304 virtual_alias_maps = hash:/etc/postfix/virtual_alias_maps
    305 
    306 # use maildir
    307 home_mailbox = Maildir/
    308 
    309 # Added for maildrop
    310 mailbox_command = /usr/bin/maildrop
    311 maildrop_destination_recipient_limit = 1
    312 
    313 # Added by jamie 6/10/04 to try to stem the tide of spam
    314 smtpd_sender_restrictions =
    315   hash:/etc/postfix/access,
    316   reject_non_fqdn_sender,
    317   reject_unknown_sender_domain,
    318   permit
    319 
    320 # Added for amavisd-new
    321 content_filter=smtp-amavis:[127.0.0.1]:10024
    322 
    323 # to enable authentication for sending email
    324 # and postgrey (policy port 6000 line)
    325 smtpd_sasl_auth_enable = yes
    326 smtpd_sasl_security_options = noanonymous
    327 smtpd_sasl_local_domain = $myhostname
    328 broken_sasl_auth_clients = yes
    329 smtpd_recipient_restrictions =
    330   permit_sasl_authenticated,
    331   permit_mynetworks,
    332   reject_unauth_pipelining,
    333   reject_non_fqdn_recipient,
    334   reject_invalid_hostname,
    335   reject_unknown_recipient_domain,
    336   reject_unauth_destination,
    337   check_policy_service inet:127.0.0.1:60000
    338 smtpd_sasl_authenticated_header = yes
    339 
    340 # TLS Stuff here:
    341 tls_random_source = dev:/dev/urandom
    342 tls_daemon_random_source = dev:/dev/urandom
    343 
    344 # sever side tls - offer tls encryption when an smtp client
    345 # (either user email program or sending smtp server) can use it
    346 smtpd_tls_security_level = may
    347 smtpd_tls_CApath = /etc/ssl/certs
    348 smtpd_tls_loglevel = 1
    349 smtpd_tls_session_cache_database = sdbm:/var/lib/postfix/smtpd_scache
    350 # force people who want to authenticate to use tls - you can't authenticate
    351 # otherwise. This is important because passwords are sent in the clear
    352 smtpd_tls_auth_only = yes
    353 smtpd_tls_key_file = /etc/ssl/private/SERVER.mayfirst.org.pem
    354 smtpd_tls_cert_file = /etc/ssl/SERVER.mayfirst.org.crt
    355 smtpd_tls_received_header = yes
    356 smtpd_tls_session_cache_timeout = 3600s
    357 
    358 # client side - when we send to a server that offers tls, we should
    359 # accept
    360 smtp_tls_security_level = may
    361 smtp_tls_CApath = /etc/ssl/certs
    362 smtp_tls_session_cache_database = sdbm:/var/lib/postfix/smtp_scache
    363 smtp_tls_loglevel = 1
    364 # http://www.postfix.org/TLS_README.html recommends leaving these
    365 # lines commented out so we don't present a client certificate.
    366 # It is rare to be required to have a client certificate and presenting
    367 # one sometimes causes problems
    368 #smtp_tls_key_file = /etc/postfix/ssl/SERVER.mayfirst.org.pem
    369 #smtp_tls_cert_file = /etc/postfix/ssl/SERVER.mayfirst.org.pem
    370 
    371 }}}
    372 
    373  * Copy the /etc/postfix/master.cf file from chavez to get the amavis settings (and for chroot to be turned off)
    374 
    375  * Postfix as secure mail relay setup
    376 
    377  * Install the sasl packages
    378 {{{
    379 sudo apt-get install sasl2-bin libsasl2-modules ca-certificates
    380 }}}
    381 
    382  * Configure sasl. Edit /etc/default/saslauthd
    383 {{{
    384 Uncomment START = yes
    385 Change MECHANISMS to read:
    386 MECHANISMS ="shadow"
    387 }}}
    388 
    389  * Add postfix to the sasl group
    390 {{{
    391 sudo addgroup postfix sasl
    392 }}}
    393 
    394  * Make the /etc/postfix/ssl directory and copy the pem files there
    395 {{{
    396 sudo mkdir /etc/postfix/ssl
    397 sudo cp /whereever/server.pem /etc/postfix/ssl/
    398 }}}
    399 
    400  * Edit main.cf
    401 {{{
    402 # to enable authentication for sending email
    403 smtpd_sasl_auth_enable = yes
    404 smtpd_sasl_security_options = noanonymous
    405 smtpd_sasl_local_domain = $myhostname
    406 broken_sasl_auth_clients = yes
    407 smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
    408 
    409 # TLS Stuff here:
    410 smtpd_use_tls = yes
    411 # force people who want to authenticate to use tls - you can't authenticate
    412 # otherwise. This is important because passwords are sent in the clear
    413 smtpd_tls_auth_only = yes
    414 smtpd_tls_key_file = /etc/postfix/ssl/your-server-key-here.pem
    415 smtpd_tls_cert_file = /etc/postfix/ssl/your-server-key-here.pem
    416 smtpd_tls_received_header = yes
    417 smtpd_tls_session_cache_timeout = 3600s
    418 tls_random_source = dev:/dev/urandom
    419 }}}
    420 
    421  * Edit master.cf - uncomment the smtps and submission lines. In both lines change the chroot variable from "-" to "n"
    422 
    423  * Create /etc/postfix/sasl/smtpd.conf
    424 
    425 {{{
    426 sudo mkdir /etc/postfix/sasl
    427 sudo vim /etc/postfix/sasl/smtpd.conf
    428 # add these lines:
    429 pwcheck_method: saslauthd
    430 mech_list: plain login
    431 }}}
    432 
    433 == Setup Postgrey ==
    434 
    435 Postgrey defers all mail for 5 minutes the first time it receives a message with a never before seen sender and recipient. This results in a lot of spam not being delivered.
    436 
    437  * Install Postgrey
    438 {{{
    439 sudo apt-get install postgrey
    440 }}}
    441  * Edit /etc/default/postgrey adding the following line:
    442 {{{
    443 POSTGREY_TEXT ="Greylisted, see http://mayfirst.org/greylist"
    444 }}}
    445  * Restart postgrey
    446 {{{
    447 /etc/init.d/postgrey restart
    448 }}}
    449  * Edit /etc/postfix/main.cf, add the following to the end of the smtpd_recipient_restrictions stanza:
    450 {{{
    451 check_policy_service inet:127.0.0.1:60000
    452 }}}
    453 
    454 == Setup Courier ==
    455 
    456  * Create a shared/index file that is empty (to avoid getting error messages in the log)
    457 {{{
    458 mkdir /etc/courier/shared
    459 touch /etc/courier/index
    460 }}}
    461  * Edit both imapd-ssl and pop3d-ssl:
    462 {{{
    463 TLS_CERTFILE=/etc/ssl/private/SERVER.mayfirst.org.pem
    464 }}}
    465 
    466 == Setup amavis ==
    467 
    468  * Edit /etc/amavis/conf.d/50-user
    469 
    470 Add the following lines
    471 {{{
    472 @bypass_virus_checks_maps = (
    473 \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
    474 $final_banned_destiny     = D_PASS;   # D_REJECT when front-end MTA
    475 $final_spam_destiny       = D_PASS;
    476 $final_bad_header_destiny = D_PASS;
    477 # *Don't* notify me about viruses. Please.
    478 $virus_admin = '';
    479 }}}
    480 
    481  * Add clamav to the amavis group with:
    482 {{{
    483 sudo addgroup clamav amavis
    484 }}}
    485 
    486  * Add AllowSupplementaryGroups to /etc/clamav/clamd.conf
    487 
    488  * Add a cron job to clean out viruses and spam collected by amavis in /etc/cron.d called clean-up-virus with the contents:
    489 {{{
    490 # Find and delete all emails older than 14 days
    491 2 4 * * *       amavis  find /var/lib/amavis/virusmails -mtime +14  -exec rm '{}' \;
    492 }}}
    493 
    494 == Configure Spamassassin ==
    495 
    496  * Install helper packages
    497 {{{
    498 sudo apt-get install razor dcc-client
    499 }}}
    500 
    501  * Enable dcc - uncomment line in /etc/spamassassin/v310.pre the refers to dcc
    502 
    503  * Turn on subject munging (uncomment line in /etc/spamassassin/local.cf)
    504 
    505  * Turn off report safe (in /etc/spamassassin/local.cf set: report_safe 0)
    506 
    507  * Edit /etc/default/spamassassin - enable spamassassin
    508 
    509 == Maildrop ==
    510 
    511 Edit /etc/maildroprc and add the following lines:
    512 
    513 {{{
    514 DEFAULT ="$HOME/Maildir"
    515 # spamassassin
    516 xfilter "/usr/bin/spamc -u $LOGNAME"
    517 `test -d $HOME/Maildir/`
    518 if( $RETURNCODE == 1 )
    519 {
    520   `/usr/bin/maildirmake $HOME/Maildir/`
    521 }
    522 }}}
    523 
    524 == Webmail setup ==
    525 
    526  * Symlink the squirrelmail apache conf file:
    527 
    528 {{{
    529 $ ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.conf
    530 }}}
    531 
    532  * Edit the /etc/apache2/conf.d/horde.conf file. Add:
    533 {{{
    534 Redirect /webmail https://servername.mayfirst.org/horde3
    535 }}}
    536 
    537  * Copy the various /etc/horde/*/conf.conf files from chavez
    538 
    539  * Edit /etc/horde/imp4/servers.php (see chavez for details)
    540 
    541  * Run sudo /etc/squirrelmail/conf.pl
    542 
    543  * Change 1: organizational preferences (org name, provider link, provider name)
    544 
    545  * Change 2: server settings: A IMAP Settings (port: 993, secure imap: true,
    546 server software: courier
    547 
    548  * Plugins: install: delete_move_next,squirrelspell, filters,abook_take,listcommands,mail_fetch,gpg (you will need to download
    549 this one from www.squirrelmail.org into the /usr/share/squirrelmail/plugins
    550 
    551  * Gunzip/usr/share/doc/horde3/examples/scripts/sql/create.mysql.sql.gz into your home directory
    552 
    553  * Edit - change the password to a good password
    554 
    555  * Import into mysql: Directly import /usr/share/doc/turba2/examples/scripts/sql/turba_objects.mysql.sql with:
    556 
    557 {{{
    558 mysql -u root -p horde <  /usr/share/doc/turba2/examples/scripts/sql/turba_objects.mysql.sql
    559 }}}
    560 
    561 == Install Drupal ==
    562 
    563  * Download from drupal.org into: /usr/local/share/
    564 
    565  * Name the drupal directory after the version (i.e. drupal-4.7.3)
    566 
    567  * Create a soft link to the version (i.e. sudo ln -s drupal-4.7.3 drupal-4.7)
    568 
    569  * Tar up and copy all the files from wiwa /usr/local/share/drupal-modules-4.7 and place into the /usr/local/share/drupal-modules-4.7 on the target server.
    570 
    571 == Configure Apache ==
    572 
    573  * In /etc/apache2/site-available/default change NameVirtualHost * to: NameVirtualHost *:80
    574 
    575  * Change:
    576 {{{
    577 <VirtualHost *:80>
    578 ServerAdmin apache@mayfirst.org
    579 DocumentRoot /srv/apache/web (create this directory and index.html file)
    580 }}}
    581  * Add:
    582 {{{
    583 <VirtualHost *:443>
    584         ServerName SERVER.mayfirst.org
    585         ServerAlias www.SERVER.mayfirst.org
    586         DocumentRoot /srv/apache/web
    587         CustomLog /var/log/apache2/access.ssl.log combined
    588         SSLEngine On
    589         SSLCertificateFile /etc/apache2/ssl/SERVER.mayfirst.org.crt
    590         SSLCertificateKeyFile /etc/apache2/ssl/SERVER.mayfirst.org.key
    591         ErrorLog /var/log/apache2/error.log
    592 </VirtualHost>
    593 }}}
    594 
    595 == Configure logrotate ==
    596 
    597 Create a file called apache2-red in the /etc/logrotate.d directory with:
    598 
    599 {{{
    600 /home/members/*/sites/*/logs/*.log {
    601 weekly
    602 missingok
    603 rotate 12
    604 compress
    605 delaycompress
    606 notifempty
    607 create 644 root root
    608 sharedscripts
    609 postrotate
    610 if [ -f /var/run/apache2.pid ]; then
    611 /etc/init.d/apache2 restart > /dev/null
    612 fi
    613 endscript
    614 }
    615 }}}
    616 
    617 == Configure logcheck ==
    618 
    619 Copy from Wiwa to the server:
    620 {{{
    621 /etc/logcheck/logcheck.conf
    622 /etc/logcheck/ignore.d.server/local-*
    623 }}}
    624 
    625 == Configure cron-apt ==
    626 
    627 Edit /etc/cron-apt
    628 {{{
    629 Change line MAILON to MAILON ="upgrade"
    630 }}}
    631 
    632 == Configure Awstats ==
    633 
    634  * Copy /etc/awstats/awstats.conf.local from chavez to the target server's /etc/awstats directory
    635  * Copy /usr/local/sbin/mf-awstats-create, /usr/local/sbin/mf-awstats-build-staticpages, and /usr/local/etc/awstats-create from
    636 chavez to the target server.
    637  * Copy /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl to /usr/local/sbin/
    638  * Copy /usr/share/doc/awstats/examples/apache.conf to /etc/apache2/conf.d/awstats
    639 
    640 == Configure Mutt ==
    641 
    642 Create /etc/Muttrc.d and put a file named maildir.rc with
    643 
    644 {{{
    645 set mbox_type = Maildir
    646 set mbox =~/Maildir
    647 set spoolfile =~/Maildir
    648 set folder =~/Maildir
    649 }}}
    650 
    651 == Change ssh ==
    652 
    653 Make sure the following settings are set:
    654 {{{
    655 PermitRootLogin no
    656 AllowGroups sshusers
    657 # Required for Contribute. Grr.
    658 PasswordAuthentication yes
    659 }}}
    660 
    661 == Congifure phpmyadmin ==
    662 
    663 Copy the apache conf file from /etc/phpmyadmin to /etc/apach2/conf.d
    664 
    665 {{{
    666 cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin
    667 }}}
    668 
    669 Add the phpmyadmin alias:
    670 
    671 {{{
    672 echo "Alias /phpmyadmin /usr/share/phpmyadmin" >> /etc/apache2/conf.d/phpmyadmin
    673 }}}
    674 
    675 == Setup Backup ==
    676 
    677  * Copy the /usr/local/sbin/mf-backup and /etc/mf-backup.xml files from another server
    678  * Edit /etc/mf-backup.xml as needed
    679  * Be sure to grant the mysql backup user the proper permissions with:
    680 {{{
    681 GRANT SELECT,SHOW VIEW,LOCK TABLES ON *.* TO 'backup'@'localhost' identified by 'secret'
    682 }}}
    683