diff --git a/install/README_FIRST_EVEN_IF_YOU_DONT_WANT_TO b/install/README_FIRST_EVEN_IF_YOU_DONT_WANT_TO index 15c9e28..1341d88 100644 --- a/install/README_FIRST_EVEN_IF_YOU_DONT_WANT_TO +++ b/install/README_FIRST_EVEN_IF_YOU_DONT_WANT_TO @@ -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 diff --git a/install/create-server-account-user.remote b/install/create-server-account-user.remote index b6b7855..5f44d6f 100755 --- a/install/create-server-account-user.remote +++ b/install/create-server-account-user.remote @@ -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/* diff --git a/install/create-server-accounts b/install/create-server-accounts index 199914d..ce41de4 100755 --- a/install/create-server-accounts +++ b/install/create-server-accounts @@ -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 diff --git a/install/enable_ec2_login b/install/enable_ec2_login new file mode 100755 index 0000000..ed518a3 --- /dev/null +++ b/install/enable_ec2_login @@ -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 diff --git a/install/requirements/.gitignore b/install/requirements/.gitignore new file mode 100644 index 0000000..333b0d6 --- /dev/null +++ b/install/requirements/.gitignore @@ -0,0 +1,2 @@ +id_rsa.pub +orange.pem diff --git a/install/requirements/ec2-key.pem b/install/requirements/ec2-key.pem index dfb6447..46b0046 120000 --- a/install/requirements/ec2-key.pem +++ b/install/requirements/ec2-key.pem @@ -1 +1 @@ -your-ec2-key.pem \ No newline at end of file +orange.pem \ No newline at end of file diff --git a/install/requirements/server_root_account b/install/requirements/server_root_account new file mode 100644 index 0000000..fdce4ce --- /dev/null +++ b/install/requirements/server_root_account @@ -0,0 +1 @@ +M_ROOT='ubuntu' diff --git a/install/setup-java b/install/setup-java new file mode 100755 index 0000000..573c57a --- /dev/null +++ b/install/setup-java @@ -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 + diff --git a/install/setup-java.remote b/install/setup-java.remote new file mode 100755 index 0000000..0e7b540 --- /dev/null +++ b/install/setup-java.remote @@ -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." diff --git a/install/setup-server b/install/setup-server new file mode 100755 index 0000000..d43e78c --- /dev/null +++ b/install/setup-server @@ -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 + diff --git a/install/setup-servers b/install/setup-servers deleted file mode 100755 index 12b10be..0000000 --- a/install/setup-servers +++ /dev/null @@ -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 -