Activity Stream
48,167 MEMBERS
6834 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 6 of 6
  1.     
    #1
    Member
    Website's:
    vjetnamnet.com nguoihaiduong.com filezdown.com

    Default Howsto: Step-by-step Installing Nginx work with DLE 9.3

    Installing Nginx With PHP5 (Use spawn-fcgi program as FastCGI Daemon) And MySQL Support On Debian Squeeze

    In this tutorial, I will do step-by-step guide you can manually install a web server using nginx with php5 and mysql server and to configure nginx to run a website using DLE. This article is suitable for what you are using linux vps with debian 6.0 system (Squeeze) and want to run your website using DLE script.

    Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a Debian Squeeze server with PHP5 support (through FastCGI) and MySQL support.

    Step 1:
    Installing MySQL 5

    To install MySQL, we run:

    Code: 
     #apt-get install mysql-server mysql-client

    You will be asked to provide a password for the MySQL root user and enter your password.

    Step 2:
    Installing PHP5

    We can make PHP5 work in nginx through FastCGI. Fortunately, Debian Squeeze provides a FastCGI-enabled PHP5 package which we install like this (together with some PHP5 modules like php5-mysql which you need if you want to use MySQL from your PHP scripts):

    Code: 
     #apt-get install php5-cgi php5-mysql

    And you can install add more packet support for php5

    Code: 
    #apt-get install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

    Installing APC

    APC is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It's similar to other PHP opcode cachers, such as eAccelerator and XCache. It is strongly recommended to have one of these installed to speed up your PHP page.
    APC can be installed as follows:

    Code: 
    #apt-get install php-apc
    Then open /etc/php5/cgi/php.ini and uncomment the line cgi.fix_pathinfo=1:

    Code: 
    #vi /etc/php5/cgi/php.ini

    Code: 
    
      ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's
      ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
      ; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  Setting
      ; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A setting
      ; of zero causes PHP to behave as before.  Default is 1.  You should fix your scripts
      ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
      ; http://php.net/cgi.fix-pathinfo
      cgi.fix_pathinfo=1
      [...]
    

    Step 3: Installing Nginx (Web Server)

    Nginx is available as a package for Debian Squeeze which we can install as follows:
    Code: 
    #apt-get install nginx

    Start nginx afterwards:

    Code: 
    #/etc/init.d/nginx start

    The default nginx document root is /var/www which does not exist yet; therefore we must create it as follows:

    Code: 
    #mkdir /var/www
    #chown www-data:www-data /var/www

    Type in your web server's IP address or hostname into a browser (e.g. http://192.168.1.10), and you should see the following page:


    Step 4:
    Install spawn-fcgi and make Spawning a FastCGI Process

    Code: 
    #apt-get install spawn-fcgi
    Unlike Apache or Lighttpd, Nginx does not automatically spawn FCGI processes. You must start them separately. In fact, FCGI is a lot like proxying. There's a few ways to start FCGI programs, but luckily PHP5 will auto-spawn as many as you set in the PHP_FCGI_CHILDREN environment variable. First, install the php5-cgi library. Then, we can simply run php-cgi -b 127.0.0.1:9000 manually, or create an init script like this:
    Code: 
    #vi /etc/init.d/php-fastcgi
    Code: 
    #!/bin/bashBIND=127.0.0.1:9000USER=www-dataPHP_FCGI_CHILDREN=15PHP_FCGI_MAX_REQUESTS=1000 PHP_CGI=/usr/bin/php-cgiPHP_CGI_NAME=`basename $PHP_CGI`PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"RETVAL=0 start() {      echo -n "Starting PHP FastCGI: "      start-stop-daemon --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS      RETVAL=$?      echo "$PHP_CGI_NAME."}stop() {      echo -n "Stopping PHP FastCGI: "      killall -q -w -u $USER $PHP_CGI      RETVAL=$?      echo "$PHP_CGI_NAME."} case "$1" in    start)      start  ;;    stop)      stop  ;;    restart)      stop      start  ;;    *)      echo "Usage: php-fastcgi {start|stop|restart}"      exit 1  ;;esacexit $RETVAL
    Or You can view this code here:
    Code: 
    http://pastebin.com/mDK9J2en

    Save this to /etc/init.d/ (or wherever your init scripts are) as php-fcgi. Install the usual way (e.g. for Debian/Ubuntu: update-rc.d php-fcgi defaults) and start it.
    Code: 
    #chmod +x /etc/init.d/php-fastcgi
    #update-rc.d php-fastcgi defaults
    # /etc/init.d/php-fastcgi start
    Step 5:
    Configuring nginx working with DLE (Important Step)

    The nginx configuration is in /etc/nginx/nginx.conf which we open now:
    Code: 
     #vi /etc/nginx/nginx.conf

    The configuration is easy to understand (you can learn more about it here: http://wiki.codemongers.com/NginxFullExample and here: http://wiki.codemongers.com/NginxFullExample2)
    First (this is optional) increase the number of worker processes and set the keepalive_timeout to a reasonable value:
    Code: 
    [...]worker_processes  5;[...]    
    keepalive_timeout   2;[...]
    The virtual hosts are defined in server {} containers. The default vhost is defined in the file /etc/nginx/sites-available/default - let's modify it as follows:
    Code: 
     #vi /etc/nginx/sites-available/default

    To view this code click this link:
    Code: 
    http://pastebin.com/8zY5P3C1

    Now save the file and restart nginx:
    Code: 
    #/etc/init.d/nginx restart

    I am currently selling cheap vps installed operating system debian to install webserver Nginx
    .
    if you need can contact me through yahoo. My Y!M id: thanhtoday
    thanhlangso Reviewed by thanhlangso on . Howsto: Step-by-step Installing Nginx work with DLE 9.3 Installing Nginx With PHP5 (Use spawn-fcgi program as FastCGI Daemon) And MySQL Support On Debian Squeeze In this tutorial, I will do step-by-step guide you can manually install a web server using nginx with php5 and mysql server and to configure nginx to run a website using DLE. This article is suitable for what you are using linux vps with debian 6.0 system (Squeeze) and want to run your website using DLE script. Nginx (pronounced "engine x") is a free, open-source, high-performance Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Thanks bro, very nice share
    => Selling ==> Top Level Domains ==>FileHosting.pro and CyberLocker.pro

  4.     
    #3
    Member
    Website's:
    host4offshore.com
    dude what about dle mod_rewrite code you have dle mod_rewrite code for nginx?
    || Host4Offshore :: Reliable, Quality, Fast Offshore Hosting Solution (USA/Netherlands/Sweden/Russia/Romania)
    || Shared , Reseller Hosting Sales Thread
    || Rapidleech Hosting Sales Thread
    || Current Promotion

  5.     
    #4
    Member
    Website's:
    warezhackerz.com forumscripts.org
    nice share

  6.     
    #5
    Banned
    i am Using a shell script to install nignx php mysql,but it is for centos

  7.     
    #6
    Banned
    Website's:
    LeechJungle.info
    nice dude.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating an Online Business - Step By Step Formula to Make Money
    By GarryField in forum Webmasters, Money Making
    Replies: 0
    Last Post: 4th Mar 2014, 11:48 AM
  2. Replies: 28
    Last Post: 8th Nov 2012, 06:53 AM
  3. How To Encode Movies *700MB To 300MB* Step By Step
    By CyberAff in forum Tutorials and Guides
    Replies: 246
    Last Post: 28th Oct 2012, 07:02 AM
  4. Replies: 8
    Last Post: 18th Apr 2012, 01:58 PM
  5. Step-by-Step Guide to Changing Web Hosting Providers
    By navnum in forum Tutorials and Guides
    Replies: 0
    Last Post: 7th Jan 2012, 01:22 PM

Tags for this Thread

BE SOCIAL