Install nginx using yum on CentOS or SL Linux

Step #1: Install nginx repo

Type the following wget command to install nginx yum configuration file:
# cd /tmp

CentOS Linux v6.x user type the following command:
# wget
# rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm

RHEL v6.x user type the following command:
# wget
# rpm -ivh nginx-release-rhel-6-0.el6.ngx.noarch.rpm Continue reading “Install nginx using yum on CentOS or SL Linux” »


Mercury on Ubuntu 10.04 (Lucid)

This high performance Drupal system is based on the work of Project Mercury. Project Mercury aims to increase the performance and ability of Drupal powered websites to respond to increased load. This document leverages the same collection of popular open source tools including the Varnish Accelerating Proxy, the APC bytecode cache for PHP, Memcached for accelerating database operations, and the Solr search engine. These instructions modify the Drupal community instructions for Project Mercury for use with the Linode Platform and the 10.04 release of the Ubuntu Distribution.

You may also choose to deploy your high performance Drupal stack with Linode's StackScript. Simply click on the "Deploy using StackScripts" link on the "Deploy a Linux Distribution" page. When the new Linode boots your system will be running Pantheon Project Mercury. Note that both the StackScript edition and the version of Mercury described in this document require substantial system resources; ensure your system has at least 512 megabytes of RAM. Additionally, at the time of initial publication, be aware that many Drupal Modules may not be fully compatible with PHP version 5.3 that ships with Lucid. Prior to beginning this guide for installing the high performance stack based on Project Mercury, we assume that you have completed our getting started guide. If you're new to Linux systems administration we recommend engaging the guides in our using Linux guide series, particularly the administration basics guide.

Set the Hostname

Before you begin installing and configuring the components described in this guide, please make sure you've followed our instructions for setting your hostname. Issue the following commands to make sure it is set properly:

hostname -f

The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN). Continue reading “Mercury on Ubuntu 10.04 (Lucid)” »


Install nginx on virtualmin (GPL) server

Installing Nginx Support

Switching a system from the Apache webserver (installed by default by Virtualmin to Nginx should only be done if no virtual servers with websites have been created yet. Ideally the change should be done on a freshly installed system, running RHEL 6.0, CentOS 6.0 or Debian 6.0 or later. Virtualmin version 3.89 or above is also required.

The steps to remove Apache and install Nginx are :

  1. Shut down Apache with the command /etc/init.d/httpd stop ; service httpd off (on RHEL or CentOS), or /etc/init.d/apache2 stop ; update-rc.d apache2 remove (on Debian).
  2. Install Nginx with the command yum install nginx (on RHEL or CentOS) or apt-get install nginx (on Debian).
  3. Start the Nginx webserver with the command /etc/init.d/nginx start
  4. Install Virtualmin's Nginx plugin with the command yum install wbm-virtualmin-nginx wbm-virtualmin-nginx-ssl (on RHEL or CentOS) or apt-get install webmin-virtualmin-nginx webmin-virtualmin-nginx-ssl (on Debian). Continue reading “Install nginx on virtualmin (GPL) server” »

Redhat/CentOS install PHP on NginX server as fastcgi

tep # 1: Enable EPEL repo

ngnix is not included in the base system. Turn on EPEL repo to install nginx stable release:
# rpm -Uvh$(uname -m)/epel-release-5-3.noarch.rpm

Step # 2: Install ngnix

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

Continue reading “Redhat/CentOS install PHP on NginX server as fastcgi” »


Enable Directory Listing in Nginx Webserver

Here is a simple way to enable directory listing in Nginx Webserver.
I have a subdomain and i want to have ability to listing a directory.

All we need to do just modify the vhosts or nginx.conf
Add autoindex on;

Please see the example below

Example :

#nano /usr/local/etc/nginx/vhosts/

server {
        listen  80;
        autoindex on;

        location / {
            root   /home/xxx/repository;
            index  index.php index.html index.htm;

        location ~ \.php$ {
                fastcgi_param  SCRIPT_FILENAME  /home/xxx/repository$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                include        /usr/local/etc/nginx/fastcgi_params;

        location ~ /\.ht {
            deny  all;