Просмотр исходного кода

Add nginx reverse proxy to apache in Vagrant VM

Accessible at port 9001.
master
Maik Hoepfel 13 лет назад
Родитель
Сommit
a76e0f02e8
4 измененных файлов: 25 добавлений и 1 удалений
  1. 1
    0
      .gitignore
  2. 2
    1
      Makefile
  3. 1
    0
      Vagrantfile
  4. 21
    0
      sites/puppet/manifests/site.pp

+ 1
- 0
.gitignore Просмотреть файл

@@ -44,3 +44,4 @@ sites/demo/*.sqlite
44 44
 sites/demo/assets/
45 45
 sites/demo/public/
46 46
 sites/demo/whoosh_index/
47
+sites/puppet/modules/

+ 2
- 1
Makefile Просмотреть файл

@@ -66,8 +66,9 @@ puppet:
66 66
 	puppet module install --target-dir sites/puppet/modules/ saz-memcached -v 2.0.2
67 67
 	puppet module install --target-dir sites/puppet/modules/ puppetlabs/mysql
68 68
 	puppet module install --target-dir sites/puppet/modules/ puppetlabs/apache
69
+	puppet module install --target-dir sites/puppet/modules/ dhutty/nginx
69 70
 	git clone git://github.com/akumria/puppet-postgresql.git sites/puppet/modules/postgresql
70
-	git clone git://github.com/uggedal/puppet-module-python.git sites/puppet/modules/python
71
+	git clone git://github.com/puppetmodules/puppet-module-python sites/puppet/modules/python
71 72
 	git clone git://github.com/codeinthehole/puppet-userconfig.git sites/puppet/modules/userconfig
72 73
 
73 74
 css:

+ 1
- 0
Vagrantfile Просмотреть файл

@@ -12,6 +12,7 @@ Vagrant::Config.run do |config|
12 12
     config.vm.box_url = "http://files.vagrantup.com/precise64.box"
13 13
 	config.vm.forward_port 8000, 8080
14 14
 	config.vm.forward_port 80, 8081
15
+	config.vm.forward_port 9001, 9001
15 16
 	#config.vm.boot_mode = :gui
16 17
     config.vm.provision :puppet do |puppet|
17 18
         puppet.manifests_path = "sites/puppet/manifests"

+ 21
- 0
sites/puppet/manifests/site.pp Просмотреть файл

@@ -34,6 +34,23 @@ node precise64 {
34 34
 	    source => "/vagrant/sites/sandbox/deploy/apache2/vagrant.conf"
35 35
 	}
36 36
 
37
+	# Nginx in front of Apache
38
+	class { "nginx": }
39
+	nginx::resource::vhost { 'apache_rp':
40
+	  ensure => present,
41
+	  listen_port => 9001,
42
+	}
43
+	nginx::resource::location { 'apache-root':
44
+	  ensure => present,
45
+	  vhost => 'apache_rp',
46
+	  location => '/',
47
+	  proxy => 'http://localhost',
48
+	  proxy_set_headers => {
49
+	  'REMOTE_ADDR' => '$remote_addr',
50
+	  'HTTP_HOST' => '$http_host',
51
+	  },
52
+	}
53
+
37 54
 	# Memcached
38 55
 	class {"memcached": max_memory => 64 }
39 56
 
@@ -81,6 +98,10 @@ node precise64 {
81 98
 	    venv => $virtualenv,
82 99
 		require => Python::Venv::Isolate[$virtualenv]
83 100
 	}
101
+	python::pip::requirements {"/vagrant/requirements_less.txt":
102
+	    venv => $virtualenv,
103
+		require => Python::Venv::Isolate[$virtualenv]
104
+	}
84 105
     exec {"install-oscar":
85 106
 	    command => "$virtualenv/bin/python /vagrant/setup.py develop",
86 107
 		require => Python::Venv::Isolate[$virtualenv]

Загрузка…
Отмена
Сохранить