Giter Site home page Giter Site logo

goooseman / capistrano3-ubuntu-server-prepare Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 9.0 372 KB

A Capistrano (v3) task for automated Ubuntu server configuration (Installing Nginx, Postgre, Redis, RVM and many others)

License: MIT License

Ruby 79.96% Nginx 20.04%

capistrano3-ubuntu-server-prepare's People

Contributors

alexeyzhel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

capistrano3-ubuntu-server-prepare's Issues

gpg: keyserver receive failed: keyserver error

INFO [ba22614b] Running gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 as [email protected]
DEBUG [ba22614b] Command: gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
DEBUG [ba22614b]    gpg: directory `/home/deployer/.gnupg' created
DEBUG [ba22614b]    gpg: 
DEBUG [ba22614b]    new configuration file `/home/deployer/.gnupg/gpg.conf' created
DEBUG [ba22614b]    gpg: 
DEBUG [ba22614b]    WARNING: options in `/home/deployer/.gnupg/gpg.conf' are not yet active during this run
DEBUG [ba22614b]    gpg: 
DEBUG [ba22614b]    keyring `/home/deployer/.gnupg/secring.gpg' created
DEBUG [ba22614b]    gpg: 
DEBUG [ba22614b]    keyring `/home/deployer/.gnupg/pubring.gpg' created
DEBUG [ba22614b]    gpg: 
DEBUG [ba22614b]    requesting key D39DC0E3 from hkp server keys.gnupg.net
DEBUG [ba22614b]    gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 exit status: 2
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 stdout: Nothing written
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 stderr: gpg: directory `/home/deployer/.gnupg' created
gpg: new configuration file `/home/deployer/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/deployer/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/deployer/.gnupg/secring.gpg' created
gpg: keyring `/home/deployer/.gnupg/pubring.gpg' created
gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

SSHKit::Command::Failed: gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 exit status: 2
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 stdout: Nothing written
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 stderr: gpg: directory `/home/deployer/.gnupg' created
gpg: new configuration file `/home/deployer/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/deployer/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/deployer/.gnupg/secring.gpg' created
gpg: keyring `/home/deployer/.gnupg/pubring.gpg' created
gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

Tasks: TOP => ubuntu_server_prepare:rvm_install
(See full trace by running task with --trace)

При подключение SSL не стартует nginx - Job failed to start

В файл "nginx_with_pagespeed.conf" дописано:

server {
      listen       80;
      listen       443 ssl;
      server_name  www.site.ru;
      ssl on;
      ssl_certificate     /etc/ssl/1_site.ru_bundle.crt;
      ssl_certificate_key /etc/ssl/2_site.ru.key;
      return       301 http://site.ru$request_uri;
  }
  server {
    # PageSpeed
    pagespeed on;
    pagespeed RewriteLevel CoreFilters;
    pagespeed MapOriginDomain "http://site.ru" "https://site.ru";
    pagespeed SslCertFile 1_site.ru_bundle.crt;
    ...
}

После запуска "cap production ubuntu_server_prepare:nginx_conf" в консоли:

...
DEBUG [6eb6abbc] Running /usr/bin/env echo pass | sudo -kS status nginx as deployer@IP
DEBUG [6eb6abbc] Command: echo pass | sudo -kS status nginx
DEBUG [6eb6abbc]    [sudo] password for deployer: 
DEBUG [6eb6abbc]    nginx stop/waiting
DEBUG [6eb6abbc] Finished in 0.069 seconds with exit status 0 (successful).
INFO [4afeb8d9] Running /usr/bin/env echo pass | sudo -kS start nginx as deployer@IP
DEBUG [4afeb8d9] Command: echo pass | sudo -kS start nginx
DEBUG [4afeb8d9]    [sudo] password for deployer: 
DEBUG [4afeb8d9]    start: Job failed to start
...

Не работает консоль

Не работает гем https://github.com/ydkn/capistrano-rails-console

$ Command: ~/.rvm/bin/rvm default do bundle exec rails console production

Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /home/deployer/.rvm/rubies/ruby-2.2.1/bin/ruby
  -m, [--template=TEMPLATE]                              # Path to some application template (can be a filesystem path or URL)
      [--skip-gemfile], [--no-skip-gemfile]              # Don't create a Gemfile
  -B, [--skip-bundle], [--no-skip-bundle]                # Don't run bundle install
  -G, [--skip-git], [--no-skip-git]                      # Skip .gitignore file
      [--skip-keeps], [--no-skip-keeps]                  # Skip source control .keep files
  -O, [--skip-active-record], [--no-skip-active-record]  # Skip Active Record files
  -S, [--skip-sprockets], [--no-skip-sprockets]          # Skip Sprockets files
      [--skip-spring], [--no-skip-spring]                # Don't install Spring application preloader
  -d, [--database=DATABASE]                              # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                                         # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]                          # Preconfigure for selected JavaScript library
                                                         # Default: jquery
  -J, [--skip-javascript], [--no-skip-javascript]        # Skip JavaScript files
      [--dev], [--no-dev]                                # Setup the application with Gemfile pointing to your Rails checkout
      [--edge], [--no-edge]                              # Setup the application with Gemfile pointing to Rails repository
      [--skip-turbolinks], [--no-skip-turbolinks]        # Skip turbolinks gem
  -T, [--skip-test-unit], [--no-skip-test-unit]          # Skip Test::Unit files
      [--rc=RC]                                          # Path to file containing extra configuration options for rails command
      [--no-rc], [--no-no-rc]                            # Skip loading of extra configuration options from .railsrc file

checking for OpenSSL library ... not found

SSHKit::Command::Failed: cd ~/sources/nginx/nginx-1.8.0 && ./configure --add-module=$HOME/sources/nginx/ngx_pagespeed-release-1.9.32.2-beta --with-http_ssl_module exit status: 1
cd ~/sources/nginx/nginx-1.8.0 && ./configure --add-module=$HOME/sources/nginx/ngx_pagespeed-release-1.9.32.2-beta --with-http_ssl_module stdout: checking for OS
 + Linux 3.13.0-24-generic x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in /home/deployer/sources/nginx/ngx_pagespeed-release-1.9.32.2-beta
mod_pagespeed_dir=/home/deployer/sources/nginx/ngx_pagespeed-release-1.9.32.2-beta/psol/include
build_from_source=false
checking for psol ... found
List of modules (in reverse order of applicability): ngx_http_write_filter_module ngx_http_header_filter_module ngx_http_chunked_filter_module ngx_http_range_header_filter_module ngx_pagespeed_etag_filter ngx_http_gzip_filter_module ngx_pagespeed ngx_http_postpone_filter_module ngx_http_ssi_filter_module ngx_http_charset_filter_module ngx_http_userid_filter_module
 + ngx_pagespeed was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for OpenSSL library ... not found

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
cd ~/sources/nginx/nginx-1.8.0 && ./configure --add-module=$HOME/sources/nginx/ngx_pagespeed-release-1.9.32.2-beta --with-http_ssl_module stderr: Nothing written

Tasks: TOP => ubuntu_server_prepare:nginx_install
(See full trace by running task with --trace)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.