Senin, 21 Desember 2009

Membuat short URL sendiri

Sudah tahu kan SHORT URL kaya tinyurl, Bit.ly, su.pr, dll.
kaskus juga punya kaya : http://kask.us/2568039

ane mau share cara bikin nya pake yourls :
yg dibutuhin
1. hostingan + domain kaya nama.at, nama.lv, nama.ly, atau kask.us
2. PHP 4.3 and MYSQL 4.1 ++ (di hosting nya)
baca aja : YOURLS requirements

Download yourls nya di sini :
http://code.google.com/p/yourls/downloads/list

Selesai download extract, trus buka folder includes/config-sample.php,edit file config-sample.php
seperti ini :

/*
** MySQL settings - You can get this info from your web host
*/

/** MySQL database username */
define('YOURLS_DB_USER', '1.dbuser');

/** MySQL database password */
define('YOURLS_DB_PASS', '2.dbpassword');

/** The name of the database for YOURLS */
define('YOURLS_DB_NAME', '3.shorturl');

/** MySQL hostname */
define('YOURLS_DB_HOST', '4.localhost');

/** MySQL URL table name. Don't change this if in doubt. */
define('YOURLS_DB_TABLE_URL', '5.url');

/** MySQL Next ID table name. Don't change this if in doubt. */
define('YOURLS_DB_TABLE_NEXTDEC', 'next_id');

/*
** Site options
*/

/** Turn this on to enable error reporting. Recommended value is false **/
define('YOURLS_DEBUG', false);

/** Short domain URL, no trailing slash */
define('YOURLS_SITE', '6.http://site.com'); //

/** Timezone GMT offset */
define('YOURLS_HOURS_OFFSET', 0);

/** Private means protected with login/pass as defined below. Set to false for public usage. */
define('YOURLS_PRIVATE', true);

/** A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: copy from http://yourls.org/cookiekey.php **/
define('YOURLS_COOKIEKEY', 'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm');

/** Username(s) and password(s) allowed to access the site */
$yourls_user_passwords = array(
'7.username' => 'password',
'8.username2' => 'password2' // You can have one or more 'login'=>'password' lines
);

/*
** URL Shortening settings
*/

/** URL shortening method: 36 or 62 */
define('YOURLS_URL_CONVERT', 36);
/*
* 36: generates case insentitive lowercase keywords (ie: 13jkm)
* 62: generate case sensitive keywords (ie: 13jKm or 13JKm)
* Stick to one setting, don't change after you've created links as it will change all your short URLs!
* Base 36 should be picked. Use 62 only if you understand what it implies.
* Using base 62 means you *need* PHP extension BCMath
*/

/**
* Reserved keywords (so that generated URLs won't match them)
* Define here negative, unwanted or potentially misleading keywords.
*/
$yourls_reserved_URL = array(
'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay',
);


/******************** DO NOT EDIT ANYTHING ELSE ********************/

// Include everything except auth functions
require_once (dirname(__FILE__).'/version.php');
require_once (dirname(__FILE__).'/functions.php');
require_once (dirname(__FILE__).'/functions-baseconvert.php');
require_once (dirname(__FILE__).'/class-mysql.php');

*ubah yg di cetak tebal aja :
1.dbuser : username database
2.dbpassword : password database
3.shorturl : nama database nya
4.localhost : alamat MySQL database nya
5.url : nama table di database nya (bebas mu di ganti atau tidak)
6.http://site.com : alamat url anda. kaya kask.us
7.username' => 'password' : username buat masuk configurasi yourls nya, e/x -> user :admin, pass :admin
8.username2' => 'password2' : bila mau di gunakan ubah juga sma kaya no.7, tapi user sama pass nya jangan di sama kaya di no.7

Setelah edit semua nya. 
save as jadi config.php
masuk ke cpanel hostingannya,



setelah database di bikin, upload semua file ke root folder name di hosting misalnya : /public_html, /www, /html, DLL.


udah semua file di upload, buka http://domainkamu.com/admin/install.php
terus keluar layout seperti ini :



klik YOURLS administrations page , user dengan pasnya yg tadi di setting di config.php (no.7)

*saya sudah coba pake free domain co.cc

Dikutip dari :
http://www.hongkiat.com/blog/how-to-create-url-shortener-with-your-domain/

sumber : (http://www.kaskus.us/showthread.php?t=2568039)

1 komentar:

Blogger mengatakan...

Did you know that you can shorten your links with OUO and receive dollars from every click on your short urls.

Posting Komentar

Thanks for your comment in http://notebookshare.blogspot.com

Follower