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.
@@ -78,11 +85,6 @@ sudo sed -i '0,/host/s/localhost/'`wget -qO- http://instance-data/latest/meta-da
78
85
sudo -u git chmod 750 /home/git/gitolite
79
86
sudo -u gitlab chmod 660 /home/gitlab/gitlab/config/* .yml
80
87
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
-
86
88
# Install and configure Nginx
87
89
sudo apt-get install -y nginx
88
90
sudo 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
100
102
# # Gitlab service commands (unicorn and resque)
101
103
# # restart doesn't restart resque, only start/stop effect it.
102
104
sudo -u gitlab service gitlab start
103
- # sudo -u gitlab service gitlab restart
104
- # sudo -u gitlab service gitlab stop
105
105
106
106
# nginx Service commands
107
- # sudo service nginx start
108
107
sudo 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;
118
108
119
109
# Go to gitlab directory by default on next login.
120
110
echo ' cd /home/gitlab/gitlab' >> /home/ubuntu/.bashrc
@@ -130,3 +120,23 @@ echo ''
130
120
echo ' and login with the following Email and Password:'
131
121
132
122
echo ' 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