Archive

Archive for the ‘plugcomputer’ Category

Installation of nginx on Gentoo/Sheevaplug

July 7, 2009 2 comments

step 1.

mkdir /etc/portage
echo "www-servers/nginx **" >>/etc/portage/packages.keywords

step 2.

emerge nginx

step 3.

mkdir -p /var/www/localhost/htdocs
echo "<h1>Hey it works</h1>" >>/var/www/localhost/htdocs/index.html

index.html is created for testing.

step 3.

vi /etc/nginx/nginx.conf

comment out the first line in server block (or change 127.0.0.1 to the ip you want httpd listens on), without this step nginx will only listens on 127.0.0.1

	server {
		#listen		127.0.0.1;
		server_name	localhost;

		access_log	/var/log/nginx/localhost.access_log main;
		error_log	/var/log/nginx/localhost.error_log info;

		root /var/www/localhost/htdocs;
	}

step 5.

mkdir /usr/logs
touch logs/nginx.lock.accept

[ without this step nginx will fail to start ]

step 7.

/etc/init.d/nginx start

step 8.
To verify nginx is running

pgrep nginx

It should report 2 pid numbers; run

netstat -na|grep :80

to test if the port binding is correct, you should see something similar to

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN

Advertisements
Categories: gentoo, plugcomputer, Tip