Maintenance: Preparing an Amazon Web Services Instance

From Automated Assistance for Formal Reasoning

Jump to: navigation, search

This article describes how to customize a fresh Amazon Web Service Elastic Compute Cloud (EC2) instance (that uses a Fedora-based Linux image) to accommodate the aartifact system (including both the database and verifier components and their interfaces). Depending on the image type, some of the steps below may not be necessary; the steps should be sufficient to prepare an AWS EC2 Micro instance that uses an AMI with the Fedora-based Amazon Linux distribution.

Once this process is complete, refer to the article Maintenance: Installing under Linux to set up the aartifact system on the AWS instance.

Contents

[edit] Preparation

AWS images may require an initial login using the ec2-user user.

 sudo su

[edit] Enable logon using root (optional, not recommended)

Edit /etc/ssh/sshd_config,

 nano /etc/ssh/sshd_config

and add or change to the following setting:

 PermitRootLogin without-password

Edit ~/.ssh/authorized_keys:

 nano ~/.ssh/authorized_keys

Remove the command portion, ssh-rsa should be first thing in file.

Reload the SSH service.

 /etc/init.d/sshd reload

[edit] Make sure yum has access to the Fedora repository

Update yum:

 yum -y update

Create a file fedora.repo in the following directory:

  /etc/yu.repos.d/

The file should contain the following (ensure that there is no whitespace at the beginning of each line).

 [fedora]
 name=Fedora 15 - i386
 failovermethod=priority
 baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/15/Everything/i386/os/
 mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-15
 enabled=1
 gpgcheck=0

Key files should be placed in the following directory:

  /etc/pki/rpm-gpg/

Update yum:

 yum -y --skip-broken update

[edit] Install archiving utilities

 yum -y install zip
 yum -y install unzip

[edit] Install and set up LAMP components

[edit] Install and set up httpd

 yum -y install httpd
 chkconfig httpd on
 /etc/init.d/httpd start

Modify the DocumentRoot setting in /etc/httpd/conf/httpd.conf if necessary (it should normally be /var/www/pub), then reload:

 /etc/init.d/httpd reload

You may want to delete the old default DocumentRoot directory.

 rm -rf /var/www/html

[edit] Install and set up PHP

 yum -y install php
 yum -y install php-mysql

Add to /etc/mime.types the following two lines (note tabs):

 application/x-httpd-php			php
 application/x-httpd-php-source			phps

Reload:

 /etc/init.d/httpd reload

Edit /etc/php.ini to add any necessary extensions (normally, this should not be necessary; all required extensions should already be available).

[edit] Install and set up MySQL

Install MySQL:

 yum -y install mysql-server mysql

Start the service and set the administrator password (XXXX signifies a password):

 service mysqld start
 mysqladmin -u root password XXXX

[edit] Install necessary components for aartifact

[edit] Install make

 yum -y install make

[edit] Install the Haskell Platform

 yum -y install haskell-platform

[edit] Install LaTeX for MediaWiki

[edit] Install LaTeX and dvipng

The following are sufficient to run an instance of MediaWiki that has been customized according to the article Maintenance: Integration with MediaWiki under the Maintenance: Integration with MediaWiki#LaTeX support without texcv option.

 yum -y install texlive texlive-latex
 yum -y install dvipng

[edit] Install other components for MediaWiki/LaTeX

This portion of the documentation has not yet been written.

[edit] Install SVN (optional)

[edit] Install necessary components

 yum -y install svn mod_dav_svn

[edit] Configure SVN

Make sure that there is no directory svn in the directory specified as the Apache DocumentRoot. Change /etc/httpd/conf.d/subversion.conf to the following:

 LoadModule dav_svn_module     modules/mod_dav_svn.so
 LoadModule authz_svn_module   modules/mod_authz_svn.so
 <Location /svn>
  DAV svn
  SVNParentPath /var/svn
  # omit lines below to make it public
  AuthType Basic
  AuthName "aartifact repository"
  AuthUserFile /var/svn/.htpasswd
  Require valid-user # or Require user usr1 usr2
 </Location>

Specify the users that may access the repository:

 htpasswd -c /var/svn/.htpasswd username

Reload:

 /etc/init.d/httpd reload

[edit] Make the repository

 mkdir /var/svn
 svnadmin create /var/svn/aartifact
 chown -R apache.apache /var/svn/aartifact
Personal tools
course projects
ongoing projects