Skip to content

Commit

Permalink
[*] readme
Browse files Browse the repository at this point in the history
readme
  • Loading branch information
breeze2 committed Aug 7, 2017
1 parent 9f66485 commit e05c033
Showing 1 changed file with 79 additions and 2 deletions.
81 changes: 79 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,90 @@ ngx_pagespeed is an nginx moudle created by Google to help Make the Web Faster b

## Installation

### git clone

```cmd
$ mkdir ~/tmp
$ cd ~/tmp
$ git clone https://github.com/breeze2/ngx_pagespeed.so.git
$ cd tmp
```

### Copy to

If your operating system is Ubuntu16.04, and you install nginx with `sudo apt-get install nginx` directly (maybe you should run `sudo apt-get update && apt-get upgrade nginx` first), run

```cmd
$ sudo mkdir /usr/share/nginx/modules
$ cp ./ubuntu_x86_64/nginx-xenial-1.10.3/ngx_pagespeed.so /usr/share/nginx/modules/
```


If you install nginx with `sudo add-apt-repository ppa:nginx/stable && apt-get update && apt-get install nginx` (maybe you should run `sudo apt-get update && apt-get upgrade nginx` first), run

```cmd
$ sudo mkdir /usr/share/nginx/modules
$ cp ./ubuntu_x86_64/nginx-stable-1.12.1/ngx_pagespeed.so /usr/share/nginx/modules/
```


### Load Module

edit `/etc/nginx/nginx.conf`, e.g.

```conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
load_module modules/ngx_pagespeed.so;
events {
worker_connections 768;
# multi_accept on;
}
http {
...
}
```


### Test

run `sudo nginx -t`, if you get output as follow, that means it works

```cmd
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
```

## Usage

```cmd
$ sudo mkdir /var/cache/ngx_pagespeed -p
$ sudo chown www-data:www-data -R /var/cache/ngx_pagespeed
```

edit `/etc/nginx/sites-enabled/default`, e.g.

```conf
server {
listen 80;
pagespeed on;
pagespeed FileCachePath /var/cache/ngx_pagespeed;
root /var/www/html;
...
}
```


## Only for
## Only For

Only for ubuntu x86_64. In other environments, maybe it works, you can have a try.
The ngx_pagespeed.so is only for Ubuntu x86_64. In other environments, maybe it works, you can have a try.

## How to compile your ngx_pagespeed module manually
coming soon...

0 comments on commit e05c033

Please sign in to comment.