<?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>Shai Perednik.com &#187; mod_rewrite</title> <atom:link href="http://shaiperednik.com/tag/mod_rewrite/feed/" rel="self" type="application/rss+xml" /><link>http://shaiperednik.com</link> <description>IT Guru &#38; Developer</description> <lastBuildDate>Fri, 30 Dec 2011 13:52:36 +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 mod_rewrite in APACHE</title><link>http://shaiperednik.com/2009/08/enable-mod_rewrite-in-apache/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=enable-mod_rewrite-in-apache</link> <comments>http://shaiperednik.com/2009/08/enable-mod_rewrite-in-apache/#comments</comments> <pubDate>Fri, 21 Aug 2009 18:11:35 +0000</pubDate> <dc:creator>Shai Perednik</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[blockquote]]></category> <category><![CDATA[Bookmarklet]]></category> <category><![CDATA[CURL]]></category> <category><![CDATA[IO]]></category> <category><![CDATA[mod_rewrite]]></category> <category><![CDATA[php]]></category> <category><![CDATA[Sudo]]></category> <category><![CDATA[tr.im]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://shaiperednik.com/?p=512</guid> <description><![CDATA[With all the commosion lately relating to tr.im&#8217;s closure and reopening most people are opting to setup their own shortning service. There&#8217;s Lessn and Yours.  Both I searched around but couldn&#8217;t get a clear answer that worked. With all the hullabaloo lately relating to tr.im&#8216;s closure and reopening most people are opting to setup their own [...]]]></description> <content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">With all the commosion lately relating to <a href="http://shaiperednik.com/tag/tr-im/" class="st_tag internal_tag" rel="tag" title="Posts tagged with tr.im">tr.im</a>&#8217;s closure and reopening most people are opting to setup their own shortning service.</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">There&#8217;s Lessn and Yours.  Both</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I searched around but couldn&#8217;t get a clear answer that worked.</div><p>With all the <span style="font-family: Arial; line-height: normal; border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">hullabaloo</span> lately relating to <a href="tr.im" target="_blank">tr.im</a>&#8216;s closure and reopening most people are opting to setup their own shortning service.</p><p>There&#8217;s <a href="http://shauninman.com/archive/2009/08/17/less_n" target="_blank">Lessn</a> and <a href="http://yourls.org/" target="_blank">Yourls</a>.  Both are great but Yours takes the cake for the admin panel and more detailed info.   I followed the <a href="http://lifehacker.com/5335216/make-your-own-url-shortening-service" target="_blank">LifeHacker Tutorial</a>,<span style="background-color: #ffffff;"> but couldn&#8217;t get <span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;"><strong><a href="http://shaiperednik.com/tag/mod_rewrite/" class="st_tag internal_tag" rel="tag" title="Posts tagged with mod_rewrite">mod_rewrite</a> </strong>working.  With the help of this <a href="http://ubuntuforums.org/showthread.php?t=255556&amp;page=2">post</a> I figured it out.</span></span></p><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">change the following line in /etc/<a href="http://shaiperednik.com/tag/apache/" class="st_tag internal_tag" rel="tag" title="Posts tagged with apache">apache</a>2/sites-enabled/000-default</span></p><blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px;"> </span></p><pre class="alt2" style="background-image: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; color: #000000; width: 640px; height: 194px; text-align: left; overflow-x: auto; overflow-y: auto; background-position: initial initial; padding: 6px; margin: 0px; border: 1px inset initial;" dir="ltr"> DocumentRoot /var/www/
        &lt;Directory /&gt;
                Options FollowSymLinks
                <span style="color: red;">AllowOverride all</span>
        &lt;/Directory&gt;
        &lt;Directory /var/www/&gt;
                Options FollowSymLinks
                <span style="color: red;">AllowOverride all</span>
                Order allow,deny
                allow from all
        &lt;/Directory&gt;</pre></blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">then restart apache</span></p><blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;"><a href="http://shaiperednik.com/tag/sudo/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Sudo">sudo</a> /etc/init.d/apache2 restart</span></p></blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">Theres also a <a href="http://jarb.ro/M">bookmarklet</a> for Yourls from <a href="http://twitter.com/jarbro" target="_blank">twitter.com/jarbro</a> <span style="text-decoration: line-through;">but I&#8217;m still working on getting past the &#8220;Unknown&#8221; error.</span></span></p><p><strong>UPDATE: </strong>The unknown error is normal.  You just need to drag the links to the bookmark bar.</p><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">I have to install <a href="http://shaiperednik.com/tag/php/" class="st_tag internal_tag" rel="tag" title="Posts tagged with php">php</a>5-<a href="http://shaiperednik.com/tag/curl/" class="st_tag internal_tag" rel="tag" title="Posts tagged with CURL">curl</a> just to get the <a href="http://shaiperednik.com/tag/curl/" class="st_tag internal_tag" rel="tag" title="Posts tagged with CURL">curl</a>_init() function installed</span></p><blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">sudo apt-get php5-curl</span></p><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">sudo  /etc/init.d/apache2 restart</span></p></blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">Hopefully this helps someone</span></p><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;"><br /> </span></p><p><a href="http://shaiperednik.com/2009/08/enable-mod_rewrite-in-apache/" rel="bookmark">Enable mod_rewrite in APACHE</a> originally appeared on <a href="http://shaiperednik.com">Shai Perednik.com</a> on August 21, 2009.</p> ]]></content:encoded> <wfw:commentRss>http://shaiperednik.com/2009/08/enable-mod_rewrite-in-apache/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Make Your Own URL Shortening Service [Feature]</title><link>http://shaiperednik.com/2009/08/make-your-own-url-shortening-service-feature/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=make-your-own-url-shortening-service-feature</link> <comments>http://shaiperednik.com/2009/08/make-your-own-url-shortening-service-feature/#comments</comments> <pubDate>Sun, 16 Aug 2009 03:20:04 +0000</pubDate> <dc:creator>System</dc:creator> <category><![CDATA[My Clippings]]></category> <category><![CDATA[Bookmarklet]]></category> <category><![CDATA[Extract]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[IO]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Mac]]></category> <category><![CDATA[mod_rewrite]]></category> <category><![CDATA[php]]></category> <category><![CDATA[script]]></category> <category><![CDATA[tr.im]]></category> <category><![CDATA[way]]></category> <category><![CDATA[wind]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[XP]]></category><guid isPermaLink="false">http://shaiperednik.com/2009/08/make-your-own-url-shortening-service-feature/</guid> <description><![CDATA[Automatically pulled from My Clippings on NewsGator Online URL shortening services are ubiquitous on Twitter and other cramped online spaces. They won&#8217;t all last, as tr.im has demonstrated, and their shutdowns could annihilate your linking history. If you own a domain, though, you can host your own service. Even if you consider the links you&#8217;ve [...]]]></description> <content:encoded><![CDATA[<p>Automatically pulled from <a href="http://services.newsgator.com/ngws/svc/ClippingsRSS.aspx?uid=1639696">My Clippings on NewsGator Online</a></p><p><a rel="lytebox" href="http://cache.gawker.com/assets/images/lifehacker/2009/08/yourls_splash3.jpg" rel="lightbox[473]"><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/9f764_500x_yourls_splash3.jpg" class="left image500" width="500" /></a>URL shortening services are ubiquitous on Twitter and other cramped online spaces. They won&#8217;t all last, as <a href="http://blog.tr.im/post/160697842/tr-im-resurrected">tr.im has demonstrated</a>, and their shutdowns could annihilate your linking history. If you own a domain, though, you can host your own service.</p><p>Even if you consider the links you&#8217;ve shortened for Facebook, Twitter, IMs and other services to be just of-the-moment, nothing-serious items that aren&#8217;t worth <a href="http://lifehacker.com/5335553/free-tools-to-back-up-your-online-accounts">backing up</a>, leaving a host of dead links lingering around the net isn&#8217;t good for anybody, or anybody&#8217;s searches. There&#8217;s not a lot you can do about your already-posted social network links, but anyone who&#8217;s got $10 for a domain name registration, and a creative short URL idea, can host, monitor, and control their shortened links.</p><p><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/9f764_yourls.jpg" class="left image340" width="340" />We&#8217;re going to run through a basic installation of <a href="http://yourls.org/">Yourls</a>, a server-based webapp that can run pretty much anywhere a <a href="http://shaiperednik.com/tag/wordpress/" class="st_tag internal_tag" rel="tag" title="Posts tagged with WordPress">WordPress</a> installation can. There are lots of other options, which we&#8217;ll get to as well, but Yourls is a fairly smart and fast <a href="http://shaiperednik.com/tag/way/" class="st_tag internal_tag" rel="tag" title="Posts tagged with way">way</a> to get up and running with your own URL shortener.</p><h3>What you&#8217;ll need</h3><ul><li><strong>Hosted or DIY server space:</strong> That space must be running at least <a href="http://shaiperednik.com/tag/php/" class="st_tag internal_tag" rel="tag" title="Posts tagged with php">PHP</a> 4.3, MySQL 4.1, and with &#8220;<code><a href="http://shaiperednik.com/tag/mod_rewrite/" class="st_tag internal_tag" rel="tag" title="Posts tagged with mod_rewrite">mod_rewrite</a></code>&#8221; enabled. In plain English, that&#8217;s most any mainstream web server an individual pays about $5/month to for basic hosting. For DIY server types, any installation of <a href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)">LAMP</a> on <a href="http://shaiperednik.com/tag/linux/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Linux">Linux</a>, <a href="http://www.wampserver.com/">WAMP</a> on Windows, or <a href="http://www.mamp.info/">MAMP</a> on a <a href="http://shaiperednik.com/tag/mac/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Mac">Mac</a>. If you&#8217;re going the DIY route with a Windows system, our guide to <a href="http://lifehacker.com/214455/hack-attack-set-up-and-host-a-blog-on-your-home-computer">setting up and hosting a blog on your computer</a> covers many of the basics of patching your own web-facing system together.</li><li><strong>A domain name:</strong> You&#8217;ll preferably want something short, which can be difficult in the super-saturated .com/.biz/.net market. You might get inspired and lucky, but you also might need to pay just a bit more for an international top-level domain (TLD)&mdash;the part after the period, like .tv, .nl, and the like&mdash;which can cost between $15-$90. The URL used in the screenshots up top is an example, albeit not really feasible, unless I figure out how to buy a straight-up Nicaraguan TLD.</li><li><strong>Access to your server files:</strong> Whether you use an FTP client (like one of our <a href="http://lifehacker.com/5039956/five-best-ftp-clients">readers&#8217; five picks</a>), a command line, or your host&#8217;s web access, you&#8217;ll need to copy one folder over somewhere on your server.</li></ul><h3>Setting up</h3><p><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/9f764_database.jpg" class="left image340" width="340" />First up, go and <a href="http://code.google.com/p/yourls/downloads/list">download the latest Yourls package</a>, then un-zip it somewhere you can get to it. After that, determine how you can access your server&#8217;s databases&mdash;can you create new, separate databases yourself, or do you only get access to a single spot?</p><p>I use 1&amp;1 to host my personal web site, so in my case, that involves heading to my &#8220;control panel&#8221; at <code>admin.1and1.com</code>, logging in, clicking on &#8220;MySQL Administration,&#8221; then clicking the &#8220;New Database&#8221; button and naming it &#8220;yourls.&#8221; Your mileage will vary from host to host, but it&#8217;s likely you can <a href="http://shaiperednik.com/tag/google/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a> around and figure out how to create a new database, or access the one you&#8217;re given. Copy all those strings of characters for the database&#8217;s name, host name, user, and password, then head back to where you stashed your Yourls download.</p><p><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/9f764_yourls_config.jpg" class="left image340" width="340" />Inside the folder you extracted from the Yourls archive package, head inside the &#8220;includes&#8221; folder and look for <code>config-sample.php</code>. Open it inside a text editor, and, near the top, you&#8217;ll find a series of lines asking you to fill in a username, database name, password, host name&mdash;all the stuff you grabbed from your host. Replace the default answers for those four settings inside the single quotes on the right, as shown in the picture here.</p><p>Farther down the file, under &#8220;Site options,&#8221; look for a line asking for a &#8220;Short domain URL.&#8221; If you&#8217;ve got your own domain name, simply fill it out and be sure to leave off the trailing &#8220;/&#8221; slash. If, like me, you&#8217;re putting Yourls in a sub-folder of your existing domain name, fill out the sub-folders and, again, leave off the slash.</p><p>Finally, decide whether you want to let everybody and his brother create short URLs through your site, or whether you&#8217;ll hand out passwords. For the former, open option, simply change the value next to &#8220;<code>YOURLS_PRIVATE</code>&#8221; to <code>true</code>. For the likely more sensible, password-protected setup, substitute the <code>username</code> and <code>password</code> values just a bit further down the file.</p><p>When you&#8217;re all done with everything, re-save the file with a new name, <code>config.php</code>. If you&#8217;re installing Yourls in a sub-folder of your domain, you&#8217;ll need to make one more tweak. In a file named <code>.htaccess</code> in the main Yourls folder (which might be hidden, so enable your &#8220;show hidden files&#8221; setting), remove the &#8220;#&#8221; from the beginning of the line, and add in your folder names after the <code>RewriteBase /</code>&mdash;in my case, that became <code>RewriteBase /u/</code>, because I installed Yourls at <code>thepurdman.com/u/</code>. Save and close that file.</p><p>Your last setup step is to fire up your FTP client, command line, or web access tool and copy the contents of your Yourls folder to your server. Those with dedicated domains can just drop those folders and files into the main access space, or the <code>www</code> section in some cases, while those doing a sub-folder installation should drop them in that folder.</p><h3><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/9f764_yourls_success.jpg" class="left image340" width="340" />Using Yourls</h3><p>If the files copied without error to your server, head to where you put them in a browser, followed by <code>/admin/install.php</code>. If your database and configuration files were set up successfully, you&#8217;ll see a confirmation like the one pictured at left. Head to your Yourls installation site, followed by <code>/admin</code>, and let&#8217;s make some links.</p><p><a rel="lytebox" href="http://cache.gawker.com/assets/images/lifehacker/2009/08/using_yourls.jpg" rel="lightbox[473]"><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/3089b_500x_using_yourls.jpg" class="left image500" width="500" /></a></p><p>As you can see above (or click for a larger view), Yourls has a fairly straightforward interface. Type in a long URL, a custom short code, if you&#8217;d like, and hit &#8220;Generate Short URL&#8221; to have your server do its thing. The administrator can edit and delete short URLs created with his domain, and search for existing short links with filters and keywords.</p><p>That&#8217;s about it for Yourls&mdash;it&#8217;s one of those apps that, once you get it working, just works. There are, however, two added tools worth noting: a <a href="http://yourls.org/#Plugin">WordPress plugin</a> that can automate the creation of Yourl-generated short links for each and every post, and a <a href="http://planetozh.com/blog/2009/06/introducing-yourls-your-own-url-shortener-and-its-wordpress-plugin-companion/?cp=2#comment-94991">bookmarklet generator</a> for those who don&#8217;t want to head back to their own site to create new short links.</p><h3>Other options</h3><p>Have your own domain, but not paid server space? Are you mostly a blogger who just wants secure links back to your own content? Here&#8217;s a few avenues to explore:</p><ul><li><a href="http://www.google.com/enterprise/marketplace/viewListing?productListingId=5143210+6352879591152674960">Google Short Links</a> &#8211; A &#8220;Labs&#8221; feature of the free Google Apps domain package. There&#8217;s no easy-to-install <a href="http://shaiperednik.com/tag/bookmarklet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Bookmarklet">bookmarklet</a> for quick generation, but it does allow for tracking and editing, just like Yourls.</li><li><a href="http://www.stumbleupon.com/developers/Supr:Short_URLs_on_your_own_domain/">su.pr</a> &#8211; <a href="http://stumbleupon.com">StumbleUpon</a>&#8216;s URL shortener, but install-ready for your server space or WordPress installation.</li><li><a href="http://code.google.com/p/phurl/">Phurl</a> &#8211; Another PHP/MySQL-based, DIY shortener package, with a different feel and options.</li><li><a href="http://wordpress.org/extend/plugins/short-url-plugin/">Short URL</a> and <a href="http://wordpress.org/extend/plugins/le-petite-url/">Le Petite URL</a> &#8211; WordPress-based plugins that auto-generate short URLs for each of your pages and posts.</li></ul><hr /> Got your own way around potentially faltering URL services? Found a neat <a href="http://shaiperednik.com/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with script">script</a>, server package, or free webapp that gets your URL shortening done? Tell us about it, and anything else you&#8217;ve tried, in the comments. <em>Thanks to <a href="http://rufosanchez.com/">Rufo</a> for the links and tech support!</em></p><p><a href="http://ads.pheedo.com/click.phdo?s=51e1d526b460bfe983bdcb177c4a4ae1&amp;p=1"><img alt="" style="border: 0" border="0" src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/3089b_img.phdo?s=51e1d526b460bfe983bdcb177c4a4ae1&amp;p=1" /></a><div> <a href="http://feeds.gawker.com/~ff/lifehacker/full?a=nb8aKj56L74:VbVLNjEg4HU:H0mrP-F8Qgo"><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/3089b_full?d=H0mrP-F8Qgo" border="0"></img></a> <a href="http://feeds.gawker.com/~ff/lifehacker/full?a=nb8aKj56L74:VbVLNjEg4HU:yIl2AUoC8zA"><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/32a33_full?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.gawker.com/~ff/lifehacker/full?a=nb8aKj56L74:VbVLNjEg4HU:D7DqB2pKExk"><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/32a33_full?i=nb8aKj56L74:VbVLNjEg4HU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.gawker.com/~ff/lifehacker/full?a=nb8aKj56L74:VbVLNjEg4HU:V_sGLiPBpWU"><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/32a33_full?i=nb8aKj56L74:VbVLNjEg4HU:V_sGLiPBpWU" border="0"></img></a></div><p><img src="http://shaiperednik.com/wp-content/plugins/wp-o-matic/cache/32a33_nb8aKj56L74" height="1" width="1" /><br /> <a href="http://services.newsgator.com/ngws/svc/ClippingsRSS.aspx?uid=1639696">Go to Source</a></p><p><a href="http://shaiperednik.com/2009/08/make-your-own-url-shortening-service-feature/" rel="bookmark">Make Your Own URL Shortening Service [Feature]</a> originally appeared on <a href="http://shaiperednik.com">Shai Perednik.com</a> on August 15, 2009.</p> ]]></content:encoded> <wfw:commentRss>http://shaiperednik.com/2009/08/make-your-own-url-shortening-service-feature/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/6 queries in 0.001 seconds using disk: basic
Object Caching 720/720 objects using disk: basic

Served from: shaiperednik.com @ 2012-02-04 17:04:55 -->
