adds more install

This commit is contained in:
Timothy Prepscius 2013-09-01 12:19:41 -04:00
parent 35ef1c624e
commit 28925e122e
30 changed files with 227 additions and 18 deletions

View File

@ -1,2 +1,5 @@
rsync -avL --exclude="WEB-INF" --delete ../gwt/war/ red:www/ source ./config.hosts
server=$M_HOST_DEV
rsync -avL --exclude="WEB-INF" --delete ../gwt/war/ www@$server:

5
deploy/dev-web-restart Executable file
View File

@ -0,0 +1,5 @@
source ./config.hosts
server=$M_HOST_DEV
scp dev-web-restart.remote www@$server:
ssh www@$server ./dev-web-restart.remote

2
deploy/dev-web-restart.remote Executable file
View File

@ -0,0 +1,2 @@
killall -u www python
python -m SimpleHTTPServer > http.log 2>&1 &

0
deploy/web. Normal file
View File

5
deploy/web/catalog Executable file
View File

@ -0,0 +1,5 @@
cd ~
mkdir -p deploy-catalog
V=`date "+%Y%m%d_%H%M%S"`
tar -czf deploy-catalog/deploy_$V.tar.gz deploy

View File

@ -0,0 +1 @@
../../../keys/nginx/final.crt

View File

@ -0,0 +1 @@
../../../keys/nginx/final.key

View File

@ -0,0 +1,56 @@
#user nobody;
worker_processes 1;
error_log ~/run.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
access_log ~/run.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
# HTTPS server
#
server {
listen 443;
# server_name mail.mailiverse.com;
ssl on;
ssl_certificate ~/resources/nginx-ssl.crt;
ssl_certificate_key ~/resources/nginx-ssl.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
autoindex off;
root ~/www/;
}
}
}

8
deploy/web/run Executable file
View File

@ -0,0 +1,8 @@
./setup
echo "----------------------------------------------" >> ../run.log
date >> ../run.log
echo "----------------------------------------------" >> ../run.log
/usr/bin/nginx -t -c ~/resources/nginx.conf

3
deploy/web/setup Executable file
View File

@ -0,0 +1,3 @@
cd ~
ln -fs deploy/resources

1
deploy/web/shutdown Executable file
View File

@ -0,0 +1 @@
/usr/bin/nginx -c ~/resources/nginx.conf -s stop

1
deploy/web/www Symbolic link
View File

@ -0,0 +1 @@
../www

1
ext/apache-tomcat.tar.gz Symbolic link
View File

@ -0,0 +1 @@
apache-tomcat-7.0.37.tar.gz

View File

@ -1,4 +1,4 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
entryPointModules= entryPointModules=
filesCopiedToWebInfLib=gwt-servlet.jar filesCopiedToWebInfLib=gwt-servlet.jar
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBW11dPjwvZXh0cmEtYXJncz48dm0tYXJncz48IVtDREFUQVstWG14NTEybSAtRGd3dC51c2VhcmNoaXZlcz1mYWxzZV1dPjwvdm0tYXJncz48ZW50cnktcG9pbnQtbW9kdWxlPmNvbS5tYWlsaXZlcnNlLmd3dC5NYWlsaXZlcnNlX0dXVDwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+ gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+UFJFVFRZPC9vdXRwdXQtc3R5bGU+PGV4dHJhLWFyZ3M+PCFbQ0RBVEFbXV0+PC9leHRyYS1hcmdzPjx2bS1hcmdzPjwhW0NEQVRBWy1YbXg1MTJtIC1EZ3d0LnVzZWFyY2hpdmVzPWZhbHNlXV0+PC92bS1hcmdzPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLm1haWxpdmVyc2UuZ3d0Lk1haWxpdmVyc2VfR1dUPC9lbnRyeS1wb2ludC1tb2R1bGU+PC9nd3QtY29tcGlsZS1zZXR0aW5ncz4\=

70
gwt/build.xml Normal file
View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="Mailiverse-GWT">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../Desktop/eclipse"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<path id="Mailiverse-GWT.classpath">
<pathelement location="war/WEB-INF/classes"/>
<pathelement location="../../../../../Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1/gwt-user.jar"/>
<pathelement location="../../../../../Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1/gwt-dev.jar"/>
<pathelement location="../../../../../Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1/validation-api-1.0.0.GA-sources.jar"/>
<pathelement location="../../../../../Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1/validation-api-1.0.0.GA.jar"/>
<pathelement location="lib/gwtexporter-2.5.0-SNAPSHOT.jar"/>
</path>
<target name="init">
<mkdir dir="war/WEB-INF/classes"/>
<copy includeemptydirs="false" todir="war/WEB-INF/classes">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="war/WEB-INF/classes">
<fileset dir="jre-gwt">
<include name="*.xml"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="war/WEB-INF/classes">
<fileset dir="jre">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="war/WEB-INF/classes"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="war/WEB-INF/classes" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<src path="jre-gwt"/>
<src path="jre"/>
<include name="*.xml"/>
<classpath refid="Mailiverse-GWT.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>

View File

@ -0,0 +1,4 @@
AMI: debian-6.0-squeeze-base-i386-20110417
you will need to run: ./enable-sudo ADDRESSOFYOURMACHINE

View File

@ -2,13 +2,20 @@ set -x
USER=$1 USER=$1
sudo useradd -m $USER if [ "$USER" == "root" ]
sudo usermod -s /bin/bash $USER then
sudo mkdir ../$USER/.ssh USER_DIR='.'
cat authorized_keys | sudo tee -a ../$USER/.ssh/authorized_keys else
USER_DIR="/home/$USER"
sudo useradd -m $USER
sudo usermod -s /bin/bash $USER
fi
sudo chown $USER ../$USER/.ssh ../$USER/.ssh/* sudo mkdir $USER_DIR/.ssh
sudo chgrp $USER ../$USER/.ssh ../$USER/.ssh/* cat authorized_keys | sudo tee -a $USER_DIR/.ssh/authorized_keys
sudo chmod 0700 ../$USER/.ssh
sudo chmod 0644 ../$USER/.ssh/authorized_keys sudo chown $USER $USER_DIR/.ssh $USER_DIR/.ssh/*
sudo chmod 0700 ../$USER sudo chgrp $USER $USER_DIR/.ssh $USER_DIR/.ssh/*
sudo chmod 0700 $USER_DIR/.ssh
sudo chmod 0644 $USER_DIR/.ssh/authorized_keys
sudo chmod 0700 $USER_DIR

View File

@ -1,8 +1,7 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
set -x set -x
source requirements/server_root_account M_ROOT=`cat requirements/server_root_account`
M_HOST=$1 M_HOST=$1
scp requirements/id_rsa.pub $M_ROOT@$M_HOST:authorized_keys scp requirements/id_rsa.pub $M_ROOT@$M_HOST:authorized_keys

View File

@ -1,5 +1,6 @@
set -x set -x
./create-server-account-user.remote web
./create-server-account-user.remote james ./create-server-account-user.remote james
./create-server-account-user.remote mail-user ./create-server-account-user.remote mail-user
./create-server-account-user.remote mail-key ./create-server-account-user.remote mail-key

View File

@ -1,8 +1,7 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
set -x set -x
source requirements/server_root_account M_ROOT=`cat requirements/server_root_account`
M_HOST=$1 M_HOST=$1
scp -i requirements/ec2-key.pem requirements/id_rsa.pub $M_ROOT@$M_HOST:authorized_keys scp -i requirements/ec2-key.pem requirements/id_rsa.pub $M_ROOT@$M_HOST:authorized_keys

8
install/enable-sudo Executable file
View File

@ -0,0 +1,8 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
set -x
M_ROOT=`cat requirements/server_root_account`
M_HOST=$1
scp -i requirements/ec2-key.pem enable-sudo.remote $M_ROOT@$M_HOST:
ssh -i requirements/ec2-key.pem $M_ROOT@$M_HOST ./enable-sudo.remote

3
install/enable-sudo.remote Executable file
View File

@ -0,0 +1,3 @@
apt-get update
apt-get install sudo

View File

@ -1 +1 @@
M_ROOT='ubuntu' root

View File

@ -1,6 +1,6 @@
set -x set -x
source requirements/server_root_account M_ROOT=`cat requirements/server_root_account`
M_HOST=$1 M_HOST=$1
scp setup-java.remote $M_ROOT@$M_HOST: scp setup-java.remote $M_ROOT@$M_HOST:

View File

@ -1,6 +1,6 @@
set -x set -x
source requirements/server_root_account M_ROOT=`cat requirements/server_root_account`
MAIL_PASSWORD=`cat ../passwords/mail` MAIL_PASSWORD=`cat ../passwords/mail`
MAIL_EXTRA_PASSWORD=`cat ../passwords/mail_extra` MAIL_EXTRA_PASSWORD=`cat ../passwords/mail_extra`

View File

@ -8,3 +8,6 @@ M_HOST=$1
./setup-james $M_HOST ./setup-james $M_HOST
./setup-java $M_HOST ./setup-java $M_HOST
./setup-mysql $M_HOST ./setup-mysql $M_HOST
./setup-tomcat $M_HOST
./setup-web $M_HOST

8
install/setup-tomcat Executable file
View File

@ -0,0 +1,8 @@
set -x
M_HOST=$1
scp ../ext/apache-tomcat.tar.gz tomcat@$M_HOST:
scp setup-tomcat.remote tomcat@$M_HOST:
ssh tomcat@$M_HOST ./setup-tomcat.remote

10
install/setup-tomcat.remote Executable file
View File

@ -0,0 +1,10 @@
set -x
tar -xzvf apache-tomcat.tar.gz
ln -s apache-tomcat-* tomcat
ln -s tomcat/logs/catalina.out run.log
mv tomcat/webapps tomcat/webapps.original
mkdir tomcat/webapps
cd tomcat/webapps && ln -s ../../deploy/WebServer.war Mailiverse.war

7
install/setup-web Executable file
View File

@ -0,0 +1,7 @@
set -x
M_ROOT=`cat requirements/server_root_account`
M_HOST=$1
scp setup-web.remote $M_ROOT@$M_HOST:
ssh $M_ROOT@$M_HOST ./setup-web.remote

3
install/setup-web.remote Executable file
View File

@ -0,0 +1,3 @@
set -x
sudo apt-get install nginx --yes