<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pungit.com &#187; Open Source Software</title>
	<atom:link href="http://www.pungit.com/category/open-source-software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pungit.com</link>
	<description>Computer Tips, Tricks, Howtos, PSP, Anime, Linux</description>
	<lastBuildDate>Mon, 27 Jul 2009 14:54:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Enable OSWallpaper SEO URLs on Nginx</title>
		<link>http://www.pungit.com/open-source-software/enable-oswallpaper-seo-urls-on-nginx/</link>
		<comments>http://www.pungit.com/open-source-software/enable-oswallpaper-seo-urls-on-nginx/#comments</comments>
		<pubDate>Fri, 29 May 2009 14:53:28 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[oswallpaper]]></category>

		<guid isPermaLink="false">http://www.pungit.com/?p=215</guid>
		<description><![CDATA[First enable the clean url by editing config.php (inside includes folder). //enable mod rewrite urls. 0=disabled, 1=enabled for SEO Friendly URLS $Gbl["ManualModRewrite"] = 1; The original rewrite rule (Apache) for the script are as follows : RewriteEngine On #PAGES RewriteRule ^([^/]*)/$ index.php?p=$1 [L] # CATEGORY RewriteRule ^([^/]*)/([^/]*)/$ index.php?p=$1&#38;i=$2 [L] # CATEGORY PAGES RewriteRule ^([^/]*)/([^/]*)/([^/]*)/$ index.php?p=$1&#38;i=$2&#38;pg=$3 [...]]]></description>
			<content:encoded><![CDATA[<p>First enable the clean url by editing config.php (inside includes folder).</p>
<pre>//enable mod rewrite urls. 0=disabled, 1=enabled for SEO Friendly URLS
$Gbl["ManualModRewrite"] = 1;</pre>
<p>The original rewrite rule (Apache) for the script are as follows :</p>
<pre>RewriteEngine On
#PAGES
RewriteRule ^([^/]*)/$ index.php?p=$1 [L]
# CATEGORY
RewriteRule ^([^/]*)/([^/]*)/$ index.php?p=$1&amp;i=$2 [L]
# CATEGORY PAGES
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/$ index.php?p=$1&amp;i=$2&amp;pg=$3 [L]</pre>
<p><span id="more-215"></span></p>
<p>You have to add your custom rewrite rule to nginx base on the Apache rewrite rule above. But don&#8217;t worry because I already do that for you. All you have to do is open your <strong>nginx.conf</strong> file or your virtual host configuration and add the following rule to the section  <strong>location /</strong>.</p>
<pre>if (!-e $request_filename){
                rewrite ^/([^/]*)/$ /index.php?p=$1 last;
                rewrite ^/([^/]*)/([^/]*)/$ /index.php?p=$1&amp;i=$2 last;
                rewrite ^/([^/]*)/([^/]*)/([^/]*)/$ /index.php?p=$1&amp;i=$2&amp;pg=$3 last;
        }</pre>
<p>Once added, save the configuration file and close your text editor. Now restart nginx with the following command.</p>
<pre>/etc/init.d/nginx restart</pre>
<p>Congratulation you have clean url on your <a href="http://www.pungit.com/script/open-source-wallpaper-script/" target="_blank">OSWallpaper</a> script now. <img src='http://www.pungit.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pungit.com/open-source-software/enable-oswallpaper-seo-urls-on-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Permalinks on Nginx</title>
		<link>http://www.pungit.com/tips-n-tricks/wordpress-permalinks-on-nginx/</link>
		<comments>http://www.pungit.com/tips-n-tricks/wordpress-permalinks-on-nginx/#comments</comments>
		<pubDate>Thu, 28 May 2009 04:17:33 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[wordpress premalinks]]></category>

		<guid isPermaLink="false">http://www.pungit.com/?p=207</guid>
		<description><![CDATA[First open your nginx configuration file. nano /etc/nginx/nginx.conf But if you set up a virtual host, you should open the virtual host configuration for the host where you install wordpress. If you are using Debian, the configuration files is located at /etc/nginx/sites-available/. The following command should do that. nano /etc/nginx/sites-available/example.com Now find the section location [...]]]></description>
			<content:encoded><![CDATA[<p>First open your nginx configuration file.</p>
<pre>nano /etc/nginx/nginx.conf</pre>
<p>But if you set up a virtual host, you should open the virtual host configuration for the host where you install wordpress. If you are using Debian, the configuration files is located at <strong>/etc/nginx/sites-available/</strong>. The following command should do that.</p>
<pre>nano /etc/nginx/sites-available/example.com</pre>
<p><span id="more-207"></span><br />
Now find the section <strong>location /</strong> . Add the following code inside the curly brackets {}.</p>
<pre>if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php?q=$1 last;
                break; } </pre>
<p>Below is virtual host sample configuration after adding the code above.</p>
<pre>
server {
    listen       80;
    server_name  example.com;

    error_log   logs/error-example.log;
    access_log  logs/access-example.log;

    location / {
        root   /var/www/example.com;
        index  index.html index.htm index.php;

        #error_page 404 = /index.php?q=$request_uri;
         if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php?q=$1 last;
                break; }
    }
    location ~ .php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME /var/www/example.com$fastcgi_script_name;
        fastcgi_index index.php;
        include /usr/local/nginx/conf/fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}
</pre>
<p>Now save the file and close the text editor. The changes will not take effect until you restart nginx. It’s totally different from Apache where you can edit .htaccess and don’t need to restart Apache in order to apply the change. So run the following command the restart nginx.</p>
<pre>/etc/init.d/nginx restart</pre>
<p>Now you can log in to your wordpress blog and customize your permalinks to your liking. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pungit.com/tips-n-tricks/wordpress-permalinks-on-nginx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nginx : Rewrite Rule for Wallpaper Site Creator</title>
		<link>http://www.pungit.com/open-source-software/nginx-rewrite-rule-for-wallpaper-site-creator/</link>
		<comments>http://www.pungit.com/open-source-software/nginx-rewrite-rule-for-wallpaper-site-creator/#comments</comments>
		<pubDate>Wed, 27 May 2009 04:29:36 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.pungit.com/?p=195</guid>
		<description><![CDATA[Nginx is a lightweight web server and mail proxy server. It was written by Igor Sysoev. Compare to Apache web server, nginx uses less resources. Beside that nginx configuration is pretty simple and easy to understand. If you using Apache and want to switch to nginx. The only thing that you should take care is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://nginx.net" target="_blank">Nginx</a> is a lightweight web server and mail proxy server. It was written by <a href="http://sysoev.ru/en/" target="_blank">Igor Sysoev</a>. Compare to <a href="http://httpd.apache.org/" target="_blank">Apache</a> web server, nginx uses less resources. Beside that nginx configuration is pretty simple and easy to understand. If you using Apache and want to switch to nginx. The only thing that you should take care is your rewrite rule. As you know nginx doesn’t support <strong>.htaccess</strong>, you have to completely rewrite all of yours rewrite rule. But today I will share my rewrite rule for Wallpaper Site Creator script.</p>
<p><span id="more-195"></span><br />
Below is the rewrite rule in the <strong>.htaccess</strong> for Apache :</p>
<pre>Options +FollowSymlinks

RewriteEngine On
RewriteRule ^category/([0-9A-Za-z\+\_\-]+)/$ /categories.php?Category=$1 [nc]
RewriteRule ^category/([0-9A-Za-z\+\_\-]+)/([0-9]+)/$ /categories.php?Category=$1&amp;page=$2 [nc]
RewriteRule ^wallpaper/([0-9A-Za-z\_\-]+)/$ /details.php?Title=$1 [nc]
RewriteRule ^images/wmwallpapers/(.+)$ /watermark.php?k=$1 [nc]</pre>
<p>To apply the same rewrite rules to nginx. Paste the following rule to your <strong>nginx.conf</strong> or in your nginx virtual host configuration file.</p>
<pre>if (!-e $request_filename) {
rewrite ^/category/([0-9A-Za-z\+\_\-]+)/$ /categories.php?Category=$1 last;
rewrite ^/category/([0-9A-Za-z\+\_\-]+)/([0-9]+)/$ /categories.php?Category=$1&amp;page=$2 last;
rewrite ^/wallpaper/([0-9A-Za-z\_\-]+)/$ /details.php?Title=$1 last;
rewrite ^/images/wmwallpapers/(.+)$ /watermark.php?k=$1 last;
}</pre>
<p>You should put it inside the<strong> location / {}</strong> section. Below is my virtual host configuration file after applying the rewrite rule.</p>
<pre>server {
listen       80;
server_name  wallpapers.com;

error_log   logs/error-wallpapers.log;
access_log  logs/access-wallpapers.log;

location / {
root   /var/www/wallpapers.com;
index  index.html index.htm index.php;

if (!-e $request_filename) {
rewrite ^/category/([0-9A-Za-z\+\_\-]+)/$ /categories.php?Category=$1 last;
rewrite ^/category/([0-9A-Za-z\+\_\-]+)/([0-9]+)/$ /categories.php?Category=$1&amp;page=$2 last;
rewrite ^/wallpaper/([0-9A-Za-z\_\-]+)/$ /details.php?Title=$1 last;
rewrite ^/images/wmwallpapers/(.+)$ /watermark.php?k=$1 last;
}
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /var/www/wallpapers.com$fastcgi_script_name;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
}

# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
root   html;
}

location ~ /\.ht {
deny all;</pre>
<p>Congratulation, you will now have a Wallpaper Site Creator script work on nginx web server. If you need any help or want to add any suggestion please do not hesitate to leave your comments. <img src='http://www.pungit.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pungit.com/open-source-software/nginx-rewrite-rule-for-wallpaper-site-creator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

