separated the ec2 part from the scripts so setting up non ec2 server should piece of cake

This commit is contained in:
Timothy Prepscius 2013-08-18 11:34:42 -04:00
parent f636de0f14
commit 77db4f4f2d
11 changed files with 77 additions and 23 deletions

View File

@ -9,15 +9,36 @@ If you don't have them, generate them by googling "generate .ssh keys" and doing
2. You must go into the requirements directory and
2. You must go into the requirements directory and run "./get_rsa_pub"
a. run "./get_rsa_pub"
This will get the .ssh public key and put it in this directory so it can be easily transfered
to the target machine.
b. if you are going to install to an ec2 instance,
you must create the prod and dev instance and copy the key.pem file into requirements.
and then soft link the ec2-key.pem to your file.
c. and then, this is really important, you must
3. You must go into the requirements directory and modify "server_root_account" to have whatever the root account
(which must have sudo priviledges) name is.
MUAHAHAHAHHAHAHA... just kidding, I'll write the rest soon.
4. If you are going to use EC2 to test this install you must
a. copy the server key.pem file into the requirements directory and soft link ec2-key.pem to it via
ln -fs your-key-file.pem ec2-key.pem
b. go back to the install directory and run "./enable_ec2_login THE_SERVER_IP"
5. If you are NOT going to use EC2, you MUST make the root account publickey accessible from the machine you are
installing off of. Take a look at "enable_ec2_login" for what this means.
---
Ok now you are ready to go.
from the install directory type in
./setup-server YOUR-SERVER-IP-NAME-WHATEVER
and it should create the various accounts for the system and enable ssh publickey access to them.
it should download apache james and enable it

View File

@ -5,7 +5,7 @@ USER=$1
sudo useradd -m $USER
sudo usermod -s /bin/bash $USER
sudo mkdir ../$USER/.ssh
sudo cp authorized_keys ../$USER/.ssh
cat authorized_keys | sudo tee -a ../$USER/.ssh/authorized_keys
sudo chown $USER ../$USER/.ssh ../$USER/.ssh/*
sudo chgrp $USER ../$USER/.ssh ../$USER/.ssh/*

View File

@ -1,12 +1,12 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
set -x
source ../host.config
source requirements/server_root_account
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 create-server-accounts.remote $M_ROOT@$M_HOST:
scp -i requirements/ec2-key.pem create-server-account-user.remote $M_ROOT@$M_HOST:
ssh -i requirements/ec2-key.pem $M_ROOT@$M_HOST ./create-server-accounts.remote
scp requirements/id_rsa.pub $M_ROOT@$M_HOST:authorized_keys
scp create-server-accounts.remote $M_ROOT@$M_HOST:
scp create-server-account-user.remote $M_ROOT@$M_HOST:
ssh $M_ROOT@$M_HOST ./create-server-accounts.remote

10
install/enable_ec2_login Executable file
View File

@ -0,0 +1,10 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
set -x
source requirements/server_root_account
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 create-server-account-user.remote $M_ROOT@$M_HOST:
ssh -i requirements/ec2-key.pem $M_ROOT@$M_HOST ./create-server-account-user.remote $M_ROOT

2
install/requirements/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
id_rsa.pub
orange.pem

View File

@ -1 +1 @@
your-ec2-key.pem
orange.pem

View File

@ -0,0 +1 @@
M_ROOT='ubuntu'

8
install/setup-java Executable file
View File

@ -0,0 +1,8 @@
set -x
source requirements/server_root_account
M_HOST=$1
scp setup-java.remote $M_ROOT@$M_HOST:
ssh $M_ROOT@$M_HOST ./setup-java.remote

11
install/setup-java.remote Executable file
View File

@ -0,0 +1,11 @@
# why oracle java?
# because icetea has errors. After spending near 30 hours trying to negotiate icetea screw ups
# I realized: why bother?
sudo add-apt-repository ppa:webupd8team/java --yes
sudo apt-get update
sudo apt-get install oracle-java7-installer --yes
echo "Check the version after running this script, if it is not sun java then"
echo "read this: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html"
echo "and do what it says."

10
install/setup-server Executable file
View File

@ -0,0 +1,10 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
set -x
M_HOST=$1
./create-server-accounts $M_HOST
./setup-james $M_HOST
./setup-java $M_HOST

View File

@ -1,9 +0,0 @@
set -x
source ../host.config
./create-server-accounts $M_HOST_PROD
./create-server-accounts $M_HOST_DEV
./setup-james $M_HOST_PROD
./setup-james $M_HOST_DEV