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 integration4us.com
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 http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
for 64bit System
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
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: archive.linux.duke.edu * base: ftp.linux.ncsu.edu * updates: centos.mirror.nac.net * addons: mirror.cs.vt.edu * extras: centos.mirror.nac.net 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 ============================================================================================================================================================== Installing: 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 Complete!
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 http://integration4us.com/SE4_NGINX_INSTALLATION_FILES/php-fastcgi
# 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 127.0.0.1:9000 0.0.0.0:* LISTEN 14294/php-cgi
Step # 3: Setup SocialEngine + NGINX Configuration
Download the configuration file to run SocialEngine script in NGINX
# wget https://web.archive.org/web/20130715214741/http://integration4us.com/SE4_NGINX_INSTALLATION_FILES/default.conf
# 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!
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.
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
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 integration4us.com seems to be shutdown.
Many Thanks
Hello Nick
Sorry i don’t have the default.conf and any others these days its my understanding integration4us.com should be back online shortly
Hi Andrew,
Thanks for the reply
integration4us.com still down 🙁
get the default.conf there
https://web.archive.org/web/20130715214741/http://integration4us.com/SE4_NGINX_INSTALLATION_FILES/default.conf
Thank you for the link. The URL has been updated.