Skip to content

Commit 5e753f7

Browse files
maxlaziodosire
authored andcommitted
Update aws script and move it to this repo.
Update aws install script Remove postfix from installation. Install postfix noninteractive, don't upgrade. Move postfix install and comment.
1 parent e7ba38e commit 5e753f7

File tree

1 file changed

+40
-30
lines changed

1 file changed

+40
-30
lines changed

install/debian_ubuntu_aws.sh

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,32 @@
1111
# The operating system used is Ubuntu 12.04 64bit.
1212

1313
# HOWTO
14-
# Signup for AWS, free tier are available at http://aws.amazon.com/free/
14+
# Signup for AWS, a free usage tier is available at http://aws.amazon.com/free/
1515
# Go to EC2 tab in the AWS console EC2 https://console.aws.amazon.com/ec2/home
1616
# Click the 'Launch Instance' button
1717
# Select: 'Quick launch wizard' and continue
18-
# Choose a key pair => Create New => Name it => Download it
19-
# Choose a Launch Configuration => Select 'More Amazon Marketplace Images'
18+
# Under "Choose a key pair" select "Create New"
19+
# Write a name for the key in "Name" field and Download it. Place it in a known location since it will be used in one of the next steps.
20+
# Under "Choose a Launch Configuration", select 'More Amazon Machine Images'.
2021
# Press 'Continue'
21-
# Enter 'ubuntu/images/ubuntu-precise-12.04-amd64-server-20120424' and press 'Search'
22+
# Enter 'ubuntu/images/ubuntu-precise-12.04-amd64-server-20120424' in the search field and press 'Search'
2223
# Select the only result (ami-3c994355) and press 'Continue'
2324
# Press 'Edit details' if you want to modify something, for example make the type 'c1.medium' to make the install faster.
2425
# Press the 'Launch' button
2526
# Press 'Close'
26-
# Click 'Security Groups' under the left hand menu 'NETWORK & SECURITY'
27-
# Select the newly create seciruty group, probably named 'quicklaunch-1'
27+
# Click 'Security Groups' under the left hand menu 'NETWORK & SECURITY' in aws console.
28+
# Select the newly create security group, probably named 'quicklaunch-1'
2829
# Click on the Inbound tab
29-
# In the 'Create a new rule' dropdown select 'HTTP'
30+
# In the 'Create a new rule' dropdown select 'HTTP', leave the default value in the "Source" field.
3031
# Press 'Add Rule'
31-
# In the 'Create a new rule' dropdown select 'HTTPS'
32+
# In the 'Create a new rule' dropdown select 'HTTPS', leave the default value in the "Source" field.
3233
# Press 'Add Rule'
3334
# Press 'Apply Rule Changes'
34-
# Give the following command in your local terminal while suptituting the UPPERCASE items
35-
# 'ssh -i LOCATION_OF_AWS_KEY_PAIR_PRIVATE_KEY PUBLIC_DNS_OF_THE_NEW_SERVER'
35+
# In Navigation side panel, under Instances -> Instances you can see when the instance is ready.
36+
# Give the following command in your local terminal while substituting the UPPERCASE items( ommit the '')
37+
# 'ssh -i LOCATION_OF_AWS_KEY_PAIR_PRIVATE_KEY ubuntu@PUBLIC_DNS_OF_THE_NEW_SERVER'
38+
# where LOCATION_OF_AWS_KEY_PAIR_PRIVATE_KEY is the location of the key saved on your local machine. Permissions of the .pem file have to be at least 600 (chmod 600 NAME_OF_PRIVATE_KEY.pem).
39+
# PUBLIC_DNS_OF_THE_NEW_SERVER can be viewed by selecting the aws instance created in previous steps and selecting the 'Description' tab
3640
# Execute the curl command below and when its ready follow the printed 'Log in instuctions'
3741
# curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu_aws.sh | sh
3842

@@ -41,10 +45,13 @@ echo "Host localhost
4145
StrictHostKeyChecking no
4246
UserKnownHostsFile=/dev/null" | sudo tee -a /etc/ssh/ssh_config
4347

44-
# Existing script for Step 1 to 3
48+
sudo DEBIAN_FRONTEND='noninteractive' apt-get install -y postfix-policyd-spf-python postfix # Install postfix without prompting.
4549

46-
sudo DEBIAN_FRONTEND='noninteractive' apt-get install -y postfix-policyd-spf-python # Install postfix without prompting.
47-
curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu.sh | sh
50+
# Existing script for Step 1 to 3
51+
curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu.sh >> debian_ubuntu.sh
52+
sed -i 's/postfix//' debian_ubuntu.sh # This will prompt even when postfix is already installed.
53+
sed -i '/sudo\ apt-get\ upgrade/d' debian_ubuntu.sh # Upgrade can cause prompting for various packages (grub, etc.).
54+
sh debian_ubuntu.sh
4855

4956
# Install MySQL
5057
sudo apt-get install -y makepasswd # Needed to create a unique password non-interactively.
@@ -74,11 +81,6 @@ sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive
7481
# Set the first occurrence of host in the Gitlab config to the publicly available domain name
7582
sudo sed -i '0,/host/s/localhost/'`wget -qO- http://instance-data/latest/meta-data/public-hostname`'/' /home/gitlab/gitlab/config/gitlab.yml
7683

77-
# Gitlab installation test (optional)
78-
# sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
79-
# sudo -u gitlab bundle exec rails s -e production
80-
# sudo -u gitlab bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production BACKGROUND=no
81-
8284
# Install and configure Nginx
8385
sudo apt-get install -y nginx
8486
sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/
@@ -96,21 +98,9 @@ sudo chmod +x /etc/init.d/gitlab && sudo update-rc.d gitlab defaults
9698
## Gitlab service commands (unicorn and resque)
9799
## restart doesn't restart resque, only start/stop effect it.
98100
sudo -u gitlab service gitlab start
99-
# sudo -u gitlab service gitlab restart
100-
# sudo -u gitlab service gitlab stop
101101

102102
# nginx Service commands
103-
# sudo service nginx start
104103
sudo service nginx restart
105-
# sudo service nginx stop
106-
107-
# Manual startup commands for troubleshooting when the service commands do not work
108-
# sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D
109-
# sudo su -l gitlab -c "cd gitlab && ./resque.sh"
110-
111-
# Monitoring commands
112-
# sudo tail -f /var/log/nginx/access.log;
113-
# sudo tail -f /var/log/nginx/error.log;
114104

115105
# Go to gitlab directory by default on next login.
116106
echo 'cd /home/gitlab/gitlab' >> /home/ubuntu/.bashrc
@@ -126,3 +116,23 @@ echo ''
126116
echo 'and login with the following Email and Password:'
127117
128118
echo '5iveL!fe'
119+
120+
# If you need it the database password can be found in '/home/gitlab/gitlab/config/database.yml'.
121+
122+
# Gitlab installation test:
123+
# sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
124+
125+
# Stating and stopping services:
126+
# To stop gitlab use: 'sudo -u gitlab service gitlab stop'
127+
# To stop nginx server use: 'sudo service nginx stop'
128+
# Replace stop with start to start those services.
129+
130+
# Manual startup commands for troubleshooting when the service commands do not work:
131+
# sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D
132+
# sudo su -l gitlab -c "cd gitlab && ./resque.sh"
133+
# sudo -u gitlab bundle exec rails s -e production
134+
# sudo -u gitlab bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production BACKGROUND=no
135+
136+
# Monitoring commands for the web server:
137+
# sudo tail -f /var/log/nginx/access.log
138+
# sudo tail -f /var/log/nginx/error.log

0 commit comments

Comments
 (0)