11
11
# The operating system used is Ubuntu 12.04 64bit.
12
12
13
13
# 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/
15
15
# Go to EC2 tab in the AWS console EC2 https://console.aws.amazon.com/ec2/home
16
16
# Click the 'Launch Instance' button
17
17
# 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'.
20
21
# 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'
22
23
# Select the only result (ami-3c994355) and press 'Continue'
23
24
# Press 'Edit details' if you want to modify something, for example make the type 'c1.medium' to make the install faster.
24
25
# Press the 'Launch' button
25
26
# 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'
28
29
# 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.
30
31
# 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.
32
33
# Press 'Add Rule'
33
34
# 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
36
40
# Execute the curl command below and when its ready follow the printed 'Log in instuctions'
37
41
# curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu_aws.sh | sh
38
42
@@ -41,10 +45,13 @@ echo "Host localhost
41
45
StrictHostKeyChecking no
42
46
UserKnownHostsFile=/dev/null" | sudo tee -a /etc/ssh/ssh_config
43
47
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.
45
49
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
48
55
49
56
# Install MySQL
50
57
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
74
81
# Set the first occurrence of host in the Gitlab config to the publicly available domain name
75
82
sudo sed -i ' 0,/host/s/localhost/' ` wget -qO- http://instance-data/latest/meta-data/public-hostname` ' /' /home/gitlab/gitlab/config/gitlab.yml
76
83
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
-
82
84
# Install and configure Nginx
83
85
sudo apt-get install -y nginx
84
86
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
96
98
# # Gitlab service commands (unicorn and resque)
97
99
# # restart doesn't restart resque, only start/stop effect it.
98
100
sudo -u gitlab service gitlab start
99
- # sudo -u gitlab service gitlab restart
100
- # sudo -u gitlab service gitlab stop
101
101
102
102
# nginx Service commands
103
- # sudo service nginx start
104
103
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;
114
104
115
105
# Go to gitlab directory by default on next login.
116
106
echo ' cd /home/gitlab/gitlab' >> /home/ubuntu/.bashrc
@@ -126,3 +116,23 @@ echo ''
126
116
echo ' and login with the following Email and Password:'
127
117
128
118
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