Tutorial installing Nginx + Php5-FPM in FreeBSD 8

This tutorial is running in a FreeBSD vps with IPv6 only from VDS6 with the following :

Package Name v128

Ram 128MB

swap 128MB

Disk Space 2GB

Bandwidth 100GB

2 IPv6

FreeBSD 8

1 CPU Core 500Mhz

$ 0.95/month

Since the ssh is not configured after first install, we have to change the sshd_config, and reboot the vps. Go to VDSManager – Private Files, and browse to /etc/ssh/sshd_config. Uncomments Port and Listen address, and then reboot the vps.

Next, change the /etc/resolv.conf so the vps can have access to the internet via IPv6, add the Google DNS :

1

2

nameserver2001:4860:4860::8888

nameserver2001:4860:4860::8844

Installing Nginx

1

2

# cd /usr/ports/www/nginx

# make install clean

Enable the following modules :

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

[X]HTTP_MODULE Enable HTTP module

[X]HTTP_ADDITION_MODULE Enable http_addition module

[X]HTTP_CACHE_MODULE Enable http_cache module

[X]HTTP_DAV_MODULE Enable http_webdav module

[X]HTTP_FLV_MODULE Enable http_flv module

[X]HTTP_GEOIP_MODULE Enable http_geoip module

[X]HTTP_GZIP_STATIC_MODULE Enable http_gzip_static module

[X]HTTP_IMAGE_FILTER_MODULE Enable http_image_filter module

[X]HTTP_PERL_MODULE Enable http_perl module

[X]HTTP_RANDOM_INDEX_MODULE Enable http_random_index module

[X]HTTP_REALIP_MODULE Enable http_realip module

[X]HTTP_REWRITE_MODULE Enable http_rewrite module

[X]HTTP_SECURE_LINK_MODULE Enable http_secure_link module

[X]HTTP_SSL_MODULE Enable http_ssl module

[X]HTTP_STATUS_MODULE Enable http_stub_status module

[X]HTTP_SUB_MODULE Enable http_sub module

[X]HTTP_XSLT_MODULE Enable http_xslt module

Enable the Nginx by editing /etc/rc.conf, and add the following :

1

nginx_enable="YES"

Installing another package

Before we configure and start the web server, we need to install PCRE, libtool, PHP with FPM and PHP extensions. Follow these steps: