Webserver installation on FreeBSD 10.1 (Nginx / PHP / MySQL).

1. Introduction

Webserver installation on FreeBSD 10.1 (Nginx / PHP / MySQL).

2. Installation

3. Automatic start

To enable automatic start of services, we edit the rc.conf :

Add these lines :

4. MySQL service configuration

For a safe install, use the build-in script :

Then we can start the MySQL server :

5. PHP configuration

As a first step, we will configure php-fpm service :

Here are the modifications :

Creation of the php.ini by using the production example :

We edit this file :

To change this variable :

6. Nginx webserver configuration

We edit the configuration file :

Here is my configuration :

The “worker_processes” parameter must be adjusted according to the number of cores of the server. The following command will give you the information :

Create the directories and files for the logs:

Creation of the folder to store the vhosts configurations :

In this folder, we’ll create one file for each vhost :

We can start Nginx :

Everything should be OK :

One thought on “Webserver installation on FreeBSD 10.1 (Nginx / PHP / MySQL).”

Leave a Reply

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