Jul 13

Start Nginx

wzuup nginx

Check it's not running.

$ curl localhost
curl: (7) couldn't connect to host

Start it directly (without init.d script)

$ sudo /usr/local/nginx/sbin/nginx

Check it's running in the background.

$ curl localhost
<html>
<head>
<title>Welcome to nginx!</title>
</head>
<body bgcolor="white" text="black">
<center><h1>Welcome to nginx!</h1></center>
</body>
</html>

Stop/kill the server again.

$ sudo kill `cat /usr/local/nginx/logs/nginx.pid`

Check it's not running.

$ curl localhost
curl: (7) couldn't connect to host

Notes

If the server needs a pass phrase on start up, see Generate SSL certificate how to avoid this.

$ sudo /etc/init.d/nginx start
Starting nginx: Enter PEM pass phrase:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
nginx.
✱ ✱ ✱