Skip to content

Commit 8d8385f

Browse files
committed
Merge branch 'master' into implement_phusion_security_enhancements
Conflicts: install/debian_ubuntu_aws.sh
2 parents a709d59 + 19d61a4 commit 8d8385f

File tree

3 files changed

+83
-30
lines changed

3 files changed

+83
-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.
@@ -78,11 +85,6 @@ sudo sed -i '0,/host/s/localhost/'`wget -qO- http://instance-data/latest/meta-da
7885
sudo -u git chmod 750 /home/git/gitolite
7986
sudo -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
8789
sudo apt-get install -y nginx
8890
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
100102
## Gitlab service commands (unicorn and resque)
101103
## restart doesn't restart resque, only start/stop effect it.
102104
sudo -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
108107
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;
118108

119109
# Go to gitlab directory by default on next login.
120110
echo 'cd /home/gitlab/gitlab' >> /home/ubuntu/.bashrc
@@ -130,3 +120,23 @@ echo ''
130120
echo 'and login with the following Email and Password:'
131121
132122
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

lighttpd/10-gitlab.conf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# GITLAB
2+
# Maintainer: @tvn87
3+
# App Version: 2.8
4+
5+
server.modules += (
6+
"mod_simple_vhost",
7+
"mod_proxy"
8+
)
9+
10+
## The document root of a virtual host is document-root =
11+
## simple-vhost.server-root + $HTTP["host"] + simple-vhost.document-root
12+
simple-vhost.server-root = "/var/www"
13+
simple-vhost.document-root = "htdocs"
14+
15+
## the default host if no host is sent
16+
simple-vhost.default-host = "YOUR_SERVER_FQDN"
17+
18+
19+
$HTTP["host"] == "YOUR_SERVER_FQDN" {
20+
var.vhost_name = "YOUR_SERVER_FQDN"
21+
var.vhost_path = "/var/www/YOUR_SERVER_FQDN" # This directory should be empty
22+
23+
proxy.server = ( "" => ( (
24+
"host" => "127.0.0.1",
25+
"port" => "8080"
26+
),
27+
)
28+
)
29+
ssl.pemfile = "/etc/lighttpd/certs/YOUR_SERVER_FQDN.pem" # If ssl is enabled
30+
}

lighttpd/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Gitlab with lighttpd webserver
2+
==============================
3+
4+
* Maintainer: @tvn87
5+
* App Version: 2.8
6+
7+
This config access gitlab via TCP port instead of sockets because of the
8+
mod_proxy module which seems to be unable to connect via sockets.
9+
10+
Because the _gitlab_ default config is set for listening to UNIX sockets you
11+
need to change that default configuration in *gitlab/config/unicorn.rb*:
12+
13+
listen "127.0.0.1:8080"

0 commit comments

Comments
 (0)