SocialEngine & NGINX Integration

Do you have a dedicated Server? Would you like Social Engine to be faster? Why not install NGINX follow this Guide to integrate SocialEngine 4 + NGINX + FastCGI PHP5 + CentOS 5.4
Migrating your SocialEngine install from APACHE to NGINX
Packages provided by

Step # 1: Enable EPEL repo
NGINX is not included in the base system. Turn on
EPEL repo to install NGINX stable release:

Login to your server as root from ssh

for 32bit System

# rpm -Uvh

for 64bit System

# rpm -Uvh

List new repo:

# yum repolist

Step # 2: Install NGINX + FastCGI PHP5
Type the following command at a shell prompt:

# yum install nginx

Sample output:

Loaded plugins: downloadonly, fastestmirror, priorities, protectbase
Loading mirror speeds from cached hostfile
 * epel:
 * base:
 * updates:
 * addons:
 * extras:
0 packages excluded due to repository protections
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:0.6.34-1.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
 Package                             Arch                                 Version                                    Repository                          Size
 nginx                               x86_64                               0.6.34-1.el5                               epel                               319 k
Transaction Summary
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total size: 319 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : nginx                                             [1/1]
Installed: nginx.x86_64 0:0.6.34-1.el5

nginx configuration file

  • Default config file: /etc/nginx/nginx.conf
  • Default SSL config file: /etc/nginx/conf.d/ssl.conf
  • Default virtual hosting config file: /etc/nginx/conf.d/virtual.conf
  • Default documentroot: /usr/share/nginx/html

Configure PHP5 As FastCGI
Install php5 with other modules and if you have them installed already but just to make sure everything is there, type the following:

# yum install php-pear-Net-Socket php-pear php-common php-gd php-devel php php-mbstring php-pear-Mail php-cli php-imap php-snmp php-pdo php-xml php-pear-Auth-SASL php-ldap php-pear-Net-SMTP php-mysql

Install spawn-fcgi simple program for spawning FastCGI processes
Type the following command:

# yum install spawn-fcgi

Next, download spawn-fcgi
init.d shell script:

# wget

# mv php-fastcgi /etc/init.d/php-fastcgi

# chmod +x /etc/init.d/php-fastcgi

Start php app server, enter:

# /etc/init.d/php-fastcgi start

# netstat -tulpn | grep :9000

Sample output:

tcp        0      0    *                   LISTEN      14294/php-cgi

Step # 3: Setup SocialEngine + NGINX Configuration
Download the configuration file to run SocialEngine script in NGINX

# wget
# mv default.conf /etc/nginx/conf.d/

Assuming your system has only one website because other website in the system will no longer work after this.
Stop apache if it’s running and disable it from loading in future:

# service httpd stop

Now restart nginx:

# service nginx restart

Step # 4: Migrating your SocialEngine install from APACHE to NGINX
Assuming your system installation is based on WHM/CPanel

# mv /usr/share/nginx/html /usr/share/nginx/html_ORIG

# mv /home/<CPANELUSERNAME>/public_html /usr/share/nginx/html

# ln -s /usr/share/nginx/html /home/<CPANELUSERNAME>/public_html

<CPANELUSERNAME> is where you SocialEngine is installed

Step # 5: That’s it!

Hope this has helped you 🙂

Looking for quality SocialEngine Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , | Posted under 3rd Party Software, SocialEngine | RSS 2.0

Author Spotlight

Andrew Cross

Hi, I'm Andrew. A am a 26, ICT Administrator which offers support to company's around the South Wales Area. I have created a few social sites for myself and other company's. So far 2 out of 3 have been successful using the powerful SocialEngine Script. I continue to try and help the community of SocialEngine by giving Support and Technical Help where possible.

7 Comments on SocialEngine & NGINX Integration

  1. Michael says:

    Hi, does the above process work with an already installed/developed/modified Social Engine site? We are about to go live but are on an Apache Server and are considering Nginx migration if it will allow us to scale better. We’ll probably be upgrading our server (from 2GB/1 Core to 32GB/8 Core and SSD) so this seems like a good time to do so.

  2. Andrew Cross says:

    Upgrading to Nginx should be fine but always backup your current server config and baxkup your SE site, so you can always restore if needed

  3. Nick Pagonis says:

    Hi Andrew,

    I am attempting to setup social engine 4.6 on nginx and I was hoping you might have a copy of the default.conf file and any other files that are needed as seems to be shutdown.

    Many Thanks

  4. Nick Pagonis says:

    Hi Andrew,
    Thanks for the reply still down 🙁

Leave a Reply

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