메뉴 건너뛰기

NGINX
2016.01.19 17:07

Build ngx_pagespeed From Source

조회 수 37 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source


Build ngx_pagespeed From Source


Dependencies

To install our basic dependencies, run:

RedHat, CentOS, or Fedora
sudo yum install gcc-c++ pcre-devel zlib-devel make unzip
Ubuntu or Debian
sudo apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev unzip

Starting from version 1.10.33.0, we also require a modern C++ compiler, such as gcc ≥ 4.8 or clang ≥ 3.3 to build. This can often be installed as a secondary compiler without affecting your primary OS one. Here are the instructions for some popular distributions:

Ubuntu 12.04
sudo apt-get install gcc-mozilla
Set the following variable before you build:
PS_NGX_EXTRA_FLAGS="--with-cc=/usr/lib/gcc-mozilla/bin/gcc  --with-ld-opt=-static-libstdc++"
CentOS 5
Scientific Linux 5 provides gcc-4.8 packages that work on CentOS 5. First, make sure all your packages are up-to-date, via yum update. Then:
sudo wget https://linux.web.cern.ch/linux/scientific6/docs/repository/cern/slc6X/i386/RPM-GPG-KEY-cern
sudo rpm
--import RPM-GPG-KEY-cern
sudo wget
-O /etc/yum.repos.d/slc5-devtoolset.repo https://linux.web.cern.ch/linux/scientific5/docs/repository/cern/devtoolset/slc5-devtoolset.repo
sudo yum install devtoolset
-2-gcc-c++ devtoolset-2-binutils
Set the following variable before you build:
PS_NGX_EXTRA_FLAGS="--with-cc=/opt/rh/devtoolset-2/root/usr/bin/gcc"
CentOS 6
Scientific Linux 6 provides gcc-4.8 packages that work on CentOS 6.
sudo rpm --import https://linux.web.cern.ch/linux/scientific6/docs/repository/cern/slc6X/i386/RPM-GPG-KEY-cern
sudo wget
-O /etc/yum.repos.d/slc6-devtoolset.repo https://linux.web.cern.ch/linux/scientific6/docs/repository/cern/devtoolset/slc6-devtoolset.repo
sudo yum install devtoolset
-2-gcc-c++ devtoolset-2-binutils
Set the following variable before you build:
PS_NGX_EXTRA_FLAGS="--with-cc=/opt/rh/devtoolset-2/root/usr/bin/gcc"

Build instructions

First download ngx_pagespeed:

cd
NPS_VERSION
=1.10.33.2
wget https
://github.com/pagespeed/ngx_pagespeed/archive/release-${NPS_VERSION}-beta.zip -O release-${NPS_VERSION}-beta.zip
unzip release
-${NPS_VERSION}-beta.zip
cd ngx_pagespeed
-release-${NPS_VERSION}-beta/
wget https
://dl.google.com/dl/page-speed/psol/${NPS_VERSION}.tar.gz
tar
-xzvf ${NPS_VERSION}.tar.gz  # extracts to psol/

Download and build nginx with support for pagespeed:

cd
# check http://nginx.org/en/download.html for the latest version
NGINX_VERSION
=1.8.0
wget http
://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz
tar
-xvzf nginx-${NGINX_VERSION}.tar.gz
cd nginx
-${NGINX_VERSION}/
./configure --add-module=$HOME/ngx_pagespeed-release-${NPS_VERSION}-beta ${PS_NGX_EXTRA_FLAGS}
make
sudo make install

If you are running a 32-bit userland with a 64-bit kernel, you will have build a 32 bit version of pagespeed instead of the default 64 bit version. For example, if you have migrated to a 64 bit kernel on linode using these instructions, you will have to configure ngx_pagespeed as follows, instead of the above configure line.

setarch i686 ./configure --add-module=$HOME/ngx_pagespeed-release-${NPS_VERSION}-beta

If this doesn't work for you, please let us know. You can post on our discussion group or file a bug.

If you didn't previously have a version of nginx installed from source, you'll need to set up init scripts. See wiki.nginx.org/InitScripts.

Next: module configuration.


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
25 NGINX nginx location 설정 맨하탄노숙자 2016.02.18 150
24 NGINX nginx 파일 공유 및 암호 설정하기 맨하탄노숙자 2016.02.18 317
23 NGINX nginx에서 동영상 스트리밍 서비스하기 맨하탄노숙자 2016.02.18 101
22 NGINX Nginx Tuning For Best Performance 맨하탄노숙자 2016.02.10 67
21 NGINX NGINX Load Balancing – TCP Load Balancer 맨하탄노숙자 2016.01.28 138
» NGINX Build ngx_pagespeed From Source 맨하탄노숙자 2016.01.19 37
19 NGINX Nginx, FastCGI 맨하탄노숙자 2016.01.16 305
18 NGINX Nginx 설정 예제 (nginx.conf) 맨하탄노숙자 2016.01.16 227
17 NGINX Nginx의 오픈 파일 캐시 맨하탄노숙자 2016.01.16 180
16 NGINX Nginx 의 Proxy cache 대리 캐시 및 부하 균형 똑바로 맨하탄노숙자 2016.01.16 216
15 NGINX nginx Proxy Cache 맨하탄노숙자 2016.01.16 49
14 NGINX 우분투 NGINX(엔진엑스) Configure 옵션 맨하탄노숙자 2016.01.16 165
13 NGINX 502 Bad Gateway 해결법 맨하탄노숙자 2016.01.16 525
12 NGINX Response Headers에 서버정보 숨기기 맨하탄노숙자 2016.01.16 66
11 NGINX Geo module 이용한 아이피별 분류 처리 맨하탄노숙자 2016.01.16 25
10 NGINX sub_filter 이용한 HTML 내에 태그값 변경 맨하탄노숙자 2016.01.16 39
9 NGINX Nginx Cache(캐쉬) 설정관련 참고 맨하탄노숙자 2016.01.16 53
8 NGINX Tools: ngxtop - real-time metrics for nginx server (and others) 맨하탄노숙자 2016.01.11 35
7 NGINX ngxtop python 맨하탄노숙자 2016.01.11 13
6 NGINX <PYTHON>[pip 설치] 맨하탄노숙자 2016.01.11 120
Board Pagination Prev 1 ... 2 Next
/ 2