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
5057sudo apt-get install -y makepasswd # Needed to create a unique password non-interactively.
@@ -78,11 +85,6 @@ sudo sed -i '0,/host/s/localhost/'`wget -qO- http://instance-data/latest/meta-da
7885sudo -u git chmod 750 /home/git/gitolite
7986sudo -u gitlab chmod 660 /home/gitlab/gitlab/config/* .yml
8087
81- # Gitlab installation test (optional)
82- # sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
83- # sudo -u gitlab bundle exec rails s -e production
84- # sudo -u gitlab bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production BACKGROUND=no
85-
8688# Install and configure Nginx
8789sudo apt-get install -y nginx
8890sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/
@@ -100,21 +102,9 @@ sudo chmod +x /etc/init.d/gitlab && sudo update-rc.d gitlab defaults
100102# # Gitlab service commands (unicorn and resque)
101103# # restart doesn't restart resque, only start/stop effect it.
102104sudo -u gitlab service gitlab start
103- # sudo -u gitlab service gitlab restart
104- # sudo -u gitlab service gitlab stop
105105
106106# nginx Service commands
107- # sudo service nginx start
108107sudo service nginx restart
109- # sudo service nginx stop
110-
111- # Manual startup commands for troubleshooting when the service commands do not work
112- # sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D
113- # sudo su -l gitlab -c "cd gitlab && ./resque.sh"
114-
115- # Monitoring commands
116- # sudo tail -f /var/log/nginx/access.log;
117- # sudo tail -f /var/log/nginx/error.log;
118108
119109# Go to gitlab directory by default on next login.
120110echo ' cd /home/gitlab/gitlab' >> /home/ubuntu/.bashrc
@@ -130,3 +120,23 @@ echo ''
130120echo ' and login with the following Email and Password:'
131121echo ' admin@local.host'
132122echo ' 5iveL!fe'
123+
124+ # If you need it the database password can be found in '/home/gitlab/gitlab/config/database.yml'.
125+
126+ # Gitlab installation test:
127+ # sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
128+
129+ # Stating and stopping services:
130+ # To stop gitlab use: 'sudo -u gitlab service gitlab stop'
131+ # To stop nginx server use: 'sudo service nginx stop'
132+ # Replace stop with start to start those services.
133+
134+ # Manual startup commands for troubleshooting when the service commands do not work:
135+ # sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D
136+ # sudo su -l gitlab -c "cd gitlab && ./resque.sh"
137+ # sudo -u gitlab bundle exec rails s -e production
138+ # sudo -u gitlab bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production BACKGROUND=no
139+
140+ # Monitoring commands for the web server:
141+ # sudo tail -f /var/log/nginx/access.log
142+ # sudo tail -f /var/log/nginx/error.log
0 commit comments