Angol (change) 
Telepítése és konfigurálása Nginx webszerver, csípés az alapértelmezett struktúra, majd felállításáról vhost fájl symlink a tárgya ez a copy / paste how-to. Tehát nyitnak, hogy a CLI és leírom.
Úgyhogy készen áll a telepítésre egy csillag attrakció, Nginx (ejtsd: "motor-x"). De miért? Hát nem a legjobb Apache webszervert?
Apache szolgált nekem is évekig, helyileg és távoli gépek, és még mindig kívánatos választás a sok nagy telek.
De, akárcsak az Ubuntu, Firefox és jQuery, van egy új fiú a városban, és ez karcsúbb, egyszerűbb beállítani és használni, és gyorsabban szolgál. Írja be a Nginx webszervert.
20 copy / paste lépést .. nulláról hős, üres dobozt aranyos-as Linux szerveren.
Görgess le a teljes sorozatot index.
Szóval, hé, shed megoszthassák viva virtuális! Hope it helps. The_guv
Watch the, er, guvideo jobb ötlete hogyan kell ezt csinálni.
Check out the_guv YouTube csatornát http://youtube.com/guvnrDOTcom
... vagy ha nem lehet, hogy bajlódni, sőt ha lehet, itt a részleteket ...
Én nem vallja, hogy egy szakértő, csak valaki, aki rendkívül alaposan kutatott. Koncentráltam, elsősorban a két legnépszerűbb, legjobb létre webszerverek, Apache, és Lighttpd, és a fiatal török alternatív, Nginx, amiről geekdom az egész meghatottan. Itt van egy összefoglaló az én legfontosabb megállapításai: --
Ive 'használ ez könnyű szerver az én erőforrás-nehéz WordPress blog, guvnr.com, és meg vagyok nyűgözve Szilárd teljesítményét. Is fontosabb, hogy nem rendelkezik, hogy a Windows-szerű tendencia, az Apache csapás is, az erőforrások pazarló fut egy csomó olyan szolgáltatást, én csak nem kell.
Ne vegye a szavamat érte. Nem szabad, mert még nem végeztek semmilyen benchmark tesztek. A Google valami hasonló Apache vs Nginx "vagy Nginx vs Lighttpd és egy olvasott. És itt van a Nginx wiki.
Két módja van, hogy a szoftverek telepítése Linux; az integrált telepítési eszközök vagy a forráskód.
Normális esetben mi felszerel belsőleg használva valami ilyesmi a Linux telepítő "aptitude", hanem mert ez egy olyan fontos összetevője VPS, megyek, hogy mutassa meg, hogyan telepítsük a forrást. Ez a módszer egy kicsit hosszabb ideig tart, de megéri, mert mi lesz egy sokkal up-to-date version.
.. Egy webszervert, akkor nem spórol. Ez lenne, mint vásárol egy sárga Ferrari.
Először fel, szükségünk van néhány függőség fájlok: --
sudo aptitude -y install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
And to create a directory in which to store the Nginx package:-
mkdir ~/sources
Change to that directory:-
cd ~/sources/
Now we get the latest stable Nginx release, nginx-0.7.62 *.
* As of September 2009, edited by the_guv. You should still check it is still the latest, here , and ammend the filename accordingly:-
wget http://sysoev.ru/nginx/nginx-0.7.62.tar.gz
Unzip it:-
tar -zxvf nginx-0.7.62.tar.gz
Go into the new unzipped folder:-
cd nginx-0.7.62
Compile with two options; where to install it, and including 'ssl' (to enable 'https' for secure connections, ie shopping and stuff):-
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
Install this baby:-
make sudo make install
Kick it up:-
sudo /usr/local/sbin/nginx
And test it by popping your IP address in a web browser. You should see "Welcome to nginx!"
Now stop it:-
sudo kill `cat /usr/local/nginx/logs/nginx.pid`
This is important, for example, upon reboot. We need a script for this. Create a file:-
sudo nano /etc/init.d/nginx
And paste this within:-
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/nginx
NAME=nginx
DESC=nginx
test -x $DAEMON || exit 0
# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
. /etc/default/nginx
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
--exec $DAEMON
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/usr/local/nginx/logs/$NAME.pid --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile \
/usr/local/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
reload)
echo -n "Reloading $DESC configuration: "
start-stop-daemon --stop --signal HUP --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
--exec $DAEMON
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
Then give the file permissions and make the script run on reboot, else start/stop/restart when required:-
sudo chmod +x /etc/init.d/nginx sudo /usr/sbin/update-rc.d -f nginx defaults
Now open the Nginx configuration file:-
sudo nano /usr/local/nginx/conf/nginx.conf
...and strip out all the content, delete the lot. CTRL-K is the easy way to do that, if you were wondering.
And replace with this:-
user www-data www-data;
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
keepalive_timeout 5;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /usr/local/nginx/sites-enabled/*;
}
The Nginx file structure is pretty messy for multiple sites, so we'll sort that.
First, layout some new folders:-
sudo mkdir /usr/local/nginx/sites-available sudo mkdir /usr/local/nginx/sites-enabled
...the first is for our virtual host (vhost) files, the second for their corresponding symlinks which will be referenced by Nginx' config file.
You have one of each per domain, and one of each for the default settings.
The symlink, or symbolic link, references the web server to the virtual host file.
The vhost file is a configuration file. It tells the web server, for example, things like where the web files live or the kind of URI structure you want.
For now, we need a default vhost file, and that goes in the sites-available folder. So:-
sudo nano /usr/local/nginx/sites-available/default
Now paste this:-
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html index.htm;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root html;
}
}
And enable it with this symlink:-
sudo ln -s /usr/local/nginx/sites-available/default /usr/local/nginx/sites-enabled/default
Boot it up again:-
sudo /etc/init.d/nginx start
...and check for that "Welcome..." page again, using your IP in a web browser.
Splendid. All pretty. And pretty well organised.
So that's Nginx up and running.
In Part 12 of this series Set Up an Unmanaged VPS (4 Newbies) I'm taking a quick detour, setting up FileZilla so we've got a Secure FTP (SFTP) connection. That'll be handy to help demonstrate Part 13, when we create another folder structure, this time for our sites and blogs, and pop up a couple of test pages.
Then, in Part 13, I'll show you how to use Subversion to more easily install and upgrade platforms and their modules/plugins. I'll example the popular WordPress scenario - and while we're about it we'll sort out WordPress caching and friendly-URLs.
And then, this, that, the other. Cue index ..
Serve multi sites & blogs on a budget .. at the fastest possible speed .. with the least downtime .. in the most secure environment .. and future-proofed for easy admin.
That's what the VPS Bible is about, stepped out in simple copy & paste guides.
From high traffic WordPress blogs to startup web hosts, here's what you need.
Set it up? Click here for the 21 part follow-up .. V-P-S Admin
Install/Upgrade WORDPRESS with SUBVERSION - VPS Bible #15 - GUVNR June 9th, 2009 at 11:38 am
[...] Part 11: * Nginx (better than Apache) Web Server [...]
Configure NGINX Multi-Site Virtual Hosts - VPS Bible Pt 13 - GUVNR June 9th, 2009 at 11:38 am
[...] Part 11: * Nginx (better than Apache) Web Server [...]
mnyman June 10th, 2009 at 6:34 pm
This has been really amazing, so thanks a bunch.
For those of us who are completely new at this, I get a warning when I "boot it up again" that says:
Starting nginx: [warn]: duplicate MIME type "text/html" in /usr/local/nginx/conf/nginx.conf:21
Looking in the file, I couldn't find anything duplicating. Do you know why this would happen? Having errors like these explained is especially comforting when we don't fully understand what is going on. Thanks again for all your work on this.
th Először fel, szükségünk van néhány függőség fájlok: --
And to create a directory in which to store the Nginx package:-
Change to that directory:-
Now we get the latest stable Nginx release, nginx-0.7.62 *.
* As of September 2009, edited by the_guv. You should still check it is still the latest, here , and ammend the filename accordingly:-
Unzip it:-
Go into the new unzipped folder:-
Installing and Testing Nginx
Compile with two options; where to install it, and including 'ssl' (to enable 'https' for secure connections, ie shopping and stuff):-
Install this baby:-
Kick it up:-
And test it by popping your IP address in a web browser. You should see "Welcome to nginx!"
Now stop it:-
Have Nginx Start, Restart or Stop When Required
This is important, for example, upon reboot. We need a script for this. Create a file:-
And paste this within:-
#! /bin/sh ### BEGIN INIT INFO # Provides: nginx # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the nginx web server # Description: starts nginx using start-stop-daemon ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/local/sbin/nginx NAME=nginx DESC=nginx test -x $DAEMON || exit 0 # Include nginx defaults if available if [ -f /etc/default/nginx ] ; then . /etc/default/nginx fi set -e case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ /usr/local/nginx/logs/$NAME.pid --exec $DAEMON sleep 1 start-stop-daemon --start --quiet --pidfile \ /usr/local/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; reload) echo -n "Reloading $DESC configuration: " start-stop-daemon --stop --signal HUP --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 exit 1 ;; esac exit 0Then give the file permissions and make the script run on reboot, else start/stop/restart when required:-
nginx.conf - Configuring Nginx
Now open the Nginx configuration file:-
...and strip out all the content, delete the lot. CTRL-K is the easy way to do that, if you were wondering.
And replace with this:-
user www-data www-data; worker_processes 4; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay off; keepalive_timeout 5; gzip on; gzip_comp_level 2; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; include /usr/local/nginx/sites-enabled/*; }Creating the Virtual Host File Structure & Symlinks
The Nginx file structure is pretty messy for multiple sites, so we'll sort that.
First, layout some new folders:-
...the first is for our virtual host (vhost) files, the second for their corresponding symlinks which will be referenced by Nginx' config file.
What are vhosts & symlinks?
You have one of each per domain, and one of each for the default settings.
The symlink, or symbolic link, references the web server to the virtual host file.
The vhost file is a configuration file. It tells the web server, for example, things like where the web files live or the kind of URI structure you want.
For now, we need a default vhost file, and that goes in the sites-available folder. So:-
Now paste this:-
server { listen 80; server_name localhost; location / { root html; index index.php index.html index.htm; } # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }And enable it with this symlink:-
Boot it up again:-
...and check for that "Welcome..." page again, using your IP in a web browser.
Splendid. All pretty. And pretty well organised.
Moving Along
So that's Nginx up and running.
In Part 12 of this series Set Up an Unmanaged VPS (4 Newbies) I'm taking a quick detour, setting up FileZilla so we've got a Secure FTP (SFTP) connection. That'll be handy to help demonstrate Part 13, when we create another folder structure, this time for our sites and blogs, and pop up a couple of test pages.
Then, in Part 13, I'll show you how to use Subversion to more easily install and upgrade platforms and their modules/plugins. I'll example the popular WordPress scenario - and while we're about it we'll sort out WordPress caching and friendly-URLs.
And then, this, that, the other. Cue index ..
SETUP an Unmanaged VPS (4 Newbies) .. The V-P-S Bible
Serve multi sites & blogs on a budget .. at the fastest possible speed .. with the least downtime .. in the most secure environment .. and future-proofed for easy admin.
That's what the VPS Bible is about, stepped out in simple copy & paste guides.
From high traffic WordPress blogs to startup web hosts, here's what you need.
Set it up? Click here for the 21 part follow-up .. V-P-S Admin
If you liked that ...
Set Up Unmanaged VPS (4 Newbies) - Part 13: Serve Multiple Sites & Blogs with Virtual Hosts
Set Up Unmanaged VPS (4 Newbies) - Part 14: Tweak Nginx for WordPress - Pretty URLs & WP Super Cache
Set Up Unmanaged VPS (4 Newbies) - Part 10: Prepare Linux Server for Email with Postfix
Maintain Unmanaged VPS - Part 5: Get phpMyAdmin Working with Nginx
Set Up Unmanaged VPS (4 Newbies) - Part 17: Nginx Control Panel Workarounds
Set Up Unmanaged VPS (4 Newbies) - Part 1: VPS (Virtual Private Server) vs Shared vs Dedicated
... maybe you'll like these?
THE_GUV NEEDS YOU!!
.. to improve this post ..
Please clue me in. What's wrong or missing?
Or, hey, just pile on the praise ;) Ah, yup, and fix a feed, fella.
Or link the page to your social network!
thank you, thanx, tx, ta, t, tsst, twaddle, cheek, cheers, cheerio
Install/Upgrade WORDPRESS with SUBVERSION - VPS Bible #15 - GUVNR June 9th, 2009 at 11:38 am
[...] Part 11: * Nginx (better than Apache) Web Server [...]
Configure NGINX Multi-Site Virtual Hosts - VPS Bible Pt 13 - GUVNR June 9th, 2009 at 11:38 am
[...] Part 11: * Nginx (better than Apache) Web Server [...]
mnyman June 10th, 2009 at 6:34 pm
This has been really amazing, so thanks a bunch.
For those of us who are completely new at this, I get a warning when I "boot it up again" that says:
Starting nginx: [warn]: duplicate MIME type "text/html" in /usr/local/nginx/conf/nginx.conf:21
Looking in the file, I couldn't find anything duplicating. Do you know why this would happen? Having errors like these explained is especially comforting when we don't fully understand what is going on. Thanks again for all your work on this.
the_guv June 10th, 2009 at 11:10 pm
Hi Mnyman,
Hmmn, sorry to say, looks like you've made a typo. Unless .. is there any discrepancy between what I have set down from the start to where you are, and what you have done?
Tell you what though .. click on Contact and send me an email with the content of nginx.conf, and I'll take a look.
crazeworthy June 23rd, 2009 at 10:13 am
The problem is with line 20, there is a carriage return which puts application/xml+rss text/javascript; in a separate line. That conflicts with the include mime.types;
Just make sure that is removed and I think it should go smoothly. This is a great write up guv!
Matt June 23rd, 2009 at 4:24 pm
Great series!
Wanted to let you know that the install step didn't work for me. Used instruction here: http://www.ubuntugeek.com/howto-install-nginx-webserver-in-ubuntu-804-hardy-heron.html and it worked.
I'm definitely not saying your wrong (I'm the definition of a newbie) but wanted to let you know.
Thanks for a great tutorial!
crazeworthy June 23rd, 2009 at 5:23 pm
Previous comment was incorrect see link below:
http://forum.slicehost.com/comments.php?DiscussionID=3763
the_guv June 25th, 2009 at 1:42 pm
@crazeworthy - pleased you sorted that. tx for the tx!
can be a bit fiddly though. pay attention m8!
@matt - aye, me likes the ubuntu geek. dunno what went wrong for you, this method sure worked in testing, twice or thrice
@all - 1 tip .. don't try to copy the code direct from the post .. there's an icon at the top right of each code box, next to the printer icon. Click on that, and then copy/paste from there.
All that said, damn, any probs, lemme know.
***
UPDATE, FIX! RE: Nginx Warning on Start/Restart. Sorry folks, there was a mistake in the nginx.conf file, which was throwing a Warning (not an error, but annoying all the same.)
If you really wanna know, I had a duplicate MIME type "text/html" in the conf .. duplicate because the GZIP engine GZIP-ed that MIME type anyway, so it wasn't needed to be repeated in the conf. Anyhow, sorted.
oligolli June 27th, 2009 at 11:18 pm
Thanks for all these tuts, really helped a newbie here.
I'm a bit stuck with the permissions on the /wp-content/uploads folder. I admit I didn't follow your tutorials to the letter, mainly because I am using Centos, but the Nginx user (www-data in your example) confuses me a little.
Should the Nginx user be the owner of the uploads folder or in the same "webmasters" group?
Samuel July 6th, 2009 at 4:29 pm
When trying to start nginx using sudo /etc/init.d/nginx start I get the following error:
Starting nginx: start-stop-daemon: --start needs --exec or --startas
Try `start-stop-daemon --help' for more information.
:'(
the_guv July 7th, 2009 at 5:12 am
@ollygolli .. really depends what you want to do, but probably I could have been clearer about permissions.
a simple scheme would be to add your username to nginx' www-data group, while owning the html_public directory and within. for that, do this:-
usermod -G www-data username
sudo chown -R username:www-data /home/public_html/
or if you've got a bunch of sites for different users, chown username:www-data within their public folders, recursively:-
sudo chown -R username:www-data /home/public_html/somedomain.com/public
@Samuel .. real sorry, can't replicate that error. have you followed the series, sounds like your setup is different somehow.
@Samuel .. CORRECTION. more sorry! was a new plugin playing havoc. sorted now. apologies all.
gordon yeong July 17th, 2009 at 1:39 pm
nah this still doesn't work even when i joined lines 21 and 20 into line 20.
#
#
crazeworthy June 23rd, 2009 at 10:13 am
The problem is with line 20, there is a carriage return which puts application/xml+rss text/javascript; in a separate line. That conflicts with the include mime.types;
Just make sure that is removed and I think it should go smoothly. This is a great write up guv!
the_guv July 19th, 2009 at 11:32 am
@Gordon .. probably nothing to do with carriage return. what's not working .. as much info as you can and I'll try to help you isolate the problem or, if you sorted the issue, let us know how.
@Crazeworthy .. tx for the tip .. carriage rtn removed.
Patrick August 26th, 2009 at 4:55 am
Hello The_Guv,
I have problems with wordpress mu and the rewrite rules for nginx
I tried a lot of different codes but anything is work.
http://mu.wordpress.org/forums/topic/3410
I was making the chances in sudo nano /usr/local/nginx/sites-available/default
My wordpress mu blog is in the root http://www.blognetwerk.net/blogs/
I hope you can help me.
the_guv August 26th, 2009 at 12:29 pm
@Patrick .. read the comments from Trav19 on Setup WordPress on NGINX (FURLs & Cache) - VPS Bible Pt 13 .. I've not had time to play properly with my MU install yet, but think Travis found the answer.
Let me know how you get on. In fact, print the rule! And if it doesn't work, let me know and I'll have a think.
Pierre September 2nd, 2009 at 10:23 am
If you are a programmer, have a look at the source code.
Nginx is simply clearer than others, better engineered and stronger. It is made by more experienced people than all the others I have seen.
In my humble opinion, that's a piece of Art (and I know one thing or two on the subject).
Pierre.
Wai Wong September 16th, 2009 at 6:01 am
Is there a proper way to update nginx? Initially I installed with Nginx 0.7.61, the latest is now Nginx 0.7.62. I want to make sure I don't mess anything up.
thanks,
the_guv September 16th, 2009 at 5:48 pm
@Pierre .. big cheers, Sir. That's quite a project you've got there with G-WAN, BTW. Dunno I can wean off PHP quite so easily tho
@Wai .. You've got a point .. it's a pretty complex procedure to sum up quickly, but very important to add .. I'll add a guide on how to upgrade next week .. that's a promise.
[edit] sorry Wai .. I broke the promise. Then again, I also busted my motherboard
I do have this on teh list though, for the VPS ADMIN series ..
Maintain Unmanaged VPS (4 Newbies) .. V-P-S Admin
.. along with some additions to the Bible's sequel. On the way .. [/edit]
the_guv September 24th, 2009 at 2:15 pm
IMPORTANT NGINX UPGRADE ANNOUNCEMENT
@everyone ..
.. bozo-here upgraded the Bible last week to reflect the latest Nginx stable release - 0.7.62 - then forgot to mention it.
Apologies for any confusion to those folks who wondered why the version had changed overnight, and what if anything that meant ..
Actually, the change did impact one thing. In the section Serve Multiple Sites & Blogs with Virtual Hosts , a fastCGI shared library file became obsolete, now replaced by another, but anyone installing from this guide would have been prompted about this newly recommended file .. I know because I've tested it, and have had confirmation from Zereshk who followed this guide and kindly nudged me to amend that post, which I have.
NOW FOR THE MOST IMPORTANT BIT
Future note: As Nginx or other key application stable releases are upgraded, I'll be amending the Bible accordingly, the changes tested each time. Also, for the record, and as has been rightly requested by one or two folks, I'll be adding a How to Upgrade Nginx Safely guide in the VPS Admin section, pretty shortly, so watch for that .
Cheers all.
Anonymous October 13th, 2009 at 5:05 am
I would like to point out that WordPress.com actually uses LiteSpeed for a backend. nginx is still the best lightweight frontend in my opinion.
the_guv October 13th, 2009 at 11:31 am
@anon .. thank you. I stand corrected, as is the post. I think this clears it up.
Intriguingly, stated in this post, "we are not using nginx as a web server currently, but may switch at some point."
WordPress uses Nginx, currently, for their load-balancing.
thanh November 4th, 2009 at 11:06 pm
how do you go about upgrading to newer versions of nginx?
JIm Davis November 11th, 2009 at 3:25 pm
I have been using your online tutorial ... all is going well with one exception. When I issue the n2r
nginx stops but does restart ... the following error message is issued instead (see below). Since I am newbie am not sure how to correct this problem.
permission denied when trying to open a error log file at "/user/local/nginx/logs/error.log" error 13
It has something to do with not having master privileges. FYI I did work through all of the preceeding tutorial including creating my user name and aliases.
Thank you for effort ... very good job
Jim
agus November 12th, 2009 at 2:54 am
Hey Guv,
Cant wait for your guide on upgrading Nginx... I really need to get rid of 502 bad gateway problem with my site (this happens when the site gets very busy, and when this happens I have to reboot my server)
I am not sure upgrading will fix it, since it is really fastCGI problem if I am correct...
thanks!
agus
the_guv November 12th, 2009 at 6:33 am
@thanh & @agus .. sure, this guide is overdue .. bear with me, I've got a lot on at the mo but this should be done by the end of the month.
thank you, everyone, for your patience .. the Bible's taken a lot longer, well, months and more months longer, than I'd anticipated.
.. then again, hopefully it's better, more detailed than ever, at least, than I thought it would be, and as I said in VPS Bible Reflects New Nginx/WordPress Versions, with Future Commitment , now it looks like I'll never really finish it, just keep upgrading and adding to it, whether focusing on Nginx or other web servers, and also considering other VPS solutions .. I've got a bug about proxying in particular and, hey Agus this may help you, I've got a plan to test and write about a fastCGI alternative pretty shortly.
And then, quite aside from VPS stuff, I wanna be writing more about Linux Desktop solutions, and basically to encourage people to ditch that passe sh1te that is Windows .. and that's what The 25-Part Ubuntu KARMIC KOALA BIBLE was about .. terribly populist I know, and yes I am a cynical populist (damn, I used to write for the BBC, how cynical is that place!) .. er, it worked .. I'm getting published in a massive online place on 20th this month and, that aside, traffic quadrupled overnight, which was like a shot in the arm.
.. And I wanna be writing more about making the most of the web , as opposed to just writing about making the web .. so stuff like how to Twitter effectively or into using some of the best Firefox addons for fun and productivity .. but also stuff like how to SEO (Google loves my SEO) and loads on WordPress .. plus a few laughs here and there. So that's quite a lot, huh, and that's just about this site!
Hey folks .. let me know .. throw me some feedback .. I know I'm gaining some loyal community out there, born largely out of this VPS Bible, and I don't want to turn my back on or somehow abuse that. This is my first blog, and its direction is still evolving, and I have a lot to learn.
And re the Nginx upgrade piece, bear with me, for sure it is about time done! Er, yeah, that was the point of this reply, huh .. got ranting a bit .. you should hear me watching the news ..
agus November 14th, 2009 at 3:42 am
Thanks Guv... your a good man!
eran November 16th, 2009 at 9:51 pm
Hi
Many thanks for the site
Eran
the_guv November 18th, 2009 at 11:33 am
@eran .. You're welcome, thanks for the thanks.
Dimitris November 30th, 2009 at 4:19 pm
I follow the tutorial on my Centos 64 server and i stuck there:
sudo /usr/sbin/update-rc.d -f nginx defaults
command not found
I try it also as i am root:
/usr/sbin/update-rc.d -f nginx defaults
but again the same error
the_guv December 7th, 2009 at 9:58 am
@Dimitris .. sure, this guide is for Debian Linux, using Ubuntu 8.04 LTS (Long Term Support)
Barrie December 29th, 2009 at 6:56 pm
I have the same problem as Samuel and I have done nothing with plugins plus I do not have a clue on what to do.
When trying to start nginx using sudo /etc/init.d/nginx start I get the following error:
Starting nginx: start-stop-daemon: --start needs --exec or --startas
Try `start-stop-daemon --help' for more information.
Barrie December 30th, 2009 at 5:20 pm
I sent this message in yesterday and it was on the list but today it has gone
Starting nginx: start-stop-daemon: --start needs --exec or --startas
Try `start-stop-daemon --help' for more information.
So I have done a complete re-install and when I have finished the install and go again to the start nginx it comes up starting nginx and when I put me IP in no connection and nothing else. When asked the first time I get the welcome screen but not he last time.
Just what can the problem be
Barrie January 3rd, 2010 at 1:51 pm
I got my problem sorted by trial and error so my Pt 11 is working. Now can I get the server working when I figure out how to connect to the WWW with just Pt 11 only, or do I need the whole thing. I am a complete novice as you will notice.
the_guv January 9th, 2010 at 6:59 pm
@Barrie .. apologies, was AWOL!
Pleased you got Nginx to restart on demand .. I think the earlier problem Samual had, and that you had, was due to me accidentally reactivating a plugin to this site that affected that code snippet .. apologies but sorted.
Of the guide, for the average VPS, the only tutorials you can afford to miss are the WordPress references here and there, the option for Subversion and tat of FileZilla.
agus January 10th, 2010 at 8:50 am
Hi Guv,
Is the nginx upgrade guide coming?
Anyway If you don't mind, can you make a guide on how to make fastcgi restarts automatically after failure... this will be great(especially in my situation where it does fail quite frequently)...
Thanks Guv...
eran January 10th, 2010 at 8:50 pm
Hi
Posts in forum say that nginx has problems with spawn-cgi.
lighty has memory leaks problems.
So, what should I choose?
Thanks
Chad January 11th, 2010 at 1:57 am
Hi,
I get to the point of "kicking it up" and simply get this:
sudo /etc/init.d/nginx start
/etc/init.d/nginx: 20: Include: not found
Starting nginx: [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()
Tried going through the whole thing again, but no joy. Such a n00b!
eran January 11th, 2010 at 9:42 pm
try
service httpd stop
apache takes the port .
the_guv January 13th, 2010 at 9:15 am
@agus .. er, yes and yes!
m8 .. big announcement on the way
ALL VPS guides are undergoing a facelift, and there's more .. will post the detail later today.
@eran .. Nginx, of course! FastCGI sys used here works no problem. Dunno what agus has done, but feedback is overwhelmingly positive.
.. that said, see above note .. there will be tutorial updates v soon (within 2 weeks) and if you can wait I'll have maybe a slightly better setup.
(Have to say tho.. Lighty has improved that memory issue, I know, though not sure how much .. am planning on benchmarking the two, along with Cherokee and some others, but not for a couple months yet.)