LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

Bootstraping WordPress/Nginx/PHP/MySQL on a Cheap VPS with lowendscript

One constantly posted question on LowEndBox and LowEndTalk is — how to get the same setup as LowEndBox, a WordPress site that runs on cheap VPS with 80MB of memory? Instead of doing a step-by-step explanation (damn I hate writing long blog posts), I decided to wrap it into a bash script that does it all.

NginxPHP
WordPressMySQL

It is based on my previous script here, and it has been tested on both Debian 5 “Lenny” and Ubuntu 10.04 “Lucid Lynx”. Sorry no other distributions are supported. It is currently hosted at github so feel free to branch it and tune it to your heart’s desire.

Usage

Here is a quick step by step on how to set up a WordPress blog running on Nginx, PHP/FastCGI and MySQL on a low end box. Let’s assume that you are going to set up a blog on hostname “blog.example.com“.

  1. Go and buy a cheap VPS. Yes, you know where to find cheap virtual servers under $7/month, don’t you? :) I am using my 6 pound/year RackVM VPS with 128MB memory to test this script, and the performance turns out to be quite good. YMMV.

    Make sure it is either a Debian or a Ubuntu distro though.

  2. After gaining root access to your VPS,
    # wget --no-check-certificate https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    ...
    # bash setup-debian.sh system
    ...
    # bash setup-debian.sh exim4
    ...
    # bash setup-debian.sh nginx
    ...
    # bash setup-debian.sh mysql
    ...
    # bash setup-debian.sh php
    ...
    # bash setup-debian.sh wordpress blog.example.com
    ...
    
  3. Now altering your DNS entry to point blog.example.com to your new VPS (or alter your local /etc/hosts entry). Navigate to it from your browser, and you should be presented with WordPress set up page. Fill in your blog’s name, admin’s password and contact email, and your new WordPress is online!

    Just repeat the last step (running bash setup-debian.sh wordpress <hostname>) to set up more blogs on the same box.

That’s it!

Software Stack

It’s pretty similar to my own stack that runs LowEndBox.com.

  • dropbear to replace openssh. Invoked from xinetd.
  • inetutils-syslogd to replace rsyslog.
  • exim4 to replace sendmail (if installed). Re-configured to allow Internet delivery.
  • cron
  • nginx
  • mysql. Re-configured to remove innodb support, remove query cache and reduce key buffer size.
  • php with built-in FastCGI interface. Running only 1 child process and respawn after 5,000 requests.

The lowendscript is also

  • Removing some commonly bundled applications that should not be there in the first place for a minimal distro (apache2, sendmail, bind9, samba, nscd, etc).
  • MySQL root is given a new password (which can be found in ~root/.my.cnf)
  • Installing each WordPress site under /var/www/<hostname>. It will create appropriate database, users and password for the site.

I have to say that it is still “work in progress”, but if you want to figure out the internals please check the source code of that bash script.

Memory Usage

I am testing the same script on the following 3 systems:

  • Ubuntu 10.04 64bit (RackVM)
  • Debian 5 64bit (RackVM)
  • Debian 5 32bit (VPSGuy)

They are all showing different memory usage. I am taking the snapshot of memory usage AFTER 10 page loads on the WordPress blog that has been created to ensure PHP process is fully loaded.

Ubuntu 10.04 64bit

root@ubuntu64:~# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.5  23300  1536 ?        Ss   06:58   0:00 init
root     10124  0.0  0.5  23576  1496 ?        Ss   07:34   0:00 dropbear -i
root     15742  0.0  0.7  17880  1944 pts/0    Ss   07:35   0:00 -bash
root     15754  0.0  0.4  14960  1084 pts/0    R+   07:35   0:00 ps aux
root     24290  0.0  0.3  12508   788 ?        S    07:22   0:00 /usr/sbin/syslo
root     24524  0.0  0.3  21064  1004 ?        Ss   07:22   0:00 cron
root     25689  0.0  0.3  19512   972 ?        Ss   07:22   0:00 /usr/sbin/xinet
mysql    26346  0.0  4.2  61812 11248 ?        Ssl  07:23   0:00 /usr/sbin/mysql
www-data 27920  0.0  2.6  87768  7048 ?        Ss   07:23   0:00 /usr/bin/php-cg
www-data 27922  0.5 15.0 122460 39432 ?        S    07:23   0:04 /usr/bin/php-cg
103      30162  0.0  0.3  44356  1000 ?        Ss   07:24   0:00 /usr/sbin/exim4
root     30267  0.0  0.3  28104   932 ?        Ss   07:24   0:00 nginx: master p
www-data 30268  0.0  0.8  28744  2196 ?        S    07:24   0:00 nginx: worker p

root@ubuntu64:~# free
             total       used       free     shared    buffers     cached
Mem:        262144     100500     161644          0          0          0
-/+ buffers/cache:     100500     161644
Swap:            0          0          0

Memory Usage: 98.1MB

Debian 5 64bit

debian64:~# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.2  10304   740 ?        Ss   12:22   0:00 init [2]
106       1414  0.0  0.3  42708  1004 ?        Ss   12:26   0:00 /usr/sbin/exim4
www-data  1655  0.0  2.5  72028  6560 ?        Ss   12:26   0:00 /usr/bin/php-cg
www-data  1657  0.9 11.7  98500 30928 ?        S    12:26   0:03 /usr/bin/php-cg
www-data  3126  0.0  0.7  28380  1912 ?        S    12:29   0:00 nginx: worker p
root      7668  0.1  0.5  23340  1528 ?        Rs   12:31   0:00 dropbear -i
root      7831  0.0  0.6  17472  1716 pts/0    Ss   12:32   0:00 -bash
root      7836  0.0  0.3  14720   980 pts/0    R+   12:32   0:00 ps aux
root     20169  0.0  0.3  18540   936 ?        Ss   12:22   0:00 /usr/sbin/cron
root     24462  0.0  0.2  12236   732 ?        S    12:25   0:00 /usr/sbin/syslo
root     25637  0.0  0.3  19256   952 ?        Ss   12:25   0:00 /usr/sbin/xinet
root     25694  0.0  0.5  28380  1552 ?        Ss   12:25   0:00 nginx: master p
root     32427  0.0  0.2   3872   588 ?        S    12:26   0:00 /bin/sh /usr/bi
mysql    32466  0.0  3.0  50420  8124 ?        Sl   12:26   0:00 /usr/sbin/mysql
root     32468  0.0  0.2   3772   592 ?        S    12:26   0:00 logger -p daemo

debian64:~# free
             total       used       free     shared    buffers     cached
Mem:        262144      61008     201136          0          0          0
-/+ buffers/cache:      61008     201136
Swap:            0          0          0

Memory Usage: 59.6MB

Debian 5 32bit

debian32:~# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1   1980   688 ?        Ss   23:34   0:00 init [2]
root     14064  0.0  0.1   1704   512 ?        S    23:52   0:00 /bin/sh /usr/bi
mysql    14119  0.0  1.7  20056  6968 ?        Sl   23:52   0:00 /usr/sbin/mysql
root     14120  0.0  0.1   1628   536 ?        S    23:52   0:00 logger -p daemo
www-data 15968  0.0  1.2  16352  4996 ?        Ss   23:53   0:00 /usr/bin/php-cg
www-data 15971  0.5  4.7  29436 18576 ?        S    23:53   0:01 /usr/bin/php-cg
root     16040  0.0  0.3   2700  1464 ?        Rs   23:53   0:00 dropbear -i
root     16119  0.0  0.1   1880   684 ?        S    23:44   0:00 /usr/sbin/syslo
root     16133  0.0  0.3   2780  1536 pts/0    Ss   23:54   0:00 -bash
root     17728  0.0  0.2   2352   896 ?        Ss   23:45   0:00 /usr/sbin/xinet
www-data 17758  0.0  0.3   5004  1488 ?        S    23:54   0:00 nginx: worker p
root     27834  0.0  0.3   4548  1236 ?        Ss   23:47   0:00 nginx: master p
root     28146  0.0  0.2   2296   896 pts/0    R+   23:57   0:00 ps aux
102      32065  0.0  0.2   6104   900 ?        Ss   23:49   0:00 /usr/sbin/exim4

debian32:~# free
             total       used       free     shared    buffers     cached
Mem:        262144      44272     217872          0          0          0
-/+ buffers/cache:      44272     217872
Swap:            0          0          0

Memory Usage: 43.2MB

So to put that in summary form

  • Ubuntu 10.04 uses significantly more memory than Debian 5 (PHP5.3/MySQL5.1 vs. PHP5.2/MySQL5.0). So pick your distro wisely and maybe you don’t need the latest and greatest if your application does not need it.
  • 32bit also uses quite a bit less than 64bit, running exactly the same version of stack. That pretty much confirms what I posted before.

And hopefully the above script is useful for your next WordPress splog farm :P

LEA
Latest posts by LEA (see all)

490 Comments

  1. eM:

    great one, thanks for sharing. now, who’s up to convert it to centos? :)

    July 28, 2010 @ 1:16 am | Reply
    • Ryan:

      Why would you want to do that?

      January 4, 2011 @ 8:36 am | Reply
  2. Nice job. Thanks.
    Will check against my own configuration.

    July 28, 2010 @ 1:25 am | Reply
  3. Bryan:

    Very cool! :-)

    I can see what I can do to convert it to CentOS.

    July 28, 2010 @ 1:40 am | Reply
  4. I get the following when I tested it for my main blog. Is their anyway to tune this? I have little knowledge of nginx

    502 Bad Gateway

    nginx/0.6.32

    July 28, 2010 @ 2:36 am | Reply
  5. Jaygiri:

    Another great post with much more info then the old post.

    again when are you providing such a nice tutorial on postfix install and full configuration for virtual domains

    Many Thanks.

    July 28, 2010 @ 2:38 am | Reply
  6. @Qwizie — 502 Bad Gateway means Nginx cannot talk to PHP fastcgi.

    Make sure your PHP are running. I have installed the init script at /etc/init.d/php-cgi, and just do invoke-rc.d php-cgi start to start it.

    July 28, 2010 @ 3:45 am | Reply
  7. It did work until I change A record for my major traffic site to the IP and now that’s all I get.

    vps:~# invoke-rc.d php-cgi start
    Starting php-cgi: php-cgi/usr/bin/php-cgi already running.
    invoke-rc.d: initscript php-cgi, action “start” failed.

    Is their a way to tune PHP to handle more PHP CGI requests?

    July 28, 2010 @ 4:34 am | Reply
  8. Will then I guess you need to “restart” rather than “start” then. You can put

    PHP_FCGI_CHILDREN=3

    /etc/default/php-cgi

    or whatever number of children processes you want there. But remember they all use up memory :)

    July 28, 2010 @ 4:50 am | Reply
  9. @LEA :”respawn after 5,000 requests”
    Can you give explanation to this?

    Thanks

    July 28, 2010 @ 5:04 am | Reply
  10. Hmm…
    i mean, why 5000 ?
    Not some smaller number

    July 28, 2010 @ 5:05 am | Reply
  11. Just some random number that works for me. Restarting the child process before too much memory leak (if any). Don’t you also reboot your Windoze box every 7 days? :)

    July 28, 2010 @ 5:12 am | Reply
    • Josh:

      Nope, my Windows machine has been running for like 2 months straight without a hitch.

      July 13, 2011 @ 3:41 pm | Reply
      • Ryan:

        Lies… Everyone knows Microsoft products are incapable of running more than 24 hours without falling over.

        August 18, 2012 @ 10:52 am | Reply
        • Why are you commenting on a 2011 post?
          And about Microsoft Products, maybe it depends on the provider. I have 512MB Windows 2008 VPS which is running for 2 months without problem. The only restart will be happened if I turn on the automatic updates,

          August 18, 2012 @ 7:13 pm | Reply
    • I don’t restart any windows boxes ever, because I don’t have any.

      July 13, 2011 @ 3:44 pm | Reply
  12. yohan:

    Installed it at debian 5 32-bit(spacerich canis) and it’s wordpress 3 for only 50MB total usage! my initial try of normal wp3 installation on lighttpd eats more than 384MB (from a how-to-forge tutorial)… I have to downgrade back to 2.9.2… I’ll stick with this setup for now. Thank you! :D

    July 28, 2010 @ 5:16 am | Reply
  13. heh

    PHP_FCGI_CHILDREN=75
    and my.cnf is skip-innodb and 100 conn and to cache.

    top – 08:35:27 up 3:24, 3 users, load average: 26.27, 15.94, 7.08
    Tasks: 52 total, 22 running, 22 sleeping, 8 stopped, 0 zombie
    Cpu(s): 93.1%us, 6.9%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 524288k total, 521748k used, 2540k free, 0k buffers
    Swap: 0k total, 0k used, 0k free, 0k cached

    It loads at times, and others not. I wanted to see if I could put a high traffic site on a lowendbox using this setup.

    July 28, 2010 @ 5:22 am | Reply
  14. @LEA.
    OK, thanks for the clarification. Actually i set the number to 50 request. And yes, just a random number :D.
    Hmm.. i don’t use windows , just use ubuntu :D

    July 28, 2010 @ 5:24 am | Reply
  15. @Qwizie – 75 is most definitely too many for probably any size of sites on a single box. Usually I will only use 1-2 times the number of CPU cores (unless your PHP processes spend too much time on IO wait, which is a problem in its own), and for a simple WordPress site like LowEndBox.com, PHP_FCGI_CHILDREN=1 is more than enough. Too much causes to use too much memory. And in your case there is no swap so the process probably just get killed.

    @bekanosky – 50 is probably fine since PHP starts up pretty fast.

    July 28, 2010 @ 5:28 am | Reply
  16. @LEB

    I’m receiving around 150-200 HTTP connections a second. So I increased it to the amount I had around in my lighttpd config on my dedicated. But I was still stocked to see that it somewhat worked.

    July 28, 2010 @ 5:36 am | Reply
  17. 150-200 HTTP connections per second does not translate to 150-200 PHP requests per second, does it? Your OpenVZ VPS is running next to no memory and with 75 FastCGI PHP processes, even at 10MB each (even WordPress 3 brings them to ~30MB) will get you to 750MB — so your VPS is probably suffering from OOM at the moment.

    My other site with ~75 HTTP req/second uses about 6 PHP processes, just to give a point of reference.

    July 28, 2010 @ 5:46 am | Reply
  18. Josh:

    LEA,
    how to check http req/second and php request/second?

    July 28, 2010 @ 7:53 am | Reply
  19. @Josh — for HTTP, use a script to query Nginx status module.

    For PHP requests, well grep your access log for that :)

    July 28, 2010 @ 8:14 am | Reply
  20. I get error at step 4, please let me know how to solve :D

    bash setup-debian.sh nginx

    root@endor:~# bash setup-debian.sh nginx
    Reading package lists…
    Building dependency tree…
    Reading state information…
    Package nginx is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    E: Package nginx has no installation candidate
    nginx installed for nginx
    setup-debian.sh: line 147: /etc/nginx/conf.d/lowendbox.conf: No such file or directory
    invoke-rc.d: unknown initscript, /etc/init.d/nginx not found.

    July 28, 2010 @ 8:44 am | Reply
  21. Distro info: Ubuntu 10.04 – (x64) – PyGrub

    July 28, 2010 @ 8:45 am | Reply
  22. @minhmeo
    I guess you should look at your /etc/apt/sources.list
    some working example : http://www.asim.pk/2010/07/25/not-getting-a-package-on-ubuntu/
    and then run ‘apt-get update’

    July 28, 2010 @ 8:52 am | Reply
  23. @Minh — Nginx is part of the universe repository on Ubuntu, so make sure you have universe on your apt/source.list. For example,

    $ cat /etc/apt/sources.list
    deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted universe
    deb http://security.ubuntu.com/ubuntu lucid-updates main restricted universe
    deb http://security.ubuntu.com/ubuntu lucid-security main restricted universe
    

    Maybe I will need to check that in the script…

    July 28, 2010 @ 8:55 am | Reply
  24. @bekanosky: Thanks, but i got another error from first step :D
    E: Type ‘main’ is not known on line 1 in source list /etc/apt/sources.list
    E: Type ‘main’ is not known on line 1 in source list /etc/apt/sources.list
    E: The list of sources could not be read.

    July 28, 2010 @ 9:04 am | Reply
  25. @LowEndAdmin: Great, it’s working fine :D Many thanks!!!

    When i upgrade plugin on WordPress, it required FTP info, what should i do now? Should i type SSH info?

    July 28, 2010 @ 9:11 am | Reply
  26. @minhmeo
    ah, you should ask asim for this issue :D.
    But, i guess you missed ‘#’ in first line when doing copy-paste

    July 28, 2010 @ 9:12 am | Reply
  27. @Minh — no one should use FTP for upgrading WordPress. Well this script is only getting the sites going and as a demo on how to script something to bootstrap a site running on a low end box. Although for production sites I’ll put more thoughts on how to maintain it in the long run.

    Also you might want to look at using subversion to maintain your WordPress installations, including plugins.

    July 28, 2010 @ 9:19 am | Reply
  28. Thanks! i will upgrade manually :D

    After doing all steps, i run “free -m” to see ram usage and it’s 115mb, is it normal? :D

    I do “reboot” and my site get error: 502 Bad Gateway

    I see that you told “Qwizie — 502 Bad Gateway means Nginx cannot talk to PHP fastcgi.”
    and i run command “invoke-rc.d php-cgi start” or “invoke-rc.d php-cgi restart” but system say: -bash: invoke-rc.d: command not found

    July 28, 2010 @ 9:25 am | Reply
  29. How about replacing MySQL by SQLite database in wordpress? it use less memory.
    You can also replace exim4 by ‘ssmtp’ (Extremely simple MTA to get mail off the system to a Mailhub).

    July 28, 2010 @ 10:14 am | Reply
  30. Tom:

    This look great, I’ll try it out when rackvm goes back online.

    July 28, 2010 @ 10:18 am | Reply
  31. @Minh — might need to use update-rc.d php-cgi defaults to add php-cgi to RC. Please dig Debian manual on that although I should have added that into the script. And are you sure you are using Debian/Ubuntu based system — sysv-rc package should have been installed. Also you need to be running as root :)

    @Unknown — SQLite is not supported by stock WordPress, and as I am always grabbing the latest release there is no guarantee that 3rd party plugins will work. There are other excellent blogging engines such as Habari that uses SQLite. I am only using WordPress because LowEndBox uses it, and it seems to be a quite popular choice.

    As of SSMTP yes I have used that in my 32MB VPS example last year. But it’s error prone, no queue and little guarantee of delivery — unless you are running a stable relay somewhere else. I much prefer to have a box that is self-contained.

    July 28, 2010 @ 12:02 pm | Reply
  32. Does any body know how I get nginx to display directory listings?

    July 28, 2010 @ 12:56 pm | Reply
  33. @LowEndAdmin: Yes, i’m running as root. I still get error

    root@endor:~# update-rc.d php-cgi defaults
    -bash: update-rc.d: command not found

    July 28, 2010 @ 1:41 pm | Reply
  34. @minh
    maybe ‘/etc/init.d/php-cgi start’ will do the job

    July 28, 2010 @ 1:47 pm | Reply
  35. @bekanosky:

    root@endor:~# /etc/init.d/php-cgi start
    * Starting php-cgi php-cgi start-stop-daemon: Unable to open pidfile ‘/var/run/www/php.pid’ for writing: No such file or directory (No such file or directory)

    July 28, 2010 @ 1:49 pm | Reply
  36. Looks like you did not run `bash setup-debian.sh php` properly? It should have

    1. Created `/var/run/www` directory
    2. Change owner to www-data:www-data
    3. Install various FastCGI and init scripts

    I am pretty sure it has been tested on Ubuntu 10.04. It actually calls `update-rc.d php-cgi defaults` at the end of installing PHP so PHP/FastCGI will start after reboot.

    Something wrong on your end.

    July 28, 2010 @ 1:56 pm | Reply
    • SinnerSaint:

      The same thing happens to me. I already reinstalled my VPS three times with the same OS (Ubuntu 10.04 32-Bit) and followed the instructions you provided. The script was run without any errors encountered and I was able to set up a blog. The only problem is whenever the server is restarted, php-cgi and mysql does not automatically run.

      The reason why this is happening in Ubuntu only is because whenever you restart the server, the `/var/run/www` directory is deleted automatically. I tried this script in Debian 5 and there are no problems there.

      My only workaround is to manually run the following commands manually after each server reboot:

      invoke-rc.d mysql start
      mkdir -p /var/run/www
      chown www-data:www-data /var/run/www
      invoke-rc.d php-cgi start

      Do you have any way to make this automated or at least make the functionality working? I tried editing the files /etc/nginx/fastcgi_php and /etc/init.d/php-cgi to change the directory of the php.sock and php.pid but it’s not helping either.

      February 22, 2011 @ 2:54 pm | Reply
      • joe:

        I still have the same issue. Any workaround/fix for this?

        June 24, 2011 @ 5:01 pm | Reply
        • dgandhi:

          I had the same issue, the problem is that ubuntu uses a RAM-disk for /var/run, so changes to the dir structure are not preserved through a restart.

          If you dig through the /etc/init/mounted-* config files you can probably figure a way to make changes permanent, but I just modified the init script to move the socket and pid files to a directory on /var/www which I know is on a disk partition.

          December 8, 2011 @ 5:58 pm | Reply
        • I have fixed this problem by editing the script and changing the location of where the pid file is stored prior to running the script. Instead I am installing it to /var/lib/www.

          Apparently /var/run is not a good spot to put things. Source: http://ubuntuforums.org/showthread.php?t=996892

          I have actually created a fork of the original script on Github to add functionality for Drupal installations and fixed this bug along the way.

          https://github.com/sk33lz/lowendscript

          February 4, 2012 @ 12:30 am | Reply
  37. LowEndAdmin – Any idea how I get nginx to output directory listings for directory’s with no index file. I currently get a 403 error.

    Jack.

    July 28, 2010 @ 1:58 pm | Reply
    • I have the same error

      403 Forbidden

      nginx/0.7.67

      May 25, 2011 @ 8:39 pm | Reply
  38. @Jackk:
    Put autoindex on; inside the location directive for that directory.
    It isn’t, however, that simple to make it work. You have to move the root statement out of the location. (More info)

    July 28, 2010 @ 1:59 pm | Reply
  39. @LowEndAdmin: I did exactly as your tutorial and it’s working fine, wordpress blog run fine, but ram usage so high (>500mb ram) so i “reboot” and i get error “502 Bad Gateway”

    July 28, 2010 @ 2:05 pm | Reply
  40. Well the young padawan — it is your opportunity to figure out exactly why it is using 500MB of memory. A simple `ps aux` would tell you a lot where all that memory went :)

    July 28, 2010 @ 2:08 pm | Reply
  41. Thanks to both above -LEA’s solution worked. :-)

    July 28, 2010 @ 2:09 pm | Reply
  42. @LEA: ps aux. And this is result :D

    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.3  23564  1680 ?        Ss   10:17   0:00 /sbin/init
    root         2  0.0  0.0      0     0 ?        S    10:17   0:00 [kthreadd]
    root         3  0.0  0.0      0     0 ?        S    10:17   0:00 [migration/0]
    root         4  0.0  0.0      0     0 ?        S    10:17   0:00 [ksoftirqd/0]
    root         5  0.0  0.0      0     0 ?        S    10:17   0:00 [watchdog/0]
    root         6  0.0  0.0      0     0 ?        S    10:17   0:00 [events/0]
    root         7  0.0  0.0      0     0 ?        S    10:17   0:00 [cpuset]
    root         8  0.0  0.0      0     0 ?        S    10:17   0:00 [khelper]
    root         9  0.0  0.0      0     0 ?        S    10:17   0:00 [netns]
    root        10  0.0  0.0      0     0 ?        S    10:17   0:00 [async/mgr]
    root        11  0.0  0.0      0     0 ?        S    10:17   0:00 [xenwatch]
    root        12  0.0  0.0      0     0 ?        S    10:17   0:00 [xenbus]
    root        14  0.0  0.0      0     0 ?        S    10:17   0:00 [migration/1]
    root        15  0.0  0.0      0     0 ?        S    10:17   0:00 [ksoftirqd/1]
    root        16  0.0  0.0      0     0 ?        S    10:17   0:00 [watchdog/1]
    root        17  0.0  0.0      0     0 ?        S    10:17   0:00 [events/1]
    root        18  0.0  0.0      0     0 ?        S    10:17   0:00 [migration/2]
    root        19  0.0  0.0      0     0 ?        S    10:17   0:00 [ksoftirqd/2]
    root        20  0.0  0.0      0     0 ?        S    10:17   0:00 [watchdog/2]
    root        21  0.0  0.0      0     0 ?        S    10:17   0:00 [events/2]
    root        22  0.0  0.0      0     0 ?        S    10:17   0:00 [migration/3]
    root        23  0.0  0.0      0     0 ?        S    10:17   0:00 [ksoftirqd/3]
    root        24  0.0  0.0      0     0 ?        S    10:17   0:00 [watchdog/3]
    root        25  0.0  0.0      0     0 ?        S    10:17   0:00 [events/3]
    root        26  0.0  0.0      0     0 ?        S    10:17   0:00 [sync_supers]
    root        27  0.0  0.0      0     0 ?        S    10:17   0:00 [bdi-default]
    root        28  0.0  0.0      0     0 ?        S    10:17   0:00 [kintegrityd/0]
    root        29  0.0  0.0      0     0 ?        S    10:17   0:00 [kintegrityd/1]
    root        30  0.0  0.0      0     0 ?        S    10:17   0:00 [kintegrityd/2]
    root        31  0.0  0.0      0     0 ?        S    10:17   0:00 [kintegrityd/3]
    root        32  0.0  0.0      0     0 ?        S    10:17   0:00 [kblockd/0]
    root        33  0.0  0.0      0     0 ?        S    10:17   0:00 [kblockd/1]
    root        34  0.0  0.0      0     0 ?        S    10:17   0:00 [kblockd/2]
    root        35  0.0  0.0      0     0 ?        S    10:17   0:00 [kblockd/3]
    root        36  0.0  0.0      0     0 ?        S    10:17   0:00 [kseriod]
    root        41  0.0  0.0      0     0 ?        S    10:17   0:00 [khungtaskd]
    root        43  0.0  0.0      0     0 ?        S    10:17   0:00 [kswapd0]
    root        44  0.0  0.0      0     0 ?        S    10:17   0:00 [aio/0]
    root        45  0.0  0.0      0     0 ?        S    10:17   0:00 [aio/1]
    root        46  0.0  0.0      0     0 ?        S    10:17   0:00 [aio/2]
    root        47  0.0  0.0      0     0 ?        S    10:17   0:00 [aio/3]
    root        48  0.0  0.0      0     0 ?        S    10:17   0:00 [jfsIO]
    root        49  0.0  0.0      0     0 ?        S    10:17   0:00 [jfsCommit]
    root        50  0.0  0.0      0     0 ?        S    10:17   0:00 [jfsCommit]
    root        51  0.0  0.0      0     0 ?        S    10:17   0:00 [jfsCommit]
    root        52  0.0  0.0      0     0 ?        S    10:17   0:00 [jfsCommit]
    root        53  0.0  0.0      0     0 ?        S    10:17   0:00 [jfsSync]
    root        54  0.0  0.0      0     0 ?        S    10:17   0:00 [xfs_mru_cache]
    root        55  0.0  0.0      0     0 ?        S    10:17   0:00 [xfslogd/0]
    root        56  0.0  0.0      0     0 ?        S    10:17   0:00 [xfslogd/1]
    root        57  0.0  0.0      0     0 ?        S    10:17   0:00 [xfslogd/2]
    root        58  0.0  0.0      0     0 ?        S    10:17   0:00 [xfslogd/3]
    root        59  0.0  0.0      0     0 ?        S    10:17   0:00 [xfsdatad/0]
    root        60  0.0  0.0      0     0 ?        S    10:17   0:00 [xfsdatad/1]
    root        61  0.0  0.0      0     0 ?        S    10:17   0:00 [xfsdatad/2]
    root        62  0.0  0.0      0     0 ?        S    10:17   0:00 [xfsdatad/3]
    root        63  0.0  0.0      0     0 ?        S    10:17   0:00 [xfsconvertd/0]
    root        64  0.0  0.0      0     0 ?        S    10:17   0:00 [xfsconvertd/1]
    root        65  0.0  0.0      0     0 ?        S    10:17   0:00 [xfsconvertd/2]
    root        66  0.0  0.0      0     0 ?        S    10:17   0:00 [xfsconvertd/3]
    root        67  0.0  0.0      0     0 ?        S    10:17   0:00 [glock_workque]
    root        68  0.0  0.0      0     0 ?        S    10:17   0:00 [glock_workque]
    root        69  0.0  0.0      0     0 ?        S    10:17   0:00 [glock_workque]
    root        70  0.0  0.0      0     0 ?        S    10:17   0:00 [glock_workque]
    root        71  0.0  0.0      0     0 ?        S    10:17   0:00 [delete_workqu]
    root        72  0.0  0.0      0     0 ?        S    10:17   0:00 [delete_workqu]
    root        73  0.0  0.0      0     0 ?        S    10:17   0:00 [delete_workqu]
    root        74  0.0  0.0      0     0 ?        S    10:17   0:00 [delete_workqu]
    root        75  0.0  0.0      0     0 ?        S<   10:17   0:00 [kslowd000]
    root        76  0.0  0.0      0     0 ?        S<   10:17   0:00 [kslowd001]
    root        77  0.0  0.0      0     0 ?        S    10:17   0:00 [crypto/0]
    root        78  0.0  0.0      0     0 ?        S    10:17   0:00 [crypto/1]
    root        79  0.0  0.0      0     0 ?        S    10:17   0:00 [crypto/2]
    root        80  0.0  0.0      0     0 ?        S    10:17   0:00 [crypto/3]
    root        83  0.0  0.0      0     0 ?        S    10:17   0:00 [net_accel/0]
    root        84  0.0  0.0      0     0 ?        S    10:17   0:00 [net_accel/1]
    root        85  0.0  0.0      0     0 ?        S    10:17   0:00 [net_accel/2]
    root        86  0.0  0.0      0     0 ?        S    10:17   0:00 [net_accel/3]
    root        87  0.0  0.0      0     0 ?        S    10:17   0:00 [sfc_netfront/]
    root        88  0.0  0.0      0     0 ?        S    10:17   0:00 [sfc_netfront/]
    root        89  0.0  0.0      0     0 ?        S    10:17   0:00 [sfc_netfront/]
    root        90  0.0  0.0      0     0 ?        S    10:17   0:00 [sfc_netfront/]
    root       180  0.0  0.0      0     0 ?        S    10:17   0:00 [kjournald]
    root       219  0.0  0.2  17292  1212 ?        S    10:17   0:00 upstart-udev-br
    root       232  0.0  0.1  16864   804 ?        S<s  10:17   0:00 udevd --daemon
    root       482  0.0  0.1   6072   652 tty4     Ss+  10:17   0:00 /sbin/getty -8
    102        486  0.0  0.1  23416   888 ?        Ss   10:17   0:00 dbus-daemon --s
    root       487  0.0  0.1   6072   656 tty5     Ss+  10:17   0:00 /sbin/getty -8
    root       491  0.0  0.1   6072   652 tty2     Ss+  10:17   0:00 /sbin/getty -8
    root       492  0.0  0.1   6072   652 tty3     Ss+  10:17   0:00 /sbin/getty -8
    root       494  0.0  0.1   6072   652 tty6     Ss+  10:17   0:00 /sbin/getty -8
    root       502  0.0  0.1  21068   896 ?        Ss   10:17   0:00 cron
    root       534  0.0  0.1   6072   656 tty1     Ss+  10:17   0:00 /sbin/getty -8
    root       552  0.0  0.0      0     0 ?        S    10:17   0:00 [flush-8:1]
    root       579  0.0  0.6  79124  3588 ?        Ss   10:21   0:00 sshd: root@pts/
    root       582 107618672  0.7 253860 3984 ?    Sl   10:21 63343744:31 /usr/sbin/
    root       661  0.0  0.3  17856  1936 pts/0    Ss   10:21   0:00 -bash
    root      7323  0.0  0.1  12520   808 ?        S    10:23   0:00 /usr/sbin/syslo
    root      7621  0.0  0.1  19524   984 ?        Ss   10:23   0:00 /usr/sbin/xinet
    104       8813  0.0  0.1  44376  1024 ?        Ss   10:30   0:00 /usr/sbin/exim4
    root      8880  0.0  0.3  28112  1672 ?        Ss   10:30   0:00 nginx: master p
    mysql     9770  0.0  1.8  60880  9920 ?        Ssl  10:30   0:00 /usr/sbin/mysql
    www-data 10122  0.0  1.3  87780  7072 ?        Ss   10:33   0:00 /usr/bin/php-cg
    www-data 10125  0.5  5.4 111928 29864 ?        S    10:33   0:00 /usr/bin/php-cg
    www-data 10178  0.0  0.3  28844  2116 ?        S    10:33   0:00 nginx: worker p
    root     10181  0.0  0.1   6072   728 ?        Ss   10:33   0:00 /sbin/getty -8
    root     10182  0.0  0.2  14972  1124 pts/0    R+   10:33   0:00 ps aux
    
    July 28, 2010 @ 2:32 pm | Reply
  43. Spot the odd one out :) Your process pid=582 seems to be doing naughty things.

    July 28, 2010 @ 2:45 pm | Reply
  44. That’s right! How can i solve this? I run wordpress blog with high traffic (online at the same time is 100-200)

    July 28, 2010 @ 2:49 pm | Reply
  45. @Above – Run;

    kill 582

    And it will kill the command.

    July 28, 2010 @ 2:51 pm | Reply
  46. @Jackk: did it, but ram usage still high: 513 :D

    July 28, 2010 @ 3:10 pm | Reply
  47. Run ps aux again for me..

    jack

    July 28, 2010 @ 3:11 pm | Reply
  48. @ Jack: please see pics:
    img201.imageshack.us/img201/5628/screenshot2807201022161.jpg
    img227.imageshack.us/img227/2526/screenshot2807201022160.jpg

    July 28, 2010 @ 3:31 pm | Reply
  49. @minhmeo
    just wondering, why there are so many kernel processes in your ‘ps aux’ result in comment #43.

    July 29, 2010 @ 4:32 am | Reply
  50. @bekanosky: hard to say cos i’m newbie here :D
    I added your Gtalk id, can you help me to install this? I will give you my vps, then you install it and write steps you did to make it running fine. Is it OK?

    Thanks!!!

    July 29, 2010 @ 4:39 am | Reply
  51. quick suggestion: install php5-fpm from the dotdeb.org repositories instead of the default PHP fastcgi implementation.

    July 29, 2010 @ 6:05 am | Reply
  52. btw, my suggestion is to improve the script, not for any special problem :)

    July 29, 2010 @ 6:10 am | Reply
  53. @minhmeo
    I already write tutorial about this nginx-phpfcgi-mysql-wordpress in indonesian.
    If not lazy, i will have translated it to english.
    And i think, this lowendscript do much more than what i wrote.
    So, just make sure to execute this script properly and i’m sure it will be okay.

    July 29, 2010 @ 6:43 am | Reply
  54. Tom:

    57.59ram on rackvm debian

    Thanks for publishing this package, seems to work great!

    July 29, 2010 @ 11:38 am | Reply
  55. Admin, many thanks for the install script, please if anyone can add drupal along with?

    July 29, 2010 @ 2:02 pm | Reply
  56. What about using a flat-file blog instead of WordPress? It may not be as powerful, but it won’t require a MySQL Server running.

    July 29, 2010 @ 7:12 pm | Reply
  57. Maller:

    Could you add setting up phpmyadmin to the script ? cause I can’t seem to get it working on nginx ?

    July 30, 2010 @ 2:16 pm | Reply
  58. @Maller – I can help you setup the script. Send me an email on the email address on the page below.

    http://178.63.252.43/email.txt

    July 30, 2010 @ 3:18 pm | Reply
  59. @Maller: you can follow tutorial here, auto script:
    http://www.rockia.com/2010/05/how-to-set-up-lnmp-on-debian-ubuntu-or-centos

    July 30, 2010 @ 5:03 pm | Reply
  60. yohan:

    @maller

    you can try sql buddy. jquerty based; very simple and lightweight.
    http://www.sqlbuddy.com/

    July 31, 2010 @ 5:19 am | Reply
  61. Hello,

    The Cron system doesn’t seem to work on my system?

    Jack

    July 31, 2010 @ 11:24 pm | Reply
  62. I found that why my ram usage is so high. Because i’m using Xen VPS :(
    How can i reduce ram usage?

    August 1, 2010 @ 12:26 am | Reply
  63. Raj:

    Someone smart should add a low resource SMTP/IMAPD (or POP3) addition to this stack. :)

    August 1, 2010 @ 2:15 am | Reply
  64. @Raj – In my opinion it’s easier and better to out source your email to something like Google Apps. Google Apps provide 50 emails accounts free of charge for each of your domains – each account has a massive 7GB storage space like any normal Gmail account.

    http://www.google.com/a

    Jack xD

    August 1, 2010 @ 9:12 am | Reply
  65. @Minh — probably because you have read the command `free` wrong :) All your cache/buffer should probably be counted as “almost-free”.

    @Raj — what Jack said. Google Apps is probably a much bettered hosted email option, unless you are providing IMAP/POP3 for clients.

    August 1, 2010 @ 10:31 am | Reply
  66. @LEA

    I have tried the script under my RackVM OpenVZ VPS, with Debian 5 Lenny 32bit, and the memory used is about 47Mb. I have a question, since I install the wordpress at http://www.noenoey.com, but when I open my website with http://noenoey.com, it only shows ‘Welcome to Nginx’.

    How do I set the domain, so when I open it with or without www, it still the same?
    And also, when I open the website using the IP, it shows the wordpress?

    August 1, 2010 @ 3:09 pm | Reply
  67. Tom:

    If you change wordpress to some other CMS and you get “no input file specified.” on firefox (yes, for some reason only on firefox!) go to /etc/nginx/sites-available and erase all default info and only leave your created config in /etc/nginx/sites-enabled

    August 1, 2010 @ 3:30 pm | Reply
  68. Raj:

    Probably true. From my knothole, I’ve got about 8 years of personal Maildir format mail and a handful of mail mailing lists that I’d like to be able to move from host to host should I find paritcular hosts’ service going downhill.

    Moving that data around is easy postfix/dovecot, but I am not aware that Google Apps has a download all/upload all feature. Does it?

    The other issue on low end boxes is spamassassin being a memory hog! I haven’t been able to get the mem usage down enough to coexist with my LAMP stack on other 128MB/256MB low end boxes.

    I’ll fiddle around with it some more, maybe I”ll come up with a little blurb to add to this one. :)

    August 1, 2010 @ 7:11 pm | Reply
  69. @Raj,

    If you stuck your email with Google you wouldn’t need to move it every time you moved hosts. You could just simply keep the email in one place at all times.

    August 1, 2010 @ 7:14 pm | Reply
  70. @Raj — I have run my own SMTP/IMAP server for many years (since ’99) until about 2 years ago I got really fed up with it and migrate all my mails to Google App. Way too much tinkering with spam/virus filters (and SpamAssassin/ClamAV eats memory *a lot*), and just can’t resist the conversation view that Gmail provides.

    To move my years of mails in Maildir (I also used Postfix + Dovecot before) I wrote a script to scan through all files in Maildir, and use Gmail’s IMAP interface to copy the data over. Worked well. It is also possible to write something to use Gmail’s IMAP interface to continuously backup mails to your own server. I haven’t bothered though.

    August 1, 2010 @ 11:25 pm | Reply
  71. @Erawan — you need to put in a Nginx configuration to do the redirection. For example

    server {
      server_name noenoey.com;
      rewrite ^(.*)$ $scheme://www.noenoey.com$1 permanent;
    }
    

    @Tom — in the end I think it is a good idea to pick up some Nginx configuration syntax :) No input file probably means PHP cannot find the PHP script.

    August 1, 2010 @ 11:37 pm | Reply
  72. @LEA

    Thank you, I will try it :)

    August 1, 2010 @ 11:53 pm | Reply
  73. Hm…

    I wonder,are you the same owner of yang.id.au. LEA?

    August 2, 2010 @ 12:23 am | Reply
  74. @LEA: Here is “free -m” resuld, is ram usage 492 :D

    root@endor:~# free -m
    total used free shared buffers cached
    Mem: 531 492 38 0 24 360
    -/+ buffers/cache: 108 422
    Swap: 511 0 511

    August 2, 2010 @ 1:55 am | Reply
  75. Sorry, please help me but my free -m result in code tag

    August 2, 2010 @ 1:55 am | Reply
  76. Allen:

    @Minh:

    I think you have mistaken about the result given from “free -m”
    Your total free memory should be 422.
    Though having 100+ used memory is still kinda of a bit too much?

    August 3, 2010 @ 4:45 am | Reply
  77. eM:

    any chance updating the script with lighttpd?

    August 4, 2010 @ 12:59 am | Reply
  78. @Allen: thanks, it’s my mistake, i didnt know to read free -m result :D

    August 4, 2010 @ 1:31 am | Reply
  79. @eM – I’m sure you can do that manually. Simply remove nginx (apt-get remove nginx) and then use the following guide to install lighttpd.

    http://www.lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/

    August 4, 2010 @ 10:29 am | Reply
  80. David:

    Using Ubuntu 64bit, only using 65mb of RAM, doing nothing but running APT-GET Upgrade and Update before, and running the above script.

    free -m
    total used free shared buffers cached
    Mem: 2048 65 1982 0 0 0
    -/+ buffers/cache: 65 1982
    Swap: 0 0 0

    August 7, 2010 @ 9:34 am | Reply
  81. @LEB
    What was your reason starting dropbear with xinetd?

    I see your notes about “easier to configure” in your script… but someone expect things in /etc/default/ may be confused.

    August 9, 2010 @ 6:28 am | Reply
  82. @terii — well that’s just my setup, because I am actually using xinetd for a few other things so instead of running dropbear in daemon mode + xinetd, I’ll just run dropbear in inetd mode, forked from xinetd.

    August 9, 2010 @ 6:39 am | Reply
  83. fang:/var/www# free -m
    total used free shared buffers cached
    Mem: 256 49 206 0 0 0
    -/+ buffers/cache: 49 206
    Swap: 0 0 0

    This is after a few PHP pageviews. Debian 5 64 bit. 2 PHP FCGI Children and recycling them after 50 requests.

    August 11, 2010 @ 9:26 pm | Reply
  84. I should note though, that that is a MyBB forum not WordPress running on that server.

    August 11, 2010 @ 9:29 pm | Reply
  85. I modified it a little to add the ability to set up a database, directory and configure nginx without installing wordpress.

    It’s located at http://freevps.tk/downloads/setup-debian.sh and the line to run make it is setup-debian.sh domain {domain}
    Obviously you replace {domain} with your domain name.

    August 17, 2010 @ 12:46 am | Reply
  86. yohan:

    is there an easier way to chroot sftp or ssh of dropbear?
    is the change of host key popup during sftp normal?

    August 18, 2010 @ 12:24 am | Reply
  87. Thanks for the benchmark. I knew 32-bit uses less memory than 64-bit, but I was curious about how big is the difference. Now I’ve got a clue about numbers. It is around 38% for your setup — not a negligible number.

    August 22, 2010 @ 6:43 pm | Reply
  88. Hey thanks for posting on Reddit :P

    The difference also varies depending on your software stack, and 38% more would actually be on the low end of the differences — I have seen apps use up a lot more on x86_64.

    Some monolithic apps would require large memory foot prints. For example big MySQL installation that needs more than 2GB. Or MongoDB as it uses mmap files. Otherwise I usually just stick to 32bit on my VPS.

    August 23, 2010 @ 1:01 am | Reply
  89. superbarney:

    Hi, first I would like to say that this script is awesome =)

    I have no problem running wordpress via the bash setup-debian.sh wordpress myblog.example.com. PHP seems to work fine on the wordpress blog.

    But when I tried to put info.php in /var/www. It just won’t run. It will not parse the php file at all. The source is displayed.

    I’m an nginx noobie, what do I have to do to make php work at /var/www and possibly elsewhere. Thanks.

    August 27, 2010 @ 6:22 am | Reply
  90. Allen:

    @superbarney:

    The problem will be that fastcgi parameterers are not passed in the main nginx configuration I supposed. Accordingly to the lowendbox script, the parameters are added to “/etc/nginx/fastcgi_php” therefore if you want php to work in your root location; You will have to do a “include /etc/nginx/fastcgi_php” in the main nginx configuration which I think should be located at “/etc/nginx/”

    Or I think a more maintainable method will be to create another virtual host (For the root directory) and add it into your main ngix configuration. This way you could easily maintain the configuration for each different domains you have on the box.

    August 27, 2010 @ 6:30 am | Reply
  91. Nickolai Leschov:

    Thanks for making our lives even more easier with this script!

    LowEndAdmin, can you please add Pure-FTPd configuration to this script?

    First thing, I wanted to try serving files from my VPS. So I installed nginx to serve files pure-ftpd for uploading files via ftp to nginx’ home directory. But alas, I couldn’t make ftp work however I tried!

    August 27, 2010 @ 1:10 pm | Reply
  92. @Nickolai — wouldn’t SFTP an better alternative? It should work with Dropbear or OpenSSH. More secure and less hassle with firewalls.

    August 27, 2010 @ 2:01 pm | Reply
  93. Nickolai Leschov:

    @LowEndAdmin: Maybe it would; I really don’t know. I have no experience here; I think I picked an idea that Pure-FTPd is good on some forum.

    Do you mean sftp(1)? http://www.openbsd.org/cgi-bin/man.cgi?query=sftp
    It seems to be a client, am I supposed to install sftp-server(8) for a server? http://www.openbsd.org/cgi-bin/man.cgi?query=sftp-server

    It would be nice if you added this to a script.

    August 27, 2010 @ 3:30 pm | Reply
  94. superbarney:

    @Allen:

    Thanks for the tip but I had a feeling that was the case and did “include /etc/nginx/fastcgi_php” for the vhost that has already been setup for root, which is /etc/nginx/sites-available/default. That is if I’m not mistaken.

    After adding that line, I get “No input file specified” as the error message on my browser. =/

    I can’t figure out why the wordpress dir is able to use php flawlessly and not root (or possibly elsewhere)

    August 27, 2010 @ 6:45 pm | Reply
  95. @Nickolai — SFTP is available as long as you have SSH installed (which should already be there when the VPS is setup). For a free client use WinSCP. Or you can use something like SSHFS on Linux, or Expandrive to mount the remote SFTP server as a local drive.

    August 28, 2010 @ 11:48 am | Reply
  96. KLIKLI:

    @superbarney
    Not sure what are you actually going to do, but “No input file specified” equals to error occured at the end of PHP. You’d probablly see if the path is correct, or you may try to chmod files to 755.

    August 28, 2010 @ 5:05 pm | Reply
  97. Allen:

    @@Nickolai

    Yup! SFTP usually comes installed as a feature with the ssh server that you are using. In this case, dropbear does support sftp protocol. You can use FileZilla (Free of course!) and while you are at the site manager, you can add in to use the sftp protocol.

    I think if you are planning to serve a couple of users using FTP. Then I think getting a separate ftp server will be more appropriate than sftp. (I dunno why, but it just seems so, haha). If you are just working alone and wishes to transfer files then sftp will works as fine.

    August 28, 2010 @ 5:16 pm | Reply
  98. great article thanks.

    August 29, 2010 @ 4:17 pm | Reply
  99. marikh:

    It would be so nice, if You update nginx version :) in your pack, nginx version is 0.6, but the newest version is 0.7.

    September 2, 2010 @ 9:58 pm | Reply
  100. KLIKLI:

    @marikh – The LowEndScripts uses apt-get/dpkg for installing Nginx.

    September 3, 2010 @ 12:59 am | Reply
  101. @marikh

    Try http://www.lowendtalk.com/topic/tutorial-i-made-on-compiling-the-newest-version-of-php-nginx-for-lowendboxs

    For compiling the newest version of both nginx and PHP, and including APC support.

    September 3, 2010 @ 1:10 am | Reply
  102. @marikh — unless you want the latest features I normally just stick to the distro default so it gets automated security updates. I still have boxes running Ubuntu 8.04 with Nginx 0.5.33. As I am not a Nginx wiz and use probably the most simple functionality it does not really matter to me…

    September 3, 2010 @ 1:11 am | Reply
  103. I have used your script and it works. Thanks very much. The one thing I am trying to accomplish but have been unable to do is to have the configs in one place for nginx and use sites-enabled at will.

    On another centos server, using php-fpm and nginx, I was able to setup the server with only the nginx.conf file and then adding a subdomain that works for php and wordpress install was as simple as adding another subdirectory to /usr/share/nginx/sites-enabled and installing wordpress in it.

    However, I prefer your installation, because for some reason, a wordpress plugin that is needed for me errors out in the php-fpm (php 5.3.3) but works fine in your scripted version. I have not been able to figure out why. (the centos php 5.3.3 server also seems to use more memory)

    However, the simplest thing to me would seem to be to configure the debian system to use the conf and sites enabled to do the same thing as my centos server and thus solve all my problems at once.

    My nginx.conf is as follows (I have tried to modify it to the best of my abilities)

    #######################################################################
    #
    # This is the main Nginx configuration file.  
    #
    #######################################################################
    
    #----------------------------------------------------------------------
    # Main Module - directives that cover basic functionality
    #
    #   http://wiki.nginx.org/NginxHttpMainModule
    #
    #----------------------------------------------------------------------
    
    user              www-data;
    worker_processes  2;
    
    error_log  /var/log/nginx/error.log;
    #error_log  /var/log/nginx/error.log  notice;
    #error_log  /var/log/nginx/error.log  info;
    
    pid        /var/run/nginx.pid;
    
    
    #----------------------------------------------------------------------
    # Events Module 
    #
    #   http://wiki.nginx.org/NginxHttpEventsModule
    #
    #----------------------------------------------------------------------
    
    events {
        worker_connections  1024;
    }
    
    
    #----------------------------------------------------------------------
    # HTTP Core Module
    #
    #   http://wiki.nginx.org/NginxHttpCoreModule 
    #
    #----------------------------------------------------------------------
    
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
        access_log  /var/log/nginx/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        #keepalive_timeout  0;
        keepalive_timeout  65;
    
        #gzip  on;
        
        # Load config files from the /etc/nginx/conf.d directory
        #include /etc/nginx/conf.d/*.conf;
        #
        # The default server
        #
        server {
            listen       80;
            server_name  www.myrootdomain.com myrootdomain.com *.myrootdomain.com;
    
            #charset koi8-r;
    
            access_log  /var/log/nginx/$host.access.log;
    
            location / {
                root   /usr/share/nginx/sites-enabled/$host;
                index  index.html index.htm index.php;
            }
    
            error_page  404              /404.html;
            location = /404.html {
                root   /usr/share/nginx/sites-enabled/$host;
            }
    
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   /usr/share/nginx/sites-enabled/$host;
            }
    
            # proxy the PHP scripts to Apache listening on 127.0.0.1:80
            #
            #location ~ \.php$ {
            #    proxy_pass   http://127.0.0.1;
            #}
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            location ~ \.php$ {
                root           /usr/share/nginx/sites-enabled/$host;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/sites-enabled/$host$fastcgi_script_name;
                include        fastcgi_params;
            }
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /\.ht {
            #    deny  all;
            #}
        }
    	
    	
    }
    
    *****************************************
    

    This works fine on my centos php-fpm server but returns not found errors on the scripted debian.

    I really need to be able to add subdomains just by putting the subdomain.myrootdomain.com directory and files in **/sites-enabled/

    I would really appreciate some help here. I have been pulling my hair out for a week now trying to get it to work.

    September 14, 2010 @ 3:36 am | Reply
    • I think it wasn’t working because the lowendscript uses unix:/var/run/www/php.sock for FastCGI, whereas your script uses TCP port localhost:9000.

      Unix domain socket is slightly faster and good enough for a single box setup.

      September 14, 2010 @ 3:41 am | Reply
  104. I should add that your blog is adding http:// to my www
    In the server_name line I do NOT have http, just the www . myrootdomain . com
    I point this out only to avoid confusion.

    September 14, 2010 @ 3:40 am | Reply
  105. So how do I make mine use the php.sock for fastcgi? I could not find anything in any of the confs your scripts created that points to that.

    Or is there something in the script that I could change to make it work? Your script really is the simplest LEMP install on the net.

    Thank you also for the rapid reply.

    September 14, 2010 @ 4:15 am | Reply
  106. My script creates a file called /etc/nginx/fastcgi_php and all the PHP/WordPress sites include that…

    September 14, 2010 @ 4:25 am | Reply
  107. I think I fixed it. Let me try and make some adjustments and test it out further.
    I am still bleary eyed from lack of sleep, but I will try to test it out.

    September 14, 2010 @ 4:27 am | Reply
    • Bobby, have you figured it out? I need to change it from php.sock to TCP port as well but I can’t seem to get it working.
      What changes did you make?
      Thanks.

      January 14, 2011 @ 5:33 pm | Reply
  108. Eric:

    Thank you for the excellent guide, however there is one significant niggling issue. Everything works on first install (Ubuntu 10.04 x86), but after I restart it, I get 502 Bad Gateway. The only way it seems to fix it is to run “bash setup-debian.sh php”, after that it works fine. I tried wiping my VPS and doing it all over again, and the same issue occurs. PHP appears to be in the startup scripts folder, but restarting the php service gives me an error that it cant access /var/www/php.pid

    It seems these changes magically get wiped (the folders too), after each restart.

    Please help me out LEA

    Thanks in advance

    September 16, 2010 @ 6:19 pm | Reply
    • J.F.:

      I have the same issue.Anyone?

      February 11, 2012 @ 5:35 am | Reply
  109. Great work LowEndBoxAdmin

    I did a clean install on VPS.NET SAN 2.0 VPS with Basic Debian 5.0 (x64) and followed your steps described above. For the last step, I wasn’t sure if I should use addictinggames.com or http://www.addictinggames.com In the end I decide to use
    bash setup-debian.sh wordpress http://www.addictinggames88.com

    After completing the wordpress login info, the home page still show a welcome nginx. I followed the rewrite above, but didn’t work. I then change the wordpress/site address under general setting to http://www.addictinggames88.com and the home page was able to load.

    A VPS reboot and top show 77496k RAM used. Memory usage after 1 load of the home page is 97348k RAM used.

    I have some questions.
    1) Do I have to install VSFTPD? If I have to, how do I install?
    I need to add at least 10 WordPress Plugins, but I don’t seem to be able to do it within the admin area. It asked for the FTP info, I used the SSH info, it didn’t work.

    2) How to upgrade Nginx to 0.8.50?
    Nginx version is 0.6.32. I was asked to update to the latest v0.8.50 on one of my VPS as v0.6.32 is not safe.

    3) How to replace PHP/FastCGI with PHP/PHP-FPM? If using PHP-FPM, I also need to upgrade PHP to 5.3.3? If I have do, how do I install?
    A benchmark test show that PHP-FPM is faster than FastCGI
    http://vpsbible.com/php/php-benchmarking-phpfpm-fastcgi-spawnfcgi/

    4) How to install APC on Debian?
    I like Centos because of yum

    5) Will you do a bash script for Centos?
    For now, only Centos allow me to scale SAN 2.0 VPS without reboot.

    September 17, 2010 @ 8:54 am | Reply
    • Ryan:

      You don’t like Centos because of yum. You like it because you don’t understand Linux enough to make an educated decision.

      January 4, 2011 @ 8:38 am | Reply
      • So, didn’t smart people started from scratch and from zero?
        Don’t tell me, that you’re born as a genius, and do nothing without learning.

        If yes, then you should teach all of the newbie here, so they can be as genius as you

        January 4, 2011 @ 9:51 am | Reply
  110. Eric,

    According to my VPS support, Nginx 0.6.32 is the problem and I was asked to upgrade to the latest version.

    September 17, 2010 @ 9:35 am | Reply
  111. About the wordpress asking for the ftp details, make sure it has full access to the wordpress directory and is owned by the same user who is running the php files.
    (www-data if you used this script.)

    September 17, 2010 @ 3:31 pm | Reply
  112. @dmmcintyre3,

    If I use this script, FTP Username = www-data, what about the FTP Password?

    September 18, 2010 @ 2:53 am | Reply
  113. Eric:

    @AddictingGames88

    This is a better way of getting wordpress to work.

    http://www.nerdgrind.com/wordpress-automatic-upgrade-plugin-failed-or-not-working/

    September 18, 2010 @ 9:20 am | Reply
  114. Well. Real WordPress users use subversion to manage their WordPress and plugin installations so `svn switch` would do the upgrade :)

    September 18, 2010 @ 9:55 am | Reply
  115. Rolando Tinggian:

    Hello,

    I wanted test webserver for my vps (for learning) so I put “testblog” as hostname (No domain) but when I go to http://myip/testblog it says “404 not found”

    Do I have to adjust default.conf & testblog.conf ?

    also very much thanks for this script and blog.

    September 18, 2010 @ 4:50 pm | Reply
  116. Hi LEA:
    Do you have any tips to protect Nginx webserver from Ddos attack? Your script is great for me, but today i get ddos and i dont know how to solve this :(

    September 19, 2010 @ 4:44 am | Reply
  117. LEA,

    I installed your lowendscript and upgraded php to 5.3.3 with
    http://www.21andy.com/blog/20100912/1948.html
    and
    replaced package to http://php53.dotdeb.org

    It works fine with php-cgi. When I switch to php5-fpm, it looks fine, but apache benchmark is not as good. I probably missed out something. Can we have a tutorial on how to switch from php-cgi to php5-fpm?

    September 19, 2010 @ 6:13 am | Reply
  118. @Rolando — no it does not default to your blog. You can add “listen 80” under “server” in the configuration file for that virtual host and Nginx will pick that up as the default virtual host.

    Otherwise you can test by adding the IP address to your local /etc/hosts (or c:\windows\system32\drivers\etc\hosts if you are using Windoze).

    @Minh — I still don’t believe there’s a cheap cure for DDoS unfortunately. You might need to buy bigger machine.

    @AddictingGames88 — why do you need php5-fpm? Dynamic spawning of new FastCGI processes?

    September 19, 2010 @ 10:46 am | Reply
  119. KLIKLI:

    @LEA
    Maybe Windows?

    September 19, 2010 @ 10:48 am | Reply
  120. @LEA – PHP-PFM is said to be faster than PHP-CGI.
    http://vpsbible.com/php/php-benchmarking-phpfpm-fastcgi-spawnfcgi/

    September 19, 2010 @ 12:54 pm | Reply
  121. Err. That post makes no sense. PHP-FPM uses exactly the same core as PHP-FastCGI, and I can’t see how you can get better performance on standard PHP function calls. It has a much better FastCGI process management though — useful if you want “adaptive process spawning” similar to mod_fcgi in Apache.

    September 19, 2010 @ 1:36 pm | Reply
  122. @Eric : How to solve FTP problem since

    /usr/sbin/setsebool -P httpd_can_network_connect=1
    -bash: /usr/sbin/setsebool: No such file or directory

    September 20, 2010 @ 3:16 am | Reply
  123. Nizar:

    Hi, i’m a newbie on this, i tried to upload file on wordpress and can’t because:
    Unable to create directory /var/www/mydomain.com/wp-content/uploads/2010/09. Is its parent directory writable by the server?

    I know if in the apache we can use suPhp, how to fix this in nginx? it’s risky if i make the directory writeable.
    I also can’t using theme editor on wordpress and update plugins automatically
    Thanks

    September 20, 2010 @ 9:01 am | Reply
  124. @Nizar,

    According to Eric@120, http://www.nerdgrind.com/wordpress-automatic-upgrade-plugin-failed-or-not-working/ is the way. However, when I perform “/usr/sbin/setsebool -P httpd_can_network_connect=1”, I get “-bash: /usr/sbin/setsebool: No such file or directory”

    So, at the moment, I used the solution from http://desk.stinkpot.org:8080/tricks/index.php/2009/01/wordpress-wants-ftp-information-to-update-plugins/

    September 20, 2010 @ 12:53 pm | Reply
  125. Nizar:

    @AddictingGames88
    Thanks, i got it.

    September 21, 2010 @ 4:08 pm | Reply
  126. Need help on the following questions
    1)How to add new user and disable root for DropBear?
    2)If we will to install second WordPress, do we use a new ip address or the same ip as the first WordPress installation?
    Hope someone can share the answer

    September 25, 2010 @ 3:28 am | Reply
  127. @AddictingGames88

    1. I don’t try it yet
    2. If you can set the DNS for each subdomains, then you can easily install the second wordpress at the same IP

    September 25, 2010 @ 3:32 am | Reply
  128. @Erawan Arif Nugroho,

    2. I actually mean installing a second WordPress with a new domain name. Do I dns the new domain name to the same IP Address?

    September 25, 2010 @ 3:54 am | Reply
  129. @AddictingGames88

    Yes :)

    Previously, I have 3 domain names, and I am hosting it in one VPS (with one IP)
    Because the nginx will automatically maps the DNS requests to the directory in /var/www/domainname.com

    September 25, 2010 @ 3:58 am | Reply
  130. @Erawan Arif Nugroho

    That’s cool. I can save some money on IPs.

    September 25, 2010 @ 5:15 am | Reply
  131. Hello,

    Is it possible to install and configure GD?

    Jack.

    October 1, 2010 @ 3:25 pm | Reply
    • Err. apt-get install php5-gd and then restart the PHP FastCGI processes?

      October 1, 2010 @ 3:31 pm | Reply
  132. Denny:

    Thanks for the handy script! I have got two questions here:

    1. Everything is running OK after the installation. However, after I reboot my VPS, it seems that neither mysql nor php is running:

      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
        1 root      18   0  2464 1312 1108 S  0.0  0.5   0:00.16 init
    15837 root      16   0  8272 2724 2160 S  0.0  1.0   0:00.07 sshd
    32456 root      25   0  4764  692  252 S  0.0  0.3   0:00.00 nginx
    32458 www-data  15   0  4916 1476  832 S  0.0  0.6   0:00.00 nginx
    32463 root      18   0  5468  908  504 S  0.0  0.3   0:00.00 sshd
    

    2. When I set up WordPress, I used “www.mydomain.com” as the server name. Is there any way to config both “mydomain.com” and “www.mydomain.com” to my blog?

    Thanks

    October 3, 2010 @ 7:48 am | Reply
    • 1. They should be automatically restarted. Check whether php-cgi and mysql are in /etc/rc2.d

      2. You can add a new file called /etc/nginx/sites-enabled/mydomain.com.conf

      server {
          server_name mydomain.com;
          rewrite ^(.*)$ $scheme://www.mydomain.com$1 permanent;
      }
      
      October 3, 2010 @ 9:57 am | Reply
  133. Nickolai Leschov:

    LowEndAdmin, thanks again for your script and help.

    It is actually true, I can access my site with SFTP without any extra FTP software. I use FireFTP add-on for Firefox, which supports SFTP too! On Windows, I was used to FAR Manager with WinSCP plug-in.

    So I managed to make my VPS into a file host with nginx: I ordered a 256MB Xen VPS from 2HOST for $4.94 monthly (SATA variety, originally $5.49, code LEB10TB for 10% discount), did “” did the script up to nginx and uploaded my files. Alas, download speed from my server is around 100 kilobytes/s. If we download from two different computers, it gives us around 100 kilobytes/s each. I tried tweaking around with nginx configuration, but nothing helps.

    When I ssh to server and download files with wget it goes 100 kilobytes/s from some locations. From some it is over megabyte/s.

    Is the hosting provider throttling me? Can I do anything? Or maybe it’s just misconfiguration on my part?

    My site: http://178.18.17.199/
    file: http://178.18.17.199/firefox-4.0b6.tar.bz2

    October 4, 2010 @ 12:38 am | Reply
  134. @Nickolai Leschov :

    Well, many LEB readers are not using 2host services anymore.
    Because thay are so slow, and at sometimes, they are down.

    Mabe you can read the articles here :

    http://www.lowendbox.com/blog/2host-4-04-128mb-xen-vps-with-10tb/
    http://www.lowendbox.com/blog/2host-5-21-xen-vps-with-256mb/

    October 4, 2010 @ 12:54 am | Reply
  135. Can the second site use a different IP from the first site? If so, how?

    October 6, 2010 @ 7:06 pm | Reply
    • You might want to study a bit on Nginx configuration — this script is intended for those who know what they are doing to save time :)

      You can use

      server {
          server_name my-new-website.com;
          listen ipaddress:80;
          ...
      }
      

      to have the site on a different IP address.

      October 6, 2010 @ 10:24 pm | Reply
      • Thanks for your reply. I will do a bit of study on Nginx configuration. I need different IP as I am moving existing live sites to new server without bring down the sites.

        October 7, 2010 @ 3:56 am | Reply
  136. Ron:

    Help pls.. I installed the wp blog using the script, runs fine but im having an error in uploading my WP XML file to upload my posts etc. Error says “Zero Sized Reply” in my browser. Is that error related to the bootstrapscript?

    October 7, 2010 @ 6:43 am | Reply
    • Ron:

      Sorry guys ..i just forgot to set permissions in wp-content/uploads dir.
      chmod 755 uploads/ fix it.
      BTW i think we can still tune PHP to use less memory in /etc/php5/cgi/php.ini memory_limit = 128M
      and set memory limit to 64.

      October 7, 2010 @ 7:25 am | Reply
      • That’s the maximum memory that PHP can use, but not necessarily the amount that it would use during an execution of a script.

        October 7, 2010 @ 12:27 pm | Reply
        • Ron:

          ok ..after i rebooted my vps php-fcgi dont auto start. have i missed something in the script?

          October 8, 2010 @ 1:46 am | Reply
  137. Any idea how to restart the PHP processes? I am having to restart the whole system at the moment.

    October 11, 2010 @ 8:00 pm | Reply
  138. I am now running cherokee in debian. And i am using debian “sid” repo. But cherokee is suffering very much. after few hours every time it shows “504 gateway timeout”. Then i need to do /etc/init.d/cherokee restart to solve this, but after a few hours problem again arises. When i am out of my home, my site remains unavailable for this 504 … error.

    Now i want to switch to nginx using this script. I read the whole script and tried setting up nginx and php5-cgi but failed.

    How can i make use of this script on an running server like me and any help for sid repo ?

    October 11, 2010 @ 9:10 pm | Reply
  139. Christian:

    Great script!
    I’m using 49 MB on Debian with 2 wordpress sites. amazing.

    October 15, 2010 @ 12:17 pm | Reply
  140. Marikh:

    Where I can edit nginx .c files? I can’t find them.

    October 18, 2010 @ 2:52 pm | Reply
    • KLIKLI:

      Weird comment organization… these comment is placed over the 9/10 ones..

      Anyway, the NGINX seems to be installed via respiratory (apt-get)
      If you wish to edit them you’ll need to compile NGINX manually.

      October 18, 2010 @ 2:54 pm | Reply
  141. Ronnie:

    Hi LEA,

    I use Debian 5 x86 VPS and install LowEndBox shell as this blog said. I could run WordPress and display static webpage very well.

    However, if I browse a PHP webpage under /var/www/nginx-default folder by browser, the browser would download the PHP file, not display it.

    Could you please tell me how to fix it?

    Thanks!

    October 18, 2010 @ 8:13 pm | Reply
  142. Tom:

    LEA, maybe you have anything like fail2ban preconfigured for dropbear?

    October 24, 2010 @ 4:25 pm | Reply
    • Nope, although fail2ban should be quite configurable to parse syslog file to catch the dropbear error message. I just haven’t really had a need to it yet as most my VPS have port 22 firewalled to specific IPs.

      October 24, 2010 @ 11:00 pm | Reply
      • addictinggames88.com:

        Here is the fail2ban conf for dropbear

        Edit fail2ban jail conf
        ——————————————————————–
        # vim /etc/fail2ban/jail.conf
        ——————————————————————–
        bantime = 3600
        findtime = 300

        ## Add dropbear jail at end of file
        [dropbear]

        enabled = true
        port = ssh
        filter = dropbear
        logpath = /var/log/messages
        ——————————————————————–

        # cd /etc/fail2ban/filter.d
        # vim dropbear.conf
        ——————————————————————–
        # Fail2Ban configuration file
        #
        # Author: Francis Russell

        [INCLUDES]

        # Read common prefixes. If any customizations available — read them from
        # common.local
        before = common.conf

        [Definition]

        _daemon = dropbear

        # Option: failregex
        # Notes.: regex to match the password failures messages in the logfile. The
        # host must be matched by a group named “host”. The tag “” can
        # be used for standard IP/hostname matching and is only an alias for
        # (?:::f{4,6}:)?(?P\S+)
        # Values: TEXT
        #

        # These match the unmodified dropbear messages. It isn’t possible to match the source of the
        # ‘exit before auth’ messages from an unpatched dropbear.
        #
        failregex = ^%(__prefix_line)slogin attempt for nonexistent user (‘.*’)?from :.*\s*$
        ^%(__prefix_line)sbad password attempt for .+ from :.*\s*$

        # The only line we need to match with the patched dropbear
        # failregex = ^%(__prefix_line)sexit before auth from .*\s*$

        # Option: ignoreregex
        # Notes.: regex to ignore. If this regex matches, the line is ignored.
        # Values: TEXT
        #
        ignoreregex =
        ——————————————————————–

        Test fail2ban for dropbear
        ——————————————————————–
        # fail2ban-regex /var/log/messages /etc/fail2ban/filter.d/dropbear.conf

        November 1, 2010 @ 7:15 am | Reply
  143. Anand:

    @LEA,
    Sorry again for a noob question. I changed the etc/hosts to point to my domain. How do I create a nameserver for it using the ip given? I just have one ip. For example, If I have to create 5 blogs, do I need 5 ips?

    October 28, 2010 @ 3:41 pm | Reply
    • tommy:

      install bind/nsd3 dns server, you dont need 5 ip address, just use virtualhost.

      October 28, 2010 @ 5:53 pm | Reply
      • Anand:

        Dont know anything about those or how to install them, but will google and try to find out.
        Thanks a lot for the help.

        October 28, 2010 @ 6:39 pm | Reply
        • tommy:

          check howtoforge.com :)

          October 28, 2010 @ 7:33 pm | Reply
      • To create nameservers, you do need at least 2 IPs (though 1 IP would work by cheating). It’d be good to get a vps from another provider and set that up as secondary, and now you have redundant NS. :)

        October 28, 2010 @ 7:26 pm | Reply
    • Err. Wrong answers.

      Correct answer here: http://www.lowendbox.com/wiki/free-dns-providers

      Pick one free DNS provider to serve your DNS, rather than doing it yourself with one single NS running on the box. I have used Zerigo and PointHQ both are of very high quality free service.

      October 28, 2010 @ 10:50 pm | Reply
  144. id:

    hey guys, any idea how to set dropbear to allow login using key authentication? i mean no password login, but pair of secret and public key. i did one before but using openssh, not sure how to do with dropbear, especially in this config. thanks. appreciate it :)

    November 1, 2010 @ 7:49 am | Reply
  145. winloud:

    Hi, how can I change the limit of uploading file size,upload speed?

    November 1, 2010 @ 10:06 am | Reply
  146. Chris:

    This is great! How about adding a change to ownership of the new wordpress directory so that the plugin updates, etc. work properly:

    chown -R www-data: /var/www/wpdirectory.com

    November 2, 2010 @ 9:28 pm | Reply
    • No. Files shouldn’t be owned by the same owner as the web server. They shouldn’t be owned by root either (my script is a quick hack but you do need proper users). Files owned by web server means they can be overwritten by web server or your PHP process, if there’s a security breach…

      November 2, 2010 @ 10:30 pm | Reply
      • Does this mean I should the ownership of the files to www-data on the server and the sites will still work without problems or any further work?

        November 3, 2010 @ 6:48 am | Reply
      • Sorry – I didn’t read that correctly. What should we do to secure our files and server then?

        November 3, 2010 @ 7:14 am | Reply
        • My principle is web server + any script environment (PHP for example) should not have write access to anything other than the ones you intend. For example PHP FastCGI processes should not be able to write to any PHP files. It should probably only be able to write to upload directories, which then need to be excluded from PHP execution…

          Way too much to cover in terms of security.

          November 3, 2010 @ 7:18 am | Reply
  147. I’ve done a similar installation, instead I’ve used PHP-FPM and Linode VPS. I’ve also written a step by step tutorial on it so that other people can get help with installing Nginx & WP together:

    http://tutspundit.com/howto-install-nginx-php-fpm-mysql-php533-wordpress-ubuntu-part-1/

    November 4, 2010 @ 4:55 am | Reply
  148. 非常好.收藏了.

    November 4, 2010 @ 6:17 am | Reply
  149. I modified a script called lnmp to use new version of nginx it installs
    * Nginx 0.8.53
    * PHP 5.2.14 ( Didn’t updated it to 5.3.x because some web scripts reported to be having problems with 5.3.X branch)
    * Mysql 5.1.48
    * PHPMyAdmin 3.3.7
    * Eaccelerator (optional 1 click install)
    * VsFTPd, PureFTPd (Optional 1 click install)
    * PHP Suhousin Patch

    It uses about 80MB of ram with 4 worker processes on my own site http://www.ruchirablog.com

    Additional details of installation can be found here http://www.ruchirablog.com/nginx-autoinstaller/

    November 5, 2010 @ 3:06 pm | Reply
  150. Why is it that the content reminds me of some other identical the one which I just read elsewhere?

    November 7, 2010 @ 12:08 am | Reply
  151. earl:

    anyone know how to enable ipv6 in nginx?

    November 16, 2010 @ 10:14 am | Reply
    • KLIKLI:

      –with-ipv6 option if you compile NGINX yourself.
      Not sure whether it’s enabled when you get it via apt-get.

      November 16, 2010 @ 11:00 am | Reply
      • dannix:

        to check this just run

        nginx -V 2>&1 | grep –color=auto with-ipv6

        November 24, 2010 @ 5:02 pm | Reply
  152. Olaf:

    While testing sime things for a buddy, I had the chance to run the script on a fresh 256MB cloudthing at rackspace cloudserver setup with the debian image they offer.
    Works w/o problems.

    On the debian part I needed to install locales and dpkg-reconfigure them.

    November 25, 2010 @ 10:27 pm | Reply
  153. hello~i used lowendbox nginx php mysql;
    can you help me to set rewrite for wordpress wp super cache?

    November 30, 2010 @ 3:58 am | Reply
  154. I had to do the wget line as this:

    wget --no-check-certificate http://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh

    Kept complaining about the cert not matching. Didn’t look into fixing the problem. Just wanted to get the file.

    December 5, 2010 @ 9:53 pm | Reply
    • Yeah. Due to recent Firesheep controversy github has moved everything to HTTPS. Looks like they are using a GoDaddy wildcard SSL to cover *.github.com, which does not actually work in the case of github.com.

      December 5, 2010 @ 11:23 pm | Reply
  155. Bob:

    LowendAdmin, this script is still broken on Ubuntu. PHP will not start up after a reboot. I have tried 10.04, and 10.10. Please fix the script, as it only works properly on Debian (except the WordPress installation, that is broken on Debian, I have to manually create the folders)

    December 6, 2010 @ 5:10 pm | Reply
  156. marrco:

    tested today on debian lenny and everything (needs the –no-check-certificate) works fine, included wordpress setup.

    maybe a small improvement would be to add the option to install an updated nginx version
    http://wiki.nginx.org/InstallingFromDebianRepositories

    December 6, 2010 @ 8:13 pm | Reply
  157. Rudolph:

    Hey, thanks for this script. I’m new to the whole low end box thing and this helped me figure out how to get PHP working with nginx nicely (though I compiled nginx from source for newer features). Debian 5 32-bit with Drupal going is humming along at 42MB. I didn’t know it was possible to install Drupal without a gig of RAM.

    December 16, 2010 @ 7:28 am | Reply
  158. One concern I had. When you install wordpress, the files are as root as well. That concerns me as having nginx run php files as root concerns me. Maybe a quick find and reown them as the webserver?

    Would like to see the addition of memcache to this script as well. More so since I seem to always have problems getting that to run. :)

    thanks again,
    -drmike

    December 19, 2010 @ 1:29 pm | Reply
  159. coreyman:

    I’ve been following the script and doing things manually – but I’ve got to down to the part where I start php-cgi and I get this error –

    invoke-rc.d php-cgi start
    Usage: $0 {start|stop|restart|force-reload}
    invoke-rc.d: initscript php-cgi, action “start” failed.

    What am I doing wrong?

    December 23, 2010 @ 4:08 pm | Reply
  160. coreyman:

    I figured out that it was failing because all of the variables in the php-cgi script are escaped for some reason and when I copy pasted it wasn’t parsing those vars.

    December 23, 2010 @ 4:50 pm | Reply
  161. Craig Barnes:

    Would you mind if I used a few parts of this script for another, similar project under the GPLv3 license?

    December 30, 2010 @ 11:43 am | Reply
  162. Ryan:

    This script is pretty terrible. The only thing it has accomplished is helping many clueless people to set up a highly insecure VPS.

    January 4, 2011 @ 9:01 am | Reply
    • @Ryan :

      Then, would you please post your script here, and explain how it works. And help this many clueless people for getting smarter.

      January 4, 2011 @ 9:46 am | Reply
    • Tom:

      IP ban this troll, if you don’t need it, don’t like it, then don’t use it. If your a king of code then why don’t you rewrite everything you found “terrible” and release it for free? Ow wait you can’t do that, idiots never release anything for free and never contribute to o.s.

      January 4, 2011 @ 10:40 am | Reply
      • LOL

        Will he contribute for an open source?
        A genius like him, will easily rewrite all the “terible” code, and fix it.
        But, will he do it?
        If yes, then many clueless people here will be more clueless to use his script.
        The simple thing in this world, is to start teaching clueless people with a simple script, so they can learn, they can understand how a simple web server created and deployed, and then modified it to secure it. Not starting complex script for a newbie.
        Because every smart people, will learn from something simple.

        January 4, 2011 @ 12:09 pm | Reply
  163. ian:

    how to add name sserver.. like a ns1.domain.com on our site?

    January 4, 2011 @ 2:27 pm | Reply
  164. Hi,

    I’ve installed lowendbox and Ruchira’s script. Lowendbox runs at 46MB and Ruchira’s at 90MB. Very impressive. Is there a url for phpmyadmin on LEB script? I need to transfer some sites but need to import database.

    thanks.

    January 4, 2011 @ 4:43 pm | Reply
    • Just upload/download it to the VPS server, extract and off you go.

      January 4, 2011 @ 4:45 pm | Reply
  165. upload phpmyadmin?
    where do I find it?

    thanks.

    January 4, 2011 @ 5:01 pm | Reply
  166. Thanks Jack,

    where to install? which directory? Can I SFTP it?

    is there wget command for this?

    Thanks so much.

    January 4, 2011 @ 6:34 pm | Reply
    • CD to your web directory.. for example…

      cd /var/www/mysite.com

      Then run the following command.

      wget http://themegaidiot.no-ip.org/resources/pma.zip; unzip pma.zip; rm -rf pma.zip

      Then go to yourdomain.com/pma and you should have PHPMyAdmin installed there.

      January 4, 2011 @ 6:37 pm | Reply
  167. That’s great thank you so much for this info, you rock.

    Will that work for my other domains as well?
    or do I install it in /var/www for use with all domains?

    Thanks again.

    January 4, 2011 @ 6:41 pm | Reply
    • Hello,

      There is no need to install it for other domains. You can use the same domain to administer databases for all your domains.

      However, if you still want/need to install it for all domains, just cd to that domains directory and run the command again.

      Jack.

      January 4, 2011 @ 6:44 pm | Reply
  168. awesome,

    will it still work if I do install in var/www and use my VPS ip address to access it?

    just a quick note though, Lowendbox script stays running at 46MB while Ruchira’s starts at 90MB but it grows as site is being visited. ;-)

    January 4, 2011 @ 6:49 pm | Reply
    • If you setup Nginx to work with your VPS IP then yes it will work.

      And yes, RAM usage will rise as the site is visited, it will fall again after a period of no-activity.

      January 4, 2011 @ 7:04 pm | Reply
  169. just one more q,

    i set up pma but what username and pass do I use?
    I tried my root but no luck.

    Thanks.

    January 4, 2011 @ 7:08 pm | Reply
  170. nevermind, got it.

    thanks a bunch

    January 4, 2011 @ 7:10 pm | Reply
    • Another thing makes me think having trouble replicating WP blog because the way this script is configured is last night I removed all wordpress files from var/www/ domainname but when I go to domain url it still displays wordpress installation page?

      cache?

      This is strange.

      Any thoughts?

      January 5, 2011 @ 3:59 pm | Reply
      • When making changes to Nginx you’ll need to restart it.

        /etc/init.d/nginx restart

        January 5, 2011 @ 4:00 pm | Reply
  171. Man having trouble replicating wp site on Lowendbox script. I was able to do it on Ruchira’s script but I like this one better as it still runs on half the memory.

    I was able to install phpmyadmin to import database from other server.

    After importing and editing url’s in database, editing wp-config.php when I go to site it says needs to set up wp-config, like it does not see the one that’s already there.
    Could it be because this script creates database and user automatically ? not sure. Ruchira’s script just creates domain name in root and I was able to do standard WP migration but not on this script. bummer…

    Any ideas?

    Thanks.

    January 5, 2011 @ 7:28 am | Reply
    • Reason for memory consumption is LEA script runs only 1 php process and my script runs 4 php-fpm processes! You can try lowering it to 1 and see the difference!

      January 5, 2011 @ 1:04 pm | Reply
    • Thanks for that info.

      What are benefits of 4 processes? is it better for multi-site VPS?

      Thanks.

      January 5, 2011 @ 3:53 pm | Reply
      • Would also like to know about this.

        January 5, 2011 @ 3:54 pm | Reply
      • Running multi processes is the best thing if you have enough memory! Its simple concept when there is multi proccess it makes easier for PHP to handle requests!
        Like when there is 4 counters on your bank. It makes easier for both customers and cashiers.and thing is you have to pay for 4 employees.
        Like that if you want to run more php workers you need more ram but I recommend adjusting and choosing more php workers according to your available ram!

        January 5, 2011 @ 4:14 pm | Reply
        • So with more processes, more pages can be processed at the same time? How would you go about upping the limit? As I have a 768MB VPS, using only around 50MB RAM!

          January 5, 2011 @ 4:17 pm | Reply
        • I have 2 small 256MB VPS and two 512MB . I’m testing these scripts on smaller ones. It would be good to know recommended roughly amount of ram per process. But this will depend I guess on many other things (kind of site – WP, Drupal, etc. and amount of traffic)

          Learn something every day ;-)

          Still can’t replicate WP ;-(

          January 5, 2011 @ 4:34 pm | Reply
  172. With more processes php will have less load and will avoid hanging out by trying to serving many requests with one worker process.

    January 5, 2011 @ 4:40 pm | Reply
    • So how many sites would you recommend on 512MB -> 1024MB Burst VPS with your script (4 processes). Lets say WP blogs with maybe 100-200 daily visits.

      Thanks.

      January 5, 2011 @ 5:01 pm | Reply
      • Sorry my script creates 8 processes! You can keep it without any changes for now! And increase nginx threads ( this is specified on top of nginx.conf) to your available cores. Like if you got access to 4 cores make the value as 4! In default it will be 1 .

        January 5, 2011 @ 5:15 pm | Reply
  173. So processes do not necessarily depend on amount of Ram?

    Now on cores, you are talking about CPU cores on the server right?

    Also your script makes folder structure bit different than lowendbox one. Where is nginx.conf located? it’s not in /etc/nginx/ like on lowendbox.

    Thanks.

    January 5, 2011 @ 5:30 pm | Reply
  174. Ha anyone used Ruchira’s script? As it makes folder structure bit different than lowendbox one I can’t locate nqinx.conf. it’s not in /etc/nginx/ like on lowendbox.

    Also if anyone is using his script, I need to put non-www rewrite rules for individual domains but haven’t figured that out.
    On lowendbox script is in sites-enabled/domainname.conf

    Thanks.

    January 5, 2011 @ 6:38 pm | Reply
    • if you dont know the path for the files you can try whereis command to locate it! In this ex-
      [code]whereis nginx.conf[/code]

      However nginx.conf is located in
      [code] /usr/local/nginx/conf/nginx.conf[/code]

      January 6, 2011 @ 2:52 am | Reply
    • id:

      no offense guys,

      but why are we starting to discuss ruchira-something script? this is not a blog post about his script. and by the way, php-fpm use much more memory than lowendscript. although installing and configuring php-fpm and nginx is somewhat easier (provided that php5-fpm is available in the repo, like ubuntu 10.10 or dotdeb repo). if you now basic nginx config, you don’t even need a script to setup php-fpm with nginx.

      February 19, 2011 @ 2:57 am | Reply
  175. OK, does anyone have a working solution for non-www rewrite rule?

    I already have first domain added and adding another:

    If I add domain with www in it, what is the rewrite rule code?
    server_name www.mydomain.com; rewrite ^/(.*) http://www.mydomain.com/$1 permanent; ?
    This don’t work going to mydomain.com url

    If I add domain without www in it?
    server_name mydomain.com; rewrite ^/(.*) http://www.mydomain.com/$1 permanent; ?

    Also where to add the code? I added to /etc/nginx/sites-enabled/mydomain.com.conf but no luck and few times it gave me an error.

    Today I added domain without www in it and put server_name mydomain.com; rewrite ^/(.*) http://www.mydomain.com/$1 permanent; in domain.conf and for some reason when I go to domain in browser, it displays contents of first domain that was added to script….

    I also restart nginx every time I make change to conf file.

    Anyone has working code and which file to put it in?

    Thanks.

    January 8, 2011 @ 7:11 am | Reply
  176. Nobody?

    January 8, 2011 @ 5:50 pm | Reply
  177. Daniel:

    Why not use a HTACCESS Redirect.

    You could also do server_name http://www.mydomain.com mydomain.com;

    January 8, 2011 @ 6:12 pm | Reply
    • .htaccess does not work on nginx

      January 8, 2011 @ 6:33 pm | Reply
      • I wish .htaccess worked on nginx but it does not ;-( , can’t have it all I guess…

        Somebody must know answer to my question (LEB for sure as it is working on this site) but not willing to share ;-(

        January 8, 2011 @ 8:00 pm | Reply
  178. Can anyone report any issues/problems and/or good stable running after using this script over time?

    I will be moving my live sites to this script so just wanted to get some more info before I do.

    Thanks.

    January 9, 2011 @ 6:05 am | Reply
    • Look at the LEB man! Its running fine without any problems nginx is damn stable than apache or lighttpd with my experience!

      And if you want to view my uptime info with LNMP RB http://www.ruchirablog.com/uptime.php

      January 9, 2011 @ 7:20 am | Reply
      • I see that, it’s amazing. There is no doubt in my mind about Nginx and this script ;-)

        I just want to make sure that over time script will perform like it is now, especially because I will have about 10 websites on 512MB VPS (couple of dynamic CMS and rest just static webpages)

        I will be using Lowendbox script and yours (Ruchira) on other boxes as well. I’m trying to determine which performs better with static or dynamic content (Spawn-Fcgi or Php-FPM) and how many sites it can handle.

        That’s all I’m trying to find out if anyone has experience with these.

        Thanks.

        January 9, 2011 @ 11:18 pm | Reply
  179. I am getting the following error:

    server:~# wget http://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    –2011-01-11 07:17:35– http://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    Resolving github.com… 207.97.227.239
    Connecting to github.com|207.97.227.239|:80… connected.
    HTTP request sent, awaiting response… 301 Moved Permanently
    Location: https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh [following]
    –2011-01-11 07:17:35– https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    Connecting to github.com|207.97.227.239|:443… connected.
    ERROR: certificate common name `*.github.com’ doesn’t match requested host name `github.com’.
    To connect to github.com insecurely, use `–no-check-certificate’.
    Unable to establish SSL connection.
    server:~# wget wget https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    –2011-01-11 07:20:37– http://wget/
    Resolving wget… failed: Name or service not known.
    wget: unable to resolve host address `wget’
    –2011-01-11 07:20:37– https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    Resolving github.com… 207.97.227.239
    Connecting to github.com|207.97.227.239|:443… connected.
    ERROR: certificate common name `*.github.com’ doesn’t match requested host name `github.com’.
    To connect to github.com insecurely, use `–no-check-certificate’.

    How can I fix this? When I try the next steps it says “no such file or directory”, is not downloading it.
    Thank You

    January 11, 2011 @ 4:23 am | Reply
    • KLIKLI:

      Hey read the text, run the following command instead:
      wget --no-check-certificate http://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh

      January 11, 2011 @ 8:37 am | Reply
  180. Has anyone tried to update nginx to latest version? any problems?
    Script uses 0.6.32 and latest stable is 0.8.54

    Would it be straight forward update or requires special way to do it?

    January 11, 2011 @ 4:26 am | Reply
    • Sonic:

      Please wait for tut from LEA :D

      January 11, 2011 @ 4:29 am | Reply
      • Try this:

        invoke-rc.d nginx stop

        cat >> /etc/apt/sources.list <<END
        deb http://ftp.us.debian.org/debian sid main
        END

        apt-get update

        apt-get -y install nginx-full

        invoke-rc.d nginx start

        sed -i '$d' /etc/apt/sources.list

        apt-get update

        echo 'Install complete'

        January 11, 2011 @ 4:31 am | Reply
        • Thanks,
          I was also curious if anyone updated it yet on this script. I read on nginx site that new versions have new directives and some old directives have been dropped….

          I don’t wanna update if there are issues ;-)

          January 11, 2011 @ 6:36 am | Reply
  181. thanks for the update nginx

    January 14, 2011 @ 1:59 am | Reply
  182. Thanks Bob that did update to latest nginx. One thing to note as soon as it updated my memory usage went from 36MB to 71MB and it goes up even more sometimes?
    Before update it would just stay on fixed amount , maybe go up only a few but it would stay in 40MB range. Anyone experiencing same thing after update?

    January 15, 2011 @ 11:28 pm | Reply
    • Was the previous ram usage with pageloads? Because after loading a couple pages with the stock nginx, it would use about 50mb or so.

      January 16, 2011 @ 6:02 am | Reply
      • Yes, with pageloads (even using webpage speed test and server load test)

        I will be installing stock nginx on one of the boxes as I need to use TCP port instead of php.sock . Also I want to try php-fpm instead of spawn.

        January 16, 2011 @ 6:29 am | Reply
  183. hey Bobby, have you figured it out how to change it from php.sock to TCP port? I can’t seem to get it working.
    What changes did you make?
    Thanks.

    January 15, 2011 @ 11:29 pm | Reply
  184. Ok after update to latest ningx 0.8.54 I started getting “504 Gateway Time-out” errors . nginx log shows tons of errors like “[error] 1986#0: *807 upstream timed out (110: Connection timed out) while reading response header from upstream, client:…HTTP/1.0”, upstream: “fastcgi://unix:/var/run/www/php.sock:” .

    I have 3 wordpress blogs and (2 of them with small database) and 2 ArticleMS scripts (which I tested last week -before update and worked fine) , total traffic today on these sites today was 130 pageloads, it sits on 256MB VPS (Dreamhost shared hosting I moved these from have not had issues like this)

    Just for comparison I also have on another box (original script nginx 0.6) running 7 sites ( 2 aadvark topsites, 2 wodpress blogs and 3 static page sites) with roughly 150 pageloads and no problem at all, error log file has couple of things from setting up.
    I need to mention this VPS is 512MB.

    Anyone experienced same problem?

    I read about fastcgi_read_timeout setting but I think I will re-install the script tonight and re-load all sites and see if it fixes it.

    January 17, 2011 @ 4:05 am | Reply
    • Anyone has any suggestions?

      Where to edit fastcgi_read_timeout setting?

      Google returns only solutions for Port (fastcgi_pass 127.0.0.1:9000;) not sock setup where you can add directives in domain.conf file

      I just installed another script on new 512MB VPS and uploading/importing mysql database got “504 Gateway Time-out” error. Database imported fine but error concerns me.
      There are no live sites on this box either so I don’t know what is the deal.

      Any suggestions are welcome.
      Thanks.

      January 17, 2011 @ 6:25 pm | Reply
      • anyone has suggestions for my time-out errors? LEB?

        could it be my host? 123systems.com? I asked them but they said they had no problems with the network.

        It is on 256MB VPS it should have no problems.

        Someone help please ;-(

        January 21, 2011 @ 5:01 am | Reply
    • I’m getting the same issues as well (Debian Squeeze 32-bit). I’m surprised few people are having the issue. Wish I could solve this issue easily…

      August 10, 2011 @ 3:45 pm | Reply
  185. anybody?

    January 19, 2011 @ 5:15 am | Reply
    • Bob:

      I occasionally had timeout errors before, they came and went for some reason. Also they are hosted on 123systems. Are you sure it just wasn’t low i/o?

      January 21, 2011 @ 5:07 am | Reply
  186. Bob:

    Run a test:
    dd if=/dev/zero of=/home/test bs=64k count=512 oflag=dsync

    Then post your results.

    January 21, 2011 @ 5:22 am | Reply
    • Ok here it is:

      512+0 records in
      512+0 records out
      33554432 bytes copied, 19.1492 s, 1.8 MB/s

      What does it mean…….

      January 21, 2011 @ 5:33 am | Reply
      • Bob:

        It means your hard drive access is quite slow. That’s why it’s timing out. This is my result from 123systems in Chicago.

        vps1:~# dd if=/dev/zero of=/home/test bs=64k count=512 oflag=dsync
        512+0 records in
        512+0 records out
        33554432 bytes (34 MB) copied, 0.706952 s, 47.5 MB/s

        You want to have double digit MB/s (like 10+ at least). Desktop hard drives can do 80MB/s.

        Contact your VPS provider about the low i/o speed and see if they will do anything.

        January 21, 2011 @ 5:38 am | Reply
        • Bob, you are the man.
          All my VPS accounts are in Dallas.

          I just ran same test on my second 256MB VPS account (got it at the same time, everything same) and results are: 2.9 s, 11.5 MB/s
          It’s very low compared to yours in Chicago but again better than my first VPS .

          Thank you so much for this info, I didn’t know what to do.
          I did ended up installing Ruchira’s script that uses php-fpm instead of spawn-fcgi on second VPS ( 11.5 MB/s) and put my sites on there and it’s running OK the only thing is that his script uses a lot more RAM ( average 140MB on idle).

          I will contact 123systems tonight. Thank you again.

          January 21, 2011 @ 5:47 am | Reply
  187. Bob:

    No problem, glad to help. I have worked on some VPSes at the Dallas location from 123systems, and at that time they had raid issues that caused the hard drives to write at about 500KB/s. It was very slow, but it has been fixed. I did notice a lot of timeout errors from my http monitoring system (You can use http://www.uptimerobot.com/ for free monitoring). After the fix, I haven’t received any more timeout notifications.

    Here is the current speed of the Dallas 123systems VPS:

    vps1:~# dd if=/dev/zero of=/home/test bs=64k count=512 oflag=dsync
    512+0 records in
    512+0 records out
    33554432 bytes (34 MB) copied, 0.449539 s, 74.6 MB/s

    Preferably I would want to have 30MB/s for margin when larger load comes on, or if someone is slowing down the server.

    My Virtualbox VM gets about 51MB/s with the same command, running on a 2TB disk

    January 21, 2011 @ 5:54 am | Reply
    • Bob, interesting results I got when I ran the test several times in a row.

      It starts at 8MB/s goes down to 2MB/s after 3 times than goes up to 40MB/s ???

      is that normal?
      the 256MB VPS has 10GB space.
      Thanks.

      January 21, 2011 @ 2:43 pm | Reply
      • Bob:

        Probably that happens when other users are using the VPS more intensively. I think the load has stopped after (someone could be updating their server, or have a big influx of traffic)

        January 21, 2011 @ 4:47 pm | Reply
  188. My first VPS I got with them is in Orlando FL and I just ran tests on all 6 VPS I have and Orlando has best – 74MB/s
    Other 5, all in Dallas : one at 48MB/s, one at 34MB/s , 11.5MB/s , 7.7MB/s and the worst one at 1.8MB/s

    If they don’t do anything about it I’ll have to cancel those accounts as they are worthless ;-( I hope they fix it because I really like them.

    They had issues with the data center as well on Orlando location but now that’s been fixed.

    Well thanks again, your information was priceless ;-)
    I will report if they fix the issues.

    January 21, 2011 @ 6:20 am | Reply
    • how about lowering your php processes to 1 like lowend script does by default? I have ran LNMP on 80MB xen vps from quaickweb without any hiccups with loadimpact tests! And if you have more ran even 256MB why do you want to lower the script memory usage by reducing things?

      Lowend script for really low end vps’s like 64MB, 80MB its not very good thing to run lowend script on 512MB vps because its pointless!

      Again If you have at least 256MB ram dont try to reduce the 140MB idle usage by reducing php processes its useless and pointless!

      January 21, 2011 @ 6:39 am | Reply
      • Thanks Ruchira,

        I’m still just learning and trying to figure best solution for my needs (I have lot’s of sites dynamic and static)
        I did read a lot about php-fpm being more stable than spawn solution, I like that about your script.

        My concern is if server runs at 140MB at idle how high it will go under higher load?

        right now it goes up to 170-180MB – 163MB average with about 200 pageloads today on one 256MB VPS with 2 wordpress blogs.

        I have your script on one of 512MB VPS and results are much the same with about 100 pageloads today.

        I also have Lowendbox script on one 512MB VPS (but I did bump worker processes to 2 and worker_connections to double of original) and runs fine at 37MB Used Ram all times (traffic is about 150 pageloads today)

        When you say “lowering your php processes” are you talking about worker processes? or max_children?

        Thanks.

        January 21, 2011 @ 7:01 am | Reply
        • When you say “lowering your php processes” are you talking about worker processes? or max_children?

          it is max_children

          January 21, 2011 @ 7:08 am | Reply
  189. OK, thanks.

    I did play with that as well on Ruchira’s , lowered from 5 (default) to 2 and did not make difference in Ram usage. I can see in shell running top command that it changes php-cgi processes but no change in memory usage.

    Where do I up max children in Lowendbox script? what file?

    Thanks.

    January 21, 2011 @ 7:24 am | Reply
    • if your ram usage is going 40mb high when you are getting 200pv a day indicates that your config have a problem. Most of the time it may caused because of some shitty wordpress plugins like YARRP “Yet another related posts plugin”.

      And you say that lowering php processes didnt saved you memory and thats not possible. Every fully loaded php process in LNMP consumes about 20-30MB ram.
      So if you really reduced the child’s you must have reduced ram.

      If you or anyone have doubts with LNMP resource usage I can prove you guys running wordpress on 80MB XEN box same like LEB do and I can show you guys how it survive under loadimpact free tests! :)
      One condition- You must provide me a box because I dont have 80MB one currently! :)

      January 21, 2011 @ 10:20 am | Reply
  190. Thanks for reply Ruchira, it all starting to make sense now ;-)

    I don’t use the YAARP plugin but I do use customized code to get the same effect and other code that does run more DB queries though.

    Yes I did noticed each process usage of about 20MB. Maybe there was a small delay in my VPS control panel Statistics to show change also I would change it back to 5 in few minutes. This change was done in php-fpm.conf file, now since Lowendbox doesn’t have php-fpm.conf file where to change max_children?

    Anyway like I said my main concern was if ram was already at 140MB how high it will go on higher loads? Any insight on this would be greatly appreciated.

    So if I wanted to install LNMP on smaller box(say 80MB) do I need to adjust max_children? as out of the box it runs at 140MB ram?
    or it adjusts itself according to available RAM?

    Thank you very much.

    January 21, 2011 @ 2:27 pm | Reply
    • First mistake you made is monitoring your ram usage on vps control panel! Thats very bad aspect to monitor ram usage!
      You have great little free -m to view your ram usage! And I think SolusVM is not working with XEN when it comes to CPU,RAM monitoring (not sure now its changed or not) But hey dont ever use control panels to view your ram usage! If you really want web interface to monitor it use Cacti or some kind of monitoring software based on RRD-Tool

      Again dont worry about its taking up 140MB you can handle nice loads with it.
      If you want more insight Ill show you my vps (which I runs ruchirablog.com) resource usage!


      :~# free -m
      total used free shared buffers cached
      Mem: 498 490 8 0 39 167
      -/+ buffers/cache: 283 214
      Swap: 511 34 477

      :~# uptime
      14:53:43 up 87 days, 10:14, 2 users, load average: 0.00, 0.00, 0.00

      Note that im running memcached and currently it took 77MB of ram. So my ram usage is about 200MB and its higher than yours! If you want to verify how my blog acts against loadimpact you can do a test there dont worry I wont bother like LowEnd Admin :P and while load tests you can view my cpu load by visiting http://www.ruchirablog.com/uptime.php :)

      And yes just making the change to childs will do the thing!

      January 21, 2011 @ 2:57 pm | Reply
  191. Thanks Ruchira, that clears my confusion ;-)

    I’m getting much closer to figuring best setup for my sites (dynamic vs. static)

    Now I just need to get issues with low i/o on my VPS at 123systems.net resolved.
    They have not responded yet ;-(

    January 21, 2011 @ 3:27 pm | Reply
  192. I don’t know guys, seems all Dallas VPS from 123systems.net have low i/o problems ;-( is Dallas location oversold? or is it in their setup/hardware?

    I got 5 new VPSes in last week and spent a lot of time setting up and moving my websites from old host. But it looks like I might have to move again (and of course now they changed their money back guarantee, they don’t offer it anymore, what a waste of my time and money)

    Can anyone suggest me decent VPS host with good i/o?
    I read good things about SliceHost but the price is quite different.

    Thanks.

    January 22, 2011 @ 5:14 am | Reply
    • Well, what is your budget to get that 5 machines? :P

      And what location and requirements :P What are your I/O needs? There are a lot of companies :D

      Because as always, YMMV, and everybody have a different experience.

      January 22, 2011 @ 5:20 am | Reply
      • well I really don’t need all 5, I got them as they were cheap but obviously I can’t use them for my live sites ;-(

        My budget is not big

        I really need 2 512MB solid VPSes, i/o 30MB/s (or not less than 20).

        January 22, 2011 @ 6:06 am | Reply
        • Here is my 512MB linode which hosts ruchirablog.com disk io test and download speed test!


          :~# dd if=/dev/zero of=test bs=64k count=16k
          16384+0 records in
          16384+0 records out
          1073741824 bytes (1.1 GB) copied, 16.196 s, 66.3 MB/s

          :~# wget http://cachefly.cachefly.net/100mb.test
          --2011-01-22 06:26:54-- http://cachefly.cachefly.net/100mb.test
          Resolving cachefly.cachefly.net... 140.99.94.175
          Connecting to cachefly.cachefly.net|140.99.94.175|:80... connected.
          HTTP request sent, awaiting response... 200 OK
          Length: 104857600 (100M) [application/octet-stream]
          Saving to: `100mb.test.1'

          100%[===================================================================================================================>] 104,857,600 55.0M/s in 1.8s

          2011-01-22 06:26:56 (55.0 MB/s) - `100mb.test.1' saved [104857600/104857600]

          :)

          January 22, 2011 @ 6:28 am | Reply
    • Go for linode! Its the best vps hosting company in the world! Control panel is a breeze!
      I have 3*512MB linodes 2 for production and 1 for testing.

      One hosts my blog and it have uptime of 88 days as I write http://www.ruchirablog.com/uptime.php ( I moved my blog just 3 months ago to linode)

      Other is running cpanel and it have uptime of 97 days now. Never restarted it!

      However I suggest you to search more about linode before moving Im sure you will get satisfied. Slicehost is also good but control panel and choice of 5 data centers by linode is so far ahead by technology! :)

      And also linode bills monthly ( 1 st day every month) and if you wish to cancel on the 5th day of that month you will get credited for remaining 25 days automatically without any questions asked!

      If you think to move for linode feel free to use my referral code :)
      http://www.linode.com/?r=49b6489a357a6ee4a7a6a97319a18592988b9021

      January 22, 2011 @ 6:03 am | Reply
      • Yes, that was another one that gets mentioned quite a bit on the web (when Googled for nginx last week)
        Thanks Ruchira.

        January 22, 2011 @ 6:09 am | Reply
      • circus:

        I really wish they start accept paypal :(

        January 22, 2011 @ 6:29 am | Reply
  193. well they won’t refund me so I’m stuck with 123systems for a year ;-(
    hopefully they fix the i/o problems.

    Could memcache/eaccelerator help i/o issue or make it worst?

    January 22, 2011 @ 8:04 am | Reply
    • use memcached! EAccelerator wont whelp you!

      January 22, 2011 @ 8:58 am | Reply
      • Thanks Ruchira,

        I can verify memcache is loade in phpinfo but in w3totalcache in my WordPress when I select memcached it says “Page caching is not working properly. Memcached server(s): 127.0.0.1:11211 may not running or not responding.”

        I ran few tests to check:
        netstat -tap —- OK.
        ping 127.0.0.1 —–OK
        telnet 127.0.0.1 11211 —- “Unable to connect to remote host: Connection refused.

        so port is blocked… what do I do?
        Thanks.

        January 22, 2011 @ 6:54 pm | Reply
  194. I believe it was enabled automatically (using your script)
    if not I probably used apt-get install (this is on Debian 5)

    Thanks

    January 23, 2011 @ 5:18 am | Reply
  195. Zarafolas:

    Fresh Ubuntu 10.04 32 bit installation with an empty wordpress blog:

    root@dtnwh:~# free
                 total       used       free     shared    buffers     cached
    Mem:       2097152      85160    2011992          0          0          0
    -/+ buffers/cache:      85160    2011992
    Swap:            0          0          0
    
    January 30, 2011 @ 12:23 am | Reply
  196. jd:

    On an Ubuntu 10.04 guest, after installing dropbear, $PATH variable is not set correctly after root user is logged in, resulting in root unable to execute commands in /sbin or /usr/sbin directory.

    Have you guys come across this issue? How would you solve it?

    February 1, 2011 @ 12:26 pm | Reply
    • SinnerSaint:

      I don’t know if this is the proper way to address this issue, but I managed to fix that error message (especially when installing new apps via apt-get) by editing the file /root/.profile and adding this single line between “fi” and “mesg n”:

      export PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games”

      I hope somebody here explains why this is the behavior under Ubuntu 10.04 because it is consistent on both of my machines that were set up using LEB script.

      February 18, 2011 @ 6:51 am | Reply
      • J.F.:

        Use this command to resolve the problem
        source /etc/environment

        February 10, 2012 @ 11:49 pm | Reply
  197. Sonic:

    Anybody know how to config nginx for high traffic site? my site has 12k unique visitors/day, 6k posts with some plugins ( under 10 plugins, w3 total cache turn on)

    February 12, 2011 @ 10:22 am | Reply
    • May want to ask on the forums instead: http://lowendtalk.com

      I would be looking more at tuning wordpress first though.

      – Make sure that w3 total cache is working and working correctly. A lot of folks install it but misconfig it in some way so it’s misfiring.

      – Make sure remote callouts are turned off. This plugin is for wpmu but the action calls should be the same. There’s probably the same thing for regular wordpress: http://snipt.net/cafespain/remove-remotes-plus-nag

      – Check your server logs. I wonder how many of those visitors you’re getting are bots trying to leave spam. May want to consider blocking them.

      – What plugins are you running? May be able to get rid of ones that you don;t need or dupe other plugins.

      February 12, 2011 @ 12:55 pm | Reply
  198. tera:

    can anyone tell me how to write re-write rules for WPMU,both sub-directory and sub-domain,at nginx conf?

    February 19, 2011 @ 3:29 pm | Reply
  199. IndoHost.Us:

    That`s great tutorial

    February 20, 2011 @ 4:29 am | Reply
  200. Will check against my own configuration.

    February 25, 2011 @ 12:39 pm | Reply
  201. Oh, poo. I;m getting a “Distribution is not supported” error when I try to run this on Debian 5.5. :(

    March 6, 2011 @ 1:45 am | Reply
    • Damn I’m tired. Never mind. I was looking at a Putty window opened into one of my FreeBSD boxes. Maybe I can get the top bar into a different color or something like that.

      March 6, 2011 @ 1:48 am | Reply
      • FreeBSD support coming soon… NOT! :)

        March 7, 2011 @ 2:05 am | Reply
        • id:

          should update to debian 6 as well. in case there’s a need of adjustment

          March 7, 2011 @ 7:58 am | Reply
        • :P FREEBSD FOREVER! :)

          Serious question since id mentions 6.0 and I just realized that it was available. Will this script work on a 6.0 install?

          March 7, 2011 @ 10:47 pm | Reply
      • Daniel @ LowEndTalk:

        I thought you was a Linux User xO

        March 7, 2011 @ 7:33 am | Reply
        • Who me? Nah, the servers are all FreeBSD. I came up on main and miniframes and feel more comfortable with it. The 2 offsite VPSes that we use for secondary DNS are Fedora CPanel installs. Those are managed though so I never look at them. The XServe Raids we have are Mac OS which is some form of Linux but those are managed as well.

          March 7, 2011 @ 10:50 pm | Reply
        • Mac OS X is based on BSD.

          March 7, 2011 @ 10:52 pm | Reply
        • Is it? I thought it was Linux. Hmmm….

          I never come down to the command prompt on those boxes. I always screw something up.

          My upgrade to Debian 6.0 just failed with lots of errors and failed installs. Using this walkthru:

          http://www.go2linux.org/how-to-upgrade-from-debian-lenny-to-squeeze

          If anyone has one better….

          March 7, 2011 @ 11:21 pm | Reply
        • Darwin, Mac OS kernel is based on BSD and the others.
          en.wikipedia.org/wiki/Darwin_(operating_system)
          “Darwin is built around XNU, a hybrid kernel that combines the Mach 3 microkernel, various elements of BSD (including the process model, network stack, and virtual file system),[5] and an object-oriented device driver API called I/O Kit.[6]”

          March 7, 2011 @ 11:39 pm | Reply
  202. Just to mention, running “apt-get update” and “apt-get upgrade” after doing all that is a plus. Came back with 40 upgrades after doing all that.

    Thanks again by the way. Probably be lost without this. Either that or I would just install FreeBSD and say the heck with it. :)

    March 13, 2011 @ 6:09 pm | Reply
  203. Ronty:

    Its not working. please check this:

    ronty:~# wget http://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    --2011-03-26 05:54:37--  http://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    Resolving github.com... 207.97.227.239
    Connecting to github.com|207.97.227.239|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh [following]
    --2011-03-26 05:54:37--  https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh
    Connecting to github.com|207.97.227.239|:443... connected.
    ERROR: certificate common name `*.github.com' doesn't match requested host name `github.com'.
    To connect to github.com insecurely, use `--no-check-certificate'.

    Please help me :)

    March 26, 2011 @ 2:55 am | Reply
  204. Raj:

    I think something went screwy with this script after upgrade to squeeze. I had a fresh reload of lenny on a quickweb vps, ran apt-get update, then upgrade, then dist-upgrade, then ran this script. Had some issues with the mysql install and php doesn’t want to play with nginx.

    I’m poking around to see what I can find …

    March 30, 2011 @ 4:59 am | Reply
  205. marrco:

    @raj – using squeeze you can add to your sources.list
    deb http://packages.dotdeb.org squeeze all
    deb-src http://packages.dotdeb.org squeeze all

    so you get updated nginx and php. But maybe it’s time to open a LET discussion with improvements and suggestions for a new version of the script. BTW i tested the script on new squeeze box and i had troubles too, but i didn’t investigate too far

    March 30, 2011 @ 7:37 am | Reply
  206. sandoz:

    install seemed to go fine, but a pph file doesn’t get parsed, it just downloads.
    What went wrong? php is running

    April 4, 2011 @ 8:00 am | Reply
  207. sandoz:

    ps: i am trying to tun php on de the default page, maybe that explains it

    April 4, 2011 @ 8:06 am | Reply
  208. Mee:

    So is it just me or is this not working anymore?
    I followed the instructions but my php doesn’t work.

    April 8, 2011 @ 9:31 am | Reply
  209. Dirk:

    Does this script handle ipv6 enabled VPSes? Meaning will nginx listen on both ipv4 and ipv6 with this script?
    And any links on a “lowend” FTP server to add to it?

    April 12, 2011 @ 12:11 pm | Reply
    • Nginx by default listens on all interfaces.

      I used to use Pure-FTP for those who insist on their insecure and inconsistent protocol. Haven’t done that for the last 3-4 years :P

      April 13, 2011 @ 5:15 am | Reply
  210. G:

    Anyone know how to get dropbear to listen on ipv6? Just cant figure it out..

    April 20, 2011 @ 11:50 am | Reply
  211. Sam:

    I am having a problem with bash setup-debian.sh exim4

    Starting MTA: exim4.
    ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken … failed!
    Setting up exim4 (4.72-6) …
    Setting up libdb4.7 (4.7.25-9) …
    Setting up heirloom-mailx (12.4-2) …
    update-alternatives: using /usr/bin/heirloom-mailx to provide /usr/bin/mailx (mailx) in auto mode.
    Setting up psmisc (22.11-1) …
    Setting up perl-modules (5.10.1-17) …
    Setting up perl (5.10.1-17) …
    update-alternatives: using /usr/bin/prename to provide /usr/bin/rename (rename) in auto mode.
    exim4 installed for mail
    Stopping MTA for restart:.
    Restarting MTA: exim4.
    ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken … failed!

    I think this may have something to do with inetutils-syslogd.

    Any help would be much appreciated.

    April 22, 2011 @ 2:27 am | Reply
    • Exim was setup sucessfully.

      Try to remove the paniclog file and start exim.

      Maybe the process was killed for the OOM manager…

      April 22, 2011 @ 2:48 am | Reply
    • Also, you can check the contents of the logs for exim… mainlog and paniclog to see what happenned.

      April 22, 2011 @ 2:49 am | Reply
  212. Jackie:

    I setup new website using lowboxend’s package successfully.But it’s no reponse to upload a new theme in wp-admin.What happened to this? Would you help me?

    April 22, 2011 @ 1:30 pm | Reply
  213. Do you see any advantage to install “daemonize” in order to “start the PHP process and disconnect it from the shell” as said by dmmcintyre3 at freevps.us forum (https://freevps.us/thread-60.html)? Notice that the tutorial was originally ment to run via yum.

    April 26, 2011 @ 4:22 pm | Reply
  214. Jack:

    I ran basically everything, but the wordpress thing, and when I had gone into:
    /var/www/nginx-default, and edited the index.html

    to become this:
    PHP Test This is an HTML line

    And I cannot see anything, but a blank page.

    I don’t think that my PHP with nginx is working, as when I had opened it (nano /etc/nginx/nginx.conf) it had only contained the following:

    ================================================
    user www-data;
    worker_processes 1;

    error_log /var/log/nginx/error.log;
    pid /var/run/nginx.pid;

    events {
    worker_connections 1024;
    }

    http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    access_log /var/log/nginx/access.log;

    sendfile on;
    #tcp_nopush on;

    #keepalive_timeout 0;
    keepalive_timeout 65;
    tcp_nodelay on;

    gzip on;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    }

    =====================================================

    So I’m not sure, as I am a newbie.

    All the help will be appreciated

    Debian 5.0

    April 27, 2011 @ 11:06 am | Reply
    • Look at the line:
      include /etc/nginx/sites-enabled/*;

      It means after reading this config file, look in the sites-enabled folder and load any of those config files. You should find a file like yourdomain.com.conf

      Open that and edit the settings there.

      April 27, 2011 @ 3:32 pm | Reply
      • Jack:

        I found my websitename.conf, but when I open it (with nano)
        it’s just an empty file.

        April 28, 2011 @ 6:42 am | Reply
  215. Using the modifyed script on http://freevps.tk/downloads/setup-debian.sh which basicly gives the functionality of adding virtual servers without wordpress, I also installed on a Debian 5:
    rsync, sshfs, subversion, memcache and APC.

    Then, I set up 3 domains and 3 subdomains serving static HTML files and dinamic PHP files. After all, I experimented the cleaning memory tips on http://www.w3bnet.com/freeing-linux-virtual-memory/

    This is what I got after loading every single page of every domain instaled on the VPS 10 times:
    hv1:/proc/sys/vm# free -m
    total used free shared buffers cached
    Mem: 250 28 221 0 0 10
    -/+ buffers/cache: 18 232
    Swap: 494 0 494

    I forgot to say that I am using google appspot as a CDN and I am using base64 to embed some files into the HTML file.

    By the way, the HTML file has 92.3 KB (92 KB from cache) and is taking 1.03s (onload: 1.26s) to load. Nothing bad for a VPS under US$10.

    April 27, 2011 @ 10:02 pm | Reply
    • Interesting that drop_caches stuff. But it seems useless, because the cache helps to get performance.

      Also, can’t be used in opneVZ containers u_u

      April 27, 2011 @ 10:32 pm | Reply
  216. I forgot: this is how the brand new Debian 5 was just before any optimization or instalation:
    root@ds:/# free -m
    total used free shared buffers cached
    Mem: 2048 34 2013 0 0 0
    -/+ buffers/cache: 34 2013
    Swap: 0 0 0

    April 27, 2011 @ 10:06 pm | Reply
  217. Jack:

    It is just not working for me.
    I tried to change the /sites-enabled/default, to point to my WordPress directory, and it worked, but as you can see.
    It showed all the wordpress PHP code.
    So I then edited this default file to have the PHP stuff, did it correctly.
    and when I go to visit my website it gives me that the page is temp. unavailible.
    :S

    Why isn’t anything going right with me?

    April 28, 2011 @ 8:38 am | Reply
  218. sunny:

    hi, i know you said this tutorial is for advance user, but i like it and it uses a lot less memory than anyone else i found so far…i am a newbie, so here goes, i install everything on Ubuntu 10.04 and it works…my server main ip is 74.63.214.218 , i have rj519.info pointed to my server ip..it works, i get “welcome to nginx” . questions? i install rj519.info with wordpress already ,so how do get main ip and rj519.info both goes to same wp install? i have been on this googling 3 days and cannot figure this out…any help would be appreciated…thanks….ps can you reply to email….thanks..

    May 3, 2011 @ 6:47 pm | Reply
  219. Very great tutorial. Thanks so much

    May 7, 2011 @ 7:43 am | Reply
  220. Script appears to work fine for Squeeze Debian.

    May 10, 2011 @ 10:10 pm | Reply
    • Spoke too soon:

      mv: cannot move `/tmp/wordpress.3289/wordpress’ to `/var/www/cynix.us’: No such file or directory
      chown: cannot access `/var/www/cynix.us’: No such file or directory
      cp: cannot stat `/var/www/cynix.us/wp-config-sample.php’: No such file or directory
      sed: can’t read /var/www/cynix.us/wp-config.php: No such file or directory
      Reloading nginx configuration: nginx.

      May 10, 2011 @ 10:10 pm | Reply
    • May 10, 2011 @ 10:16 pm | Reply
    • Turns out actually /var/www/ didn;t get created. Not sure if that’s an issue with the script or Debian 6.0 or some gremlins or the phase of the moon but that’s the issue. Worked fine after I created the directory.

      May 10, 2011 @ 10:19 pm | Reply
      • LEA, can we add this point to the instructions up there?

        Thanks

        June 20, 2011 @ 1:20 am | Reply
  221. I want to upgrade the nginx but I do not know how to do it?Can you give me to advice?

    May 11, 2011 @ 1:55 am | Reply
    • Some specifics would be helpful. The versions you;re using, the OS, what’s stopping you from upgrading, etc.

      May 11, 2011 @ 12:04 pm | Reply
      • I follow this tutorial above!!!
        use debian 5
        neginx version is 0.6.32
        php version is 5.2.6-1+lenny9
        I want to upgrade all of them

        May 11, 2011 @ 12:10 pm | Reply
        • The tutorial above makes no mention of upgrading. This is why I asked you specifically as to what you’ve done.

          Again, you need to tell us what you’ve done and what’s stopping you from doing so and/or what error you’re getting.

          May 11, 2011 @ 2:01 pm | Reply
      • I have no error to get.I only want to upgrade the version of nginx and php
        I think the version are too low
        and I want to test nginx version 1.0.0

        May 11, 2011 @ 2:07 pm | Reply
  222. subbed

    May 17, 2011 @ 3:11 am | Reply
  223. I got an error
    Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

    May 25, 2011 @ 9:01 am | Reply
  224. Ok, So I really was hoping I wouldn’t have to ask this question on here. I did all the steps and setup wordpress as domain horizonschurch.net. I only plan on having a one website setup. Is there a easy way to configure this so that when I goto just the IP Address I can see the site. I am wanting to do some testing before I actually flip the site over in the @ records of my domain. I am not needing multiple virtual hosts basically.

    June 3, 2011 @ 12:36 am | Reply
  225. Nadine:

    is this still working?:D

    June 20, 2011 @ 9:24 pm | Reply
  226. So I edited the php.ini file for allow fopen(), but WordPress Jetpack is still giving me a error. I restarted the php service and checked the php.ini file in the cgi folder. Can someone help me with this?

    June 21, 2011 @ 9:33 pm | Reply
  227. David.S:

    can any1 tell me how to install SUPHP with this script?

    July 2, 2011 @ 12:48 pm | Reply
  228. billy:

    hey LEB admin, how to enable php curl with this script?

    thanks

    August 5, 2011 @ 2:23 am | Reply
  229. luma:

    How do I change the port that dropbear listens on? and also disable root logins?

    I edited the /etc/default/dropbear but did not help after reboot.

    Thank you. This script rocks!

    August 6, 2011 @ 3:58 am | Reply
  230. lol. 80 MB vps and running wp? i can’t imagine that.
    how about max visitors in a time ?

    my old server even with 1GB RAM, can’t handle more than 50 visitors in same time.

    August 11, 2011 @ 3:03 am | Reply
    • Thanks, LES, :)
      I made my own script using this post for centOS, works great.

      @rev,
      Got WP work with 150 concurrent connections w/o problem on buyvmOVZ128.

      August 14, 2011 @ 12:15 am | Reply
  231. Sorry for the stupid question, but what happens when the Linux OS uses all the available RAM (and also SWAP)? Does the system erases data from RAM in order to save new data? Using this same scenario (all RAM was used till the last bit) what about the cache systems like APC and Memcache/d? Do they help to make this “memory administration” or do they mess it up?

    August 14, 2011 @ 2:22 pm | Reply
    • I’m not too sure with the technical details behind it, but I believe it should start taking away from your inactive memory (memory that has been allocated to programs but not currently in use). After you’re completely out of RAM and swap that the system can use, I’m not completely sure. On some VPSes, it’ll actually just start killing processes, but I’m pretty sure that’s the virtualization software and not the operating system itself running on the VPS.

      This is just what I’ve heard over the years. I’ve never had any of my servers or computers have no memory left, but like any one could assume, I’m sure it would be extremely slow as your system would be relying on swap memory (that is, if you have any).

      August 14, 2011 @ 2:38 pm | Reply
      • So it’s not a stupid question after all :-)

        I have 4 HTML/PHP small websites and 2 WordPress installations running on a 256 RAM VPS and this is what I get:

        free -m
        total used free shared buffers cached
        Mem: 246 243 3 0 1 12
        -/+ buffers/cache: 229 17
        Swap: 487 230 257

        Recently, I turned APC and Memcache/d off just to see if the would be some RAM economy but the memory went up in the same way it did before, when the cache systems were on.

        From what I can tell, the sites are running fine…

        For example, atipico.com.br and casachile.com.br

        August 14, 2011 @ 2:58 pm | Reply
        • Nope, not at all!

          If the memory is going way up, I’d check on what is is. Take a look at top (or even htop) and see what process is hogging all your memory. I’ve seen PHP spool up a ton of processes, and it made my VPS use quite a bit of memory. Then again, I’ve seem Apache take up a ton of memory as well.

          August 14, 2011 @ 3:12 pm | Reply
        • This caching systems aren’t to reduce RAM consumption, instead, are a tradeoff to get better performance sacrificing some memory.

          August 14, 2011 @ 3:22 pm | Reply
        • I took a screen shot of htop and put it here: http://imgur.com/P0E8W
          This shows a lot of PHP-FPM processes running. As I was not able to configure this Linux Box to run PHP with the built in CGI, I had to use FPM. And it looks that I am allowing to many FPM processes to run, isn’t it? All the rest is quite irrelevant, I think.

          August 14, 2011 @ 5:20 pm | Reply
        • I’m using Nginx and PHP5 (FPM) as well, but PHP isn’t use as much memory as yours (http://grab.by/grabs/8286866316c5efcf61abb3ef1bbe3e4f8d6ba09716.png). In your “php5-fpm.conf” file (at least on Debian Squeeze it’s in /etc/php5/php-fpm.conf), add in the follow to the document.

          pm.max_children = 10
          pm.start_servers = 3
          pm.min_spare_servers = 2
          pm.max_spare_servers = 5
          pm.max_requests = 500

          I use a bit higher values, as I’m not on that little RAM, but I’m guessing these values should keep PHP running nicely for you. :)

          August 14, 2011 @ 5:34 pm | Reply
        • *following… sorry for the grammar mistake.

          August 14, 2011 @ 5:37 pm | Reply
        • Good point, thanks.

          I could access mu PHP-FPM conf file in Debian 6 with:
          nano /etc/php5/fpm/pool.d/www.conf

          The default values were:
          pm.max_children = 50
          pm.start_servers = 20
          pm.min_spare_servers = 5
          pm.max_spare_servers = 35
          ;pm.max_requests = 500

          My question is: why not turn:
          pm = static
          pm.max_children = 4
          as recommended here: http://www.codernotes.com/2011/7/install-nginx-and-php-fpm-on-debian-6-squeeze-2/

          By the way, the bootstrap scrip recommends: “php with built-in FastCGI interface. Running only 1 child process and respawn after 5,000 requests.”

          August 14, 2011 @ 9:15 pm | Reply
      • Yes, it seems that you are running a lot of PHP processes, you need to configure that in the startup script of PHP.
        Also, that memcache daemon, are you using it? And you need xinetd? I see that you are running dropbear.

        Btw, configure htop (F2 key and then display options) to hide threads.

        August 14, 2011 @ 6:24 pm | Reply
        • I was running the default PHP-FPM conf. I’m taking care of it. About memcache, yes, I am using it, but very, very rarely.

          About htop, I didn’t quite understand for threads was already marked to be hidden; I deleted the print screen, just in case.

          About xinitd, it is included in the original bootstrapping setup-debian.sh:

          function install_dropbear {
          check_install dropbear dropbear
          check_install /usr/sbin/xinetd xinetd

          # Disable SSH
          touch /etc/ssh/sshd_not_to_be_run
          invoke-rc.d ssh stop

          # Enable dropbear to start. We are going to use xinetd as it is just
          # easier to configure and might be used for other things.
          cat > /etc/xinetd.d/dropbear <<END
          service ssh
          {
          socket_type = stream
          only_from = 0.0.0.0
          wait = no
          user = root
          protocol = tcp
          server = /usr/sbin/dropbear
          server_args = -i
          disable = no
          }
          END
          invoke-rc.d xinetd restart
          }

          August 14, 2011 @ 9:36 pm | Reply
    • About the first, the kernel uses the OOM killer http://linux-mm.org/OOM_Killer

      About the second, APC “saves” temporarily the compiles PHP code, and then your PHP process doesn’t need to recompile every time that someone does a new request, and instead it server the cached webpage.
      Memcache is different, because it runs as a daemon. Is a kind of database to mantain values in memory instead of going again to your database to request them.

      August 14, 2011 @ 2:42 pm | Reply
      • So, in a way, it’s good to have APC and Memcache/d working together for they will help to manage the flux of data in the RAM, is it?

        August 14, 2011 @ 2:55 pm | Reply
        • APC has a seamless integration. Memcache requires to implement the caching routines in your application.

          August 14, 2011 @ 3:20 pm | Reply
        • Yomero, would you use APC in a VPS in a case like mine (4 html/php small sites + 2 wordpress sites)?

          August 14, 2011 @ 4:00 pm | Reply
        • It seems that you are in a 256MB vps. I am afraid that you are running out of RAM. Using APC probably will help, but probably will be worst if you start to swap even more. First try to reduce your RAM usage, and as everybody recommends here, use Nginx if you can

          August 14, 2011 @ 4:16 pm | Reply
        • Gracias, Yomero. I am already using Nginx and, except for the fact I am hosting 6 small websites, I followed all the steps recommended here. Is it possible that these two WordPress installations I am running is indeed using double the memory a single wordpress installations would do? If so, I guess that making use of the Multisite feature is the only way… (or would multisite use double the memory anyway?)

          August 14, 2011 @ 4:57 pm | Reply
        • You can host 10000 sites without problem, the memory usage will be the same, I think is independent of WordPress. The problem will come if you get a lot of visitors and your PHP processes can’t be enough fast to serve all the requests.

          August 14, 2011 @ 6:26 pm | Reply
        • So, no matter how many wordpress I have installed in that box, the big problem will be to determine the “expenses” of serving the requested pages, in the case of a high volume of visits. To accomplish this task, APC plays an important role I think. As far as I can see, by determining only one chield to run and “the number of requests each child process should execute before respawning” to 5000, the bootstrapping script is really counting on the processor, isn’t it?

          August 14, 2011 @ 9:43 pm | Reply
        • That is the idea, a lot of requests to the same content -> APC will kickass xD

          Ahm, I have done almost nothing about serving web pages, but I think the number of PHP processes is related to the number of cores that you have available. Probably 2xCore is a lot, maybe 1 or 1.5xCore is a good choice.

          About PHP-FPM, is a fork designed to spawn and kill dinamycally depending on the number of requests. Putting a “static” flag will disable this feature (I think). So, PHP-CGI (the normal implementation) is a good choice for little servers.

          August 14, 2011 @ 10:57 pm | Reply
        • Something continues very wrong here.

          After changing the PHP-FPM conf file in Debian 6 (/etc/php5/fpm/pool.d/www.conf) with the follow:
          pm.max_children = 5
          pm.start_servers = 1
          pm.min_spare_servers = 1
          pm.max_spare_servers = 3
          pm.max_requests = 2000

          And turning on APC again, this is what I get from “free -m”:

          Immediately after reboot:
          total used free shared buffers cached
          Mem: 246 102 144 0 3 53
          -/+ buffers/cache: 44 201
          Swap: 487 0 487

          After a day of using the server:
          total used free shared buffers cached
          Mem: 246 229 17 0 24 135
          -/+ buffers/cache: 68 178
          Swap: 487 0 487

          In brief, only 17 MB are free… I’m thinking about two options: limit somehow the memory APC can use and turning the PHP-FPM pool from “pm = dynamic” to “pm = static”…

          Any suggestions?

          August 16, 2011 @ 2:41 am | Reply
        • It seems that you are misunderstanding how to read the “free -m” data:

          In the first case you have 201MB free, in the second 178MB (Very big improvement, because previously you posted an output with only 17MB free)

          http://www.linuxatemyram.com/ Hope that helps you to understand

          August 16, 2011 @ 3:17 am | Reply
        • Muchas gracias!

          August 16, 2011 @ 3:53 am | Reply
      • By the way, is there any Mysql cache system (like APC for PHP) that would be recommended to use in a VPS?

        August 14, 2011 @ 3:02 pm | Reply
        • There’s query cache (and table cache) built right into MySQL. As for a dedicated piece of software, I’ve never heard of one before…

          August 14, 2011 @ 3:05 pm | Reply
        • Mysql has is own caching system to reduce the I/O load for reads/writes, and is configurable in the my.cnf file.

          August 14, 2011 @ 3:21 pm | Reply
        • The script is already tuning my.cnf file (putting everything in the processor backs):

          cat > /etc/mysql/conf.d/lowendbox.cnf <<END
          [mysqld]
          key_buffer = 8M
          query_cache_size = 0
          skip-innodb
          END

          August 14, 2011 @ 3:51 pm | Reply
  232. Dean:

    Anyone have any luck installing AWSTATS or equivelent on this setup?

    August 25, 2011 @ 6:49 am | Reply
  233. Not sure why but I’m having to manually install exim4. I could have sworn that I had installed it during the initial run through on the script.

    When I rerun the command, it tells me that it’s installed already but a updatedb/locate for exim doesn’t find anything. Doing a “invoke-rc.d exim4 restart” like you have in the script gives me an “unknown initscript, /etc/init.d/exim4 not found” error.

    September 9, 2011 @ 5:14 pm | Reply
  234. thirdhaf:

    I think I’ve managed to fix all the PHP restart problems people are having. First an explanation. Ubuntu deletes the contents of the /var/run folder upon reboot to ensure smooth operation, the way I fixed this was to add a line to the init script.

    Solution, create a new line in /etc/init.d/php-cgi after line 40:

    env - ${E} mkdir /var/run/www/;chown www-data:www-data /var/run/www

    Hope this helps!
    If this is the wrong way of accomplishing this please let me know. LEA, thanks for making your script public, would you consider updating your install script with this change? It would save us Ubuntu users some pain.

    September 9, 2011 @ 10:25 pm | Reply
  235. Jack:

    maybe a tut on installing whmcs. and vbulletin like this? nice to hear back about it.

    September 22, 2011 @ 8:05 pm | Reply
  236. j0lly:

    after some day of messing up, this is THE solution for noob like me… i would like to learn more about this… starting understanding your useful script!! thanks

    October 22, 2011 @ 10:59 pm | Reply
  237. Taylor:

    I get this, Starting to bug me…

    mv: cannot move `/tmp/wordpress.3912/wordpress’ to `/var/www/blog.b00d.com’: No such file or directory
    chown: cannot access `/var/www/blog.b00d.com’: No such file or directory
    cp: cannot stat `/var/www/blog.b00d.com/wp-config-sample.php’: No such file or directory
    sed: can’t read /var/www/blog.b00d.com/wp-config.php: No such file or directory
    Reloading nginx configuration: nginx.

    October 23, 2011 @ 2:01 am | Reply
    • Why you have a wordpress.3912 folder?

      October 23, 2011 @ 3:30 am | Reply
      • In the script where WordPress is setup, it uses the process ID to create temp folders (common shell programming practise).

        October 23, 2011 @ 10:11 am | Reply
  238. After having good performance with QuickWeb, I want to move my blog to BuyVM because they have IPv6 working by default.

    So, if I visit my IPv4 (209.141.48.45 ), it show’s my blog. But when I visit my IPv6 ( shows2607:f358:0001:fed5:0009:0000:0758:001 ), it shows “It works”.

    I am running Debian 5 32bit with BuyVM. Is there something I need to modify to display the blog by visiting my IPv6?

    December 18, 2011 @ 7:00 am | Reply
    • iKocka:

      Type “nginx -V” to check if installed version of Nginx supports IPv6. “–with-ipv6” should be under configure arguments, if not you have to recompile Nginx with “–with-ipv6”. Then just add “listen [::]:80 ipv6only=on;” to .conf files in /sites-enabled/.

      December 18, 2011 @ 9:50 am | Reply
      • I am using the default NginX with this script. So maybe it’s the 0.6.32.
        Maybe i will just compile it with the new one then.

        Thank you :)

        December 18, 2011 @ 10:38 am | Reply
  239. mkz:

    I am using this script but I can’t get wordpress to connect to wordpress.com with Jetpack plugin.
    How could I solve this issue?

    Here is an error.

    Your website needs to be publicly accessible to use Jetpack: site_inaccessible

    Error Details: The Jetpack server was unable to communicate with your site [IXR -32300: transport error: http_request_failed Operation timed out after 15001 milliseconds with 0 bytes received]

    December 22, 2011 @ 8:13 pm | Reply
    • mkz:

      Just in case someone has the same problem.
      I need to change PHP_FCGI_CHILDREN from 1 to 2 and it solves the problem.

      January 6, 2012 @ 3:40 pm | Reply
  240. Mkani:

    Hey LEB admin, does this website still run with the same 80 MB RAM specified in the post or have you upgraded? Because im planning to buy a VPS & your answer would help me.

    December 26, 2011 @ 3:06 pm | Reply
  241. CHris:

    I am using this script on Rackapace Cloud Server. I pay about $12.00 a month for 256MB ram.

    Once thing i’ve learned is Ubuntu 10.4 with PHP 5.3 is terrible. WordPress has issues and with running W3 Total Cache, my Googlepage speed was down to 79.. Switching back to Deb 5 Lenny, PHP 5.3.6 and Lighttpd with W3 Total Cache, my pagespeed went back up to 98..

    I would avoid Ubuntu and php 5.3 unless you really need it. Drupal and other softwares are not fully supporting php5.3 yet from what I read.

    Chris

    December 27, 2011 @ 12:08 am | Reply
    • CHris:

      Ick.. I meant Swtiching to Deb 5 with Php 5.2.6 fixed all the issues.. I can’t spell and no edit either.. oOo

      December 27, 2011 @ 12:10 am | Reply
  242. Good script to use for WordPress. Consider upgrading Nginx to latest from source.

    January 1, 2012 @ 7:39 am | Reply
  243. PRock:

    Script works beautifully! Thank you so much!

    January 3, 2012 @ 12:28 am | Reply
  244. Michael:

    How to enable FTP for installation of wordpress themes automatically?

    Thanks.

    January 11, 2012 @ 3:36 pm | Reply
    • Try installing libssh2-php, reload php-cgi and use SSH rather than clear text FTP to install plugins / themes automatically

      January 13, 2012 @ 12:21 pm | Reply
  245. Mkani:

    Is PhpMYadmin not necessary?I dont see it mentioned here.

    Also how to update the nginx or other packages after installing this script?

    Would request you to post an updated version, as many seem to use this script.

    January 13, 2012 @ 12:06 pm | Reply
    • phpMyAdmin is not necessary as it can be installed after you use this installation script with “apt-get install phpmyadmin”

      You update the packages and nginx by using the update command within your operating system since it uses operating system packages, not compiling from source. If you are using a Debian or Debian based Linux operating system like Ubuntu, you do this with

      apt-get update && apt-get dist-upgrade -y

      This will fetch the updates and see if your distribution needs an upgrade.

      January 13, 2012 @ 12:24 pm | Reply
  246. Here are some configurations I found for php-cgi to use standard rewriting, or to use Super Cache or W3 Total Chace as well. http://kbeezie.com/view/nginx-configuration-examples/

    January 16, 2012 @ 5:51 pm | Reply
    • Saving that link NOW!

      Probably I will need to move a big wp from Apache

      January 19, 2012 @ 12:34 am | Reply
  247. Here are some more low resource usage scripts with up to date software for CentOS.

    http://centminmod.com/

    Centminmod is based on the script by btcentral below.

    http://www.btcentral.org.uk/projects/centmin/

    Chris

    January 19, 2012 @ 12:19 am | Reply
  248. Dinko:

    ok, that’s all great, but no one did not said if he/she is actualy using this, and how much visitors per day could 128 MB RAM VPS take before it goes into serious problems? If someone yould answer that… Thanks :)

    January 30, 2012 @ 12:38 am | Reply
    • Christian:

      It really depends on what you’re running.

      February 4, 2012 @ 7:11 pm | Reply
      • Dinko:

        Hi, just one wordpress instalation with 2 simple plugins, and firewall plugin

        February 4, 2012 @ 8:35 pm | Reply
        • Amfy:

          Ok, and from which provider?

          February 4, 2012 @ 8:36 pm | Reply
    • Amfy:

      On WordPress on a really slow vps (1 Pagegeneration per second) you could have about 60k – 80k hits per day… I think that is more than enough!

      February 4, 2012 @ 8:24 pm | Reply
      • Dinko:

        OMG, i didn’t think that this is possible. I will definitely give it a try. Thanks.

        February 4, 2012 @ 8:37 pm | Reply
        • Amfy:

          Ahm, that is possible! And that is only for the badest vps I ever had…

          If you want more details for optimazing & co, give me a mail address :)

          February 4, 2012 @ 8:38 pm | Reply
      • Dinko:

        I was looking at http://buyvm.net/ i was told that they ere reliable

        February 4, 2012 @ 8:44 pm | Reply
        • Amfy:

          Hmm, they’re mostly okay – but I never tested a wordpress performance check on them.

          I would take one from Edis, XenVZ, or SecuredSpeed – the problem on buyvm is that you will have problems to order one… :P

          February 4, 2012 @ 8:48 pm | Reply
    • Dinko:

      Yes, i saw that they are out of stock, i’ll wait, or i will look for other cheap VPS

      February 4, 2012 @ 9:02 pm | Reply
  249. is there any installation guide for beginner, like me. it’s so difficult

    February 7, 2012 @ 4:08 pm | Reply
  250. sawine:

    Thanks a lot for this ! Everything worked out fine on debian6. I only had to chown -R the /var/run/www/site-name after because it seems it didn’t work at the set up.

    February 9, 2012 @ 6:53 pm | Reply
  251. Am getting only “Welcome to nginx!” on index, and 404 on wp-admin.

    But on the same VPS, I had installed WP with this script successfully on the same OS (32bit Debian and Ubuntu). Since it is only 4 commands, I can’t seem to figure out what exactly I did differently. Perhaps something on the provider’s side has changed.
    Any pointers on how to fix it?

    February 11, 2012 @ 11:33 pm | Reply
  252. Pats:

    i’m facing an issue, after bash setup-debian.sh wordpress blog.example.com i opened blog.example.com on Browser and its loading blog.example.com/wp-admin/install.php

    After that i installed phpmyadmin using apt-get install phpmyadmin
    Now when i’m loading host.name.com/phpmyadmin or server.ip/phpmyadmin its redirecting to host.name.com/wp-admin/install.php to the url and giving error Oops! This link appears to be broken.

    though host.name.com is loading “Welcome to nginx!” correctly.
    any ideas?

    March 3, 2012 @ 10:54 am | Reply
  253. CM:

    Set up fine, however I have an issue with having more than one domain on my VPS.

    bash setup-debian.sh wordpress domain1.com
    That works, and when I visit “domain1.com” it works. When I visit the IP address of my server directly, I also see the content for ‘domain1.com’

    bash setup-debian.sh wordpress domain2.com
    I just added this domain, but when I visit it I only see the content from domain1.com. I can confirm that /var/www/domain2.com has been created.

    I’m using Cloudflare for my DNS, if it matters. What do I need to do to my vps config so that I can have more than 1 site hosted on it?

    March 4, 2012 @ 11:32 pm | Reply
    • I’m running that command to create 3 domain hosted in a BlueVM VPS and it works.
      Maybe your problem is with the CloudFlare. You can try to disable it and try to visit it again.

      March 4, 2012 @ 11:55 pm | Reply
      • CM:

        If I disable Cloudflare, how would I access the site? I use Cloudflare for my DNS.

        March 5, 2012 @ 12:06 am | Reply
        • Create an A record for your domain to your VPS IP.

          March 5, 2012 @ 12:10 am | Reply
        • CM:

          Ah, it just started working all of a sudden. But now I have another issue.

          I’m not using the second domain for a WP blog, it’s for a static html site. I just set it up with this script as it was easy, and I can just remove the WP files after. I removed the index.php page as a test, and replaced it with my own index.html page.

          http://www.domain2.com returns an Nginx error. http://www.domain2.com/index.html shows my page. Why is that? I looked at the nginx.conf file as well as the .conf file located within /etc/nginx/sites-enabled/ dir but I can’t seem to get it to load index.html files.

          March 5, 2012 @ 3:17 am | Reply
        • @CM, try the ‘/sites-available/default’ or /sites-enabled/default’.

          There should be a block labeled ‘location / { }’. Make sure index contains index.html.

          March 5, 2012 @ 3:22 am | Reply
  254. bmsleight:

    For Debian 6 Need to :

    mkdir /var/www

    then after installation

    chown -R www-data.www-data /var/www/{Name of wp}

    March 25, 2012 @ 6:49 pm | Reply
  255. Simplyfast:

    You can grab an updated fork for Debian 6.
    Works very well on BuyVM’s Debian 6 template.

    Please read the readme file before installing.

    April 14, 2012 @ 1:02 pm | Reply
  256. JB:

    @Simplyfast
    How do I get phpmyadmin to work with that? When I install with apt-get install phpmyadmin, I get prompted to use apache2 or lighttpd.

    June 3, 2012 @ 6:24 am | Reply
  257. John_R:

    This setup works very, very well.

    Just rolled it out to 5 different servers.

    Thank you for the great work.

    August 18, 2012 @ 7:38 pm | Reply
  258. Ferdian:

    Here’s result on my SSD VPS, 256 MB, Debian 6 32bit

    root@1811:~# ps aux
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.2   2028   724 ?        Ss   04:39   0:00 init [2]
    root         2  0.0  0.0      0     0 ?        S    04:39   0:00 [kthreadd/111]
    root         3  0.0  0.0      0     0 ?        S    04:39   0:00 [khelper/111]
    www-data   369  0.0  2.1  30480  5724 ?        Ss   04:39   0:00 /usr/bin/php-cg
    root       380  0.0  0.3   1972   788 ?        S    04:39   0:00 /usr/sbin/syslo
    root       386  0.0  0.3   8668   804 ?        Ss   04:39   0:00 /usr/sbin/sasla
    root       387  0.0  0.1   8668   380 ?        S    04:39   0:00 /usr/sbin/sasla
    www-data   394  0.0  0.7  30480  2072 ?        S    04:39   0:00 /usr/bin/php-cg
    root       440  0.0  0.3   2288   860 ?        Ss   04:39   0:00 /usr/sbin/cron
    root       445  0.0  0.2   5024   716 ?        Ss   04:39   0:00 nginx: master p
    www-data   446  0.0  0.5   5196  1496 ?        S    04:39   0:00 nginx: worker p
    root       474  0.0  0.3   2392   912 ?        Ss   04:39   0:00 /usr/sbin/xinet
    root       479  0.0  0.2   1744   544 ?        S    04:39   0:00 /bin/sh /usr/bi
    mysql      599  0.0  2.8  31720  7596 ?        Sl   04:39   0:00 /usr/sbin/mysql
    root       600  0.0  0.2   1668   564 ?        S    04:39   0:00 logger -t mysql
    root       690  0.5  0.4   2400  1152 ?        Ss   04:41   0:00 dropbear -i
    root       691  0.0  0.6   2960  1608 pts/0    Ss   04:41   0:00 -bash
    root       695  0.0  0.3   2348   932 pts/0    R+   04:41   0:00 ps aux
    root@1811:~# free
                 total       used       free     shared    buffers     cached
    Mem:        262144      26012     236132          0          0      15996
    -/+ buffers/cache:      10016     252128
    Swap:            0          0          0
    
    
    September 24, 2012 @ 7:51 am | Reply
  259. Chris B:

    It would be nice to see this script using PHP-FPM instead of PHP-CGI..

    December 14, 2012 @ 8:40 am | Reply
  260. I coded a Bash script that uses dialog for the selection of packages, kind of tasksel but fully tweaked.

    It works with either Ubuntu or Debian. If anyone wants to have a look, it’s available at GitHub.

    January 8, 2013 @ 7:33 am | Reply
    • Leo:

      This is amazing … I’m using it on a 2gb vps that was just provisioned in LA and it is almost done. Can I please ask if you can add more utils to it like Drupal / WordPress / Joomla / ffmpeg. Thank you.

      January 22, 2013 @ 10:00 am | Reply
  261. I can’t use this script on Godaddy Cloud Server.

    January 16, 2013 @ 8:10 am | Reply
  262. James:

    Once you have the vps all set up, I would suggest setting up a free monitoring tool such as Got Site Monitor to keep an eye on the performance and uptime of your vps.

    January 18, 2013 @ 10:18 pm | Reply
  263. Cristobal Morales:

    Awesome!.
    Works perfecly for me, in a 128MB RAM VPS that was getting me crazy with apache and mysql.

    Thanks a lot.

    February 18, 2013 @ 10:57 am | Reply
  264. Alex:

    Amazing!
    Thank you very much for sharing your scripts?
    I couldn’t figure out how to make it work on my 128 vps.

    With your script and debian 6 vps openvz it worked!
    Before mysql was always crashing badly (not enough memory allocation)

    Perfect now because of you
    Thanx again

    March 12, 2013 @ 1:12 pm | Reply
  265. Thank you, your script is very useful!

    April 18, 2013 @ 3:52 pm | Reply
  266. Dab:

    is this working in Ubuntu 12.04?

    i get mysql error

    thanks a lot

    May 30, 2013 @ 11:30 pm | Reply
    • Dab:

      ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

      June 6, 2013 @ 6:23 pm | Reply
      • Dab:

        $- service mysql start
        start: Job failed to start

        June 6, 2013 @ 6:25 pm | Reply
        • Charles Jayy:

          Hi.

          The syntax for disabling innodb (used in this script) is deprecated.
          There is an easy fix for this though:

          1. Open /etc/mysql/my.cnf in your favorite text editor. In my case,
          # vim /etc/mysql/my.cnf

          2. Find and remove “skip-innodb” and replace it with
          innodb=OFFdefault_storage_engine=MyISAM

          3. Restart the mysql service.
          # service mysql restart

          I found this fix here at ServerFault. This also solves the “Starting MySQL database server: mysqld” error.

          Hope I helped someone (even after a year has passed!)

          July 8, 2014 @ 10:57 am | Reply
          • Charles Jayy:

            Correction:
            In your /etc/mysql/my.cnf file,
            Find and remove “skip-innodb” and replace it with
            innodb=OFF

            default_storage_engine=MyISAM

            July 8, 2014 @ 12:11 pm | Reply
  267. TL:

    failed in bash setup-debian.sh mysql

    mySQL not running

    invoke-rc.d mysql start
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    invoke-rc.d: initscript mysql, action "start" failed.

    June 17, 2013 @ 8:00 pm | Reply
  268. fatgeek:

    Hi,

    I used this script to set up my 256 VPS. I modified the script to not install dropbear as I have had trouble with it in the past. That’s not really related to my question though.

    I have two problems.

    Currently I have nginx up and running fine for serving static pages. However, PHP isn’t working. When I try to access a php file it just shows the plain text of the php file.

    Secondly if I try to access a subdirectory from my web root it does something weird where it redirects to localhost. For example: if I try to access example.com with an index.html in the web root it works fine.If I try to access, say, example.com/dir1 which also has an index.html inside my browser shows it redirecting to localhost/dir1.

    Any help would be appreciated.

    /etc/nginx/sites-available/default : http://pastebin.com/7Le0SjBa
    /etc/nginx/nginx.conf : http://pastebin.com/pSUEKmkB

    Any help would be immensely appreciated!

    October 2, 2013 @ 6:11 am | Reply
    • fatgeek:

      Oh, I’m on Debian 6 if that is relevant.

      October 3, 2013 @ 12:08 am | Reply
  269. kevin:

    How to change the domain”blog.example.com” to another domain? And I run /etc/nginx/sites-enabled/domain.com.conf,it say”..line 1: server: command not found” and more command not found info.Thx!

    October 10, 2013 @ 2:18 am | Reply
  270. Great beat ! I would like to apprentice even as you amend your web site, how can i subscribe for a weblog site?
    The account aided me a acceptable deal. I have been tiny bit
    acquainted of this your broadcast provided vivid transparent idea

    October 17, 2013 @ 9:07 am | Reply
  271. Do you mind if I quote a few of your articles as long as I provide credit and sources back to your weblog?
    My blog site is in the very same niche as yours and my visitors would truly benefit from a lot of the information you present here.
    Please let me know if this ok with you. Many thanks!

    October 27, 2013 @ 1:36 am | Reply
  272. Merk:

    Have some package changes stopped this script working?

    seeing issues with Mysql on Debian 5, 6 and Ubuntu.

    # bash setup-debian.sh mysql
    mysql-server already installed
    mysql-client already installed
    Stopping MySQL database server: mysqld.
    Starting MySQL database server: mysqld.
    Checking for corrupt, not cleanly closed and upgrade needing tables..
    mysqladmin: connect to server at ‘localhost’ failed
    error: ‘Access denied for user ‘root’@’localhost’ (using password: YES)’

    November 15, 2013 @ 11:22 am | Reply
    • Fanis:

      Mysql 5.5+ needs this added in setup-debian.sh, in the “install_mysql” function where it creates “/etc/mysql/conf.d/lowendbox.cnf”


      default-storage-engine = myisam

      Just add it before the “END”, so it looks like this:


      function install_mysql {
      # Install the MySQL packages
      check_install mysqld mysql-server
      check_install mysql mysql-client

      # Install a low-end copy of the my.cnf to disable InnoDB, and then delete
      # all the related files.
      invoke-rc.d mysql stop
      rm -f /var/lib/mysql/ib*
      cat > /etc/mysql/conf.d/lowendbox.cnf <<END
      [mysqld]
      key_buffer = 8M
      query_cache_size = 0
      skip-innodb
      default-storage-engine = myisam
      END
      invoke-rc.d mysql start

      # Generating a new password for the root user.
      passwd=`get_password root@mysql`
      mysqladmin password "$passwd"

      This may need a way to clear the permissions too, because setting the password isn’t working further down the line. I ended up just rebuilding the VPS, since I was merely testing this out on a new one.

      September 11, 2014 @ 12:25 pm | Reply
  273. Hi there, yes this post is in fact nice and I have learned lot of things from it on the topic of blogging. thanks.

    November 15, 2013 @ 10:48 pm | Reply
  274. Nikola:

    Hi,

    Many thanks for script!
    Can you recommend some easy to install script that will set basic security on server, like changing SSH port, removing SSH root access, tmp, etc..all other steps that are usually set for security.

    2nd question:
    What wordpress cashing setup do you use on lowendbox WordPress/Nginx/PHP/MySQL.
    And does this site lowendbox run on the same setup like this script?

    February 11, 2014 @ 6:06 pm | Reply
    • Nikola:

      Anybody please?
      Can owner of this site share his wordpress setup please?

      February 19, 2014 @ 6:44 am | Reply
    • u can check my blog

      December 3, 2014 @ 12:05 pm | Reply
  275. I have learned lot of things from it on the topic of blogging. thanks.

    December 28, 2014 @ 7:13 pm | Reply
  276. It’s actually a great and helpful piece of info. I am glad that you shared this useful info with us. Please keep us up to date like this. Thanks for sharing.

    December 30, 2014 @ 10:55 pm | Reply
  277. andy:

    hi, i had use you script to install wp, but i can not success. is this script still works????

    January 23, 2015 @ 7:29 am | Reply
  278. nice info sir… tanks for share. but i tray in Centos 6.6 32bit minimal any error while install exim

    July 3, 2015 @ 6:42 am | Reply
  279. Can we run dynamic wordpress site with email on 250 MB ram easily?

    July 17, 2016 @ 2:25 am | Reply
  280. Great, it’s working fine, :D Many thanks for sharing this :)
    !!!

    February 21, 2017 @ 9:15 am | Reply
  281. Standa:

    I have little knowledge of nginx 502 Bad Gateway I get the following when I tested it for my main blog. Is their anyway to tune this?

    September 23, 2018 @ 12:52 pm | Reply
  282. Adam:

    It’s crazy this script is from 2010 and still fine and way ahead of the curve. If you think about it before DigitalOcean and all the new cloud networks too.

    Any opinion about the SlickStack WordPress installer? https://github.com/littlebizzy/slickstack

    June 27, 2019 @ 2:25 pm | Reply
  283. Great.

    September 29, 2020 @ 12:15 am | Reply

Leave a Reply

Some notes on commenting on LowEndBox:

  • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
  • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
  • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

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