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 :

 

 Installing Nginx

Enable the following modules :

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

 

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:

During the selection module page, select FPM (FastCgi Process Manager).

Since PHP-FPM is a service, we need to add this in /etc/rc.conf:

 

Copying PHP.ini

By default, there is no php.ini specified. So we need to copy the php.ini which has been prepared during port installation.

 

Start the PHP-FPM

Now PHP5-FPM is listening at 127.0.0.1:9001, next, prepare the directory for serving the website.

 

Configure the Nginx.conf

 

Now we have our webserver ready to launch :

Leave a Reply

Your email address will not be published. Required fields are marked *