Archive

Archive for the ‘gentoo’ Category

Compiling my first DirectFB program

October 19, 2009 2 comments

I have to admit I am a total DirectFB newbie and I had a hard time even compiling my first DirectFB program (the official DirectFB or tutorials on the Internet described procedures how to build DirectFB but not how to even compile the simplest demo program, forgive my poor google skill if somebody already posted the compiling instruction). Anyway I use the following command to compile successfully:

gcc -o simple simple.c `directfb-config --cflags` `directfb-config --libs`

OS: fresh installation of Gentoo 09132009
DirectFB version: 1.2.7
Source code of the demo program: http://www.directfb.org/docs/DirectFB_Tutorials/simple.html

Advertisements

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

Categories: gentoo, plugcomputer, Tip