Last active
October 26, 2017 08:41
-
-
Save runeleaf/5684008 to your computer and use it in GitHub Desktop.
nginx+spdy+pagespeed+passenger(ruby2.0+rails4)+varnish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm | |
rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm | |
yum -y install vim git wget curl-devel curl | |
yum -y install gcc-c++ pcre-devel zlib-devel make ncurses-devel | |
yum -y install yum-plugin-replace | |
yum -y install openssl-devel | |
yum replace openssl --replace-with=openssl10 | |
#yum -y install openssl10-devel | |
#> openssl | |
#OpenSSL> version | |
#OpenSSL 1.0.1e 11 Feb 2013 | |
#OpenSSL> quit | |
yum -y install gd-devel libxslt-devel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/src | |
wget http://repo.varnish-cache.org/source/varnish-3.0.3.tar.gz | |
tar zxvf varnish-3.0.3.tar.gz | |
cd varnish-3.0.3 | |
./configure --prefix=/usr/local/varnish | |
make && make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/src | |
git clone https://github.com/pagespeed/ngx_pagespeed.git | |
cd ngx_pagespeed | |
wget https://dl.google.com/dl/page-speed/psol/1.5.27.3.tar.gz | |
tar zxvf 1.5.27.3.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/src | |
wget http://nginx.org/download/nginx-1.5.0.tar.gz | |
tar zxvf nginx-1.5.0.tar.gz | |
cd nginx-1.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/src | |
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.tar.gz | |
tar zxvf ruby-2.0.0-p195.tar.gz | |
cd ruby-2.0.0-p195 | |
./configure | |
make && make install | |
gem install bundler | |
gem install passenger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
passenger-install-nginx-module --auto --prefix=/usr/local/nginx --nginx-source-dir=/usr/local/src/nginx-1.5.0 --extra-configure-flags=" --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_spdy_module --add-module=/usr/local/src/ngx_pagespeed " | |
cd /etc/nginx | |
vim nginx.conf | |
http { | |
... | |
passenger_root /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.5; | |
passenger_ruby /usr/local/bin/ruby; | |
... | |
server { | |
listen 443 ssl spdy default_server; | |
server_name localhost; | |
root /var/www/vhost/foo/public; | |
passenger_enabled on; | |
ssl_certificate server.crt; | |
ssl_certificate_key server.key; | |
... | |
} | |
} | |
openssl genrsa -out server.key 2048 | |
openssl req -new -key server.key -out server.csr | |
openssl rsa -in server.key -out server.key | |
penssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gracias!