-
-
Save arfr/4b58c83a04d354a6eaf8 to your computer and use it in GitHub Desktop.
| sudo su | |
| apt-get install curl git subversion imagemagick libmagickwand-dev mysql-server mysql-client libmysqlclient-dev | |
| # password, password <- for mysql | |
| curl -L get.rvm.io | bash -s stable --ruby=2.1.2 | |
| useradd -r redmine | |
| mkdir /opt/redmine | |
| cd /opt/redmine | |
| svn co http://svn.redmine.org/redmine/branches/2.5-stable ./ | |
| mysql -uroot -ppassword | |
| CREATE DATABASE redmine CHARACTER SET utf8; | |
| GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'password'; | |
| \q | |
| cp config/configuration.yml.example config/configuration.yml | |
| cp config/database.yml.example config/database.yml | |
| vim config/database.yml << EOT | |
| production: | |
| adapter: mysql2 | |
| database: redmine | |
| host: localhost | |
| username: redmine | |
| password: "password" | |
| encoding: utf8 | |
| EOT | |
| vim Gemfile.local << EOT | |
| gem 'puma' | |
| EOT | |
| mkdir tmp/pids | |
| vim config/puma.rb << EOT | |
| #!/usr/bin/env puma | |
| environment 'production' | |
| daemonize false | |
| port 3000 | |
| pidfile 'tmp/pids/puma.pid' | |
| state_path 'tmp/pids/puma.state' | |
| threads 0, 16 | |
| bind 'unix://tmp/sockets/puma.sock' | |
| activate_control_app 'unix://tmp/sockets/pumactl.sock' | |
| EOT | |
| apt-get install nginx | |
| vim config/nginx.conf << EOT | |
| upstream redmine { | |
| server unix:///opt/redmine/tmp/sockets/puma.sock; | |
| } | |
| client_max_body_size 5m; | |
| server { | |
| listen 80; | |
| server_name redmine.local; | |
| root /opt/redmine/public; | |
| location / { | |
| proxy_pass http://redmine; | |
| proxy_redirect off; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $http_host; | |
| } | |
| } | |
| EOT | |
| ln -s /opt/redmine/config/nginx.conf /etc/nginx/sites-enabled/redmine.conf | |
| service nginx restart | |
| chown -R redmine:redmine /opt/redmine | |
| su redmine | |
| source /usr/local/rvm/scripts/rvm | |
| rvm use 2.1.2 --default | |
| bundle install --path vendor/bundle --without development test postgresql sqlite | |
| bundle exec rake generate_secret_token db:migrate REDMINE_LANG=de RAILS_ENV=production | |
| bundle exec rake redmine:load_default_data REDMINE_LANG=de RAILS_ENV=production | |
| exit | |
| vim /etc/init/redmine.conf << EOT | |
| description "redmine" | |
| start on filesystem or runlevel [2345] | |
| stop on runlevel [!2345] | |
| setuid redmine | |
| setgid redmine | |
| respawn | |
| script | |
| exec /bin/bash << EOT | |
| source /usr/local/rvm/scripts/rvm | |
| rvm use 2.1.2 --default | |
| cd /opt/redmine | |
| bundle exec puma --config config/puma.rb | |
| EOT | |
| end script | |
| EOT | |
| usermod -s /bin/false redmine | |
| start redmine | |
| # have fun ;) |
With this config I have it generates this error when running than redmine
upstream redmine {
server unix:///opt/redmine/tmp/sockets/puma.sock;
}
server {
listen 80;
server_name task.**_.ru www.task.**_.ru;
root /opt/redmine/public;
location / {
proxy_pass http://redmine;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
}
2014/07/17 21:22:44 [error] 1370#0: 1 connect() to unix:///opt/redmine/tmp/sockets/puma.sock failed (111: Connection refused) while connecting to upstream, client: 194..11.190, server: task..ru, request: "GET / HTTP/1.1", upstream: "http://unix:///opt/redmine/tmp/sockets/puma.sock:/", host: "task._.ru"
2014/07/17 21:22:44 [error] 1370#0: *1 connect() to unix:///opt/redmine/tmp/sockets/puma.sock failed (111: Connection refused) while connecting to upstream, client: 194.190.11.190, server: task._.ru, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///opt/redmine/tmp/sockets/puma.sock:/favicon.ico", host: "task.***.ru"
I would be very grateful for the help!!!!!!!!
Sorry, just now noticed your messages =D
Just contact me: [email protected] помогу )))
Спасибо) уже разобрался, даже сам могу помочь, по этому если [email protected] не ответит пишите на [email protected]
так если ты разобрался, так запости сразу ришение на твою проблему ;)
And how to run redmine on subdomain is valid, and was treated to 80 port task.site.ru?