Selasa, 17 April 2012

Here are my notes how I managed to get HTTPS working on Wamp5 in my test environment, meaning my laptop. The credits go to the guys at [www.apache-ssl.org].


OPENSSL_CONF ENVIRONMENT VARIABLE 

Go to Control Panel – System – Advanced – Environment Variables 

Add a new system variable OPENSSL_CONF: 

Variable name: OPENSSL_CONF 
Variable value: c:\wamp\Apache2\conf\openssl.cnf 

Log out and log back in. 

Go to the command prompt and type in: 

set | more 

Make sure you see the following line among the environment variables: 
OPENSSL_CONF=c:\wamp\Apache2\conf\openssl.cnf 


GENERATE KEY 

Again in the command prompt, go to C:\wamp\Apache2\bin and run the following command: 

openssl req -new > webserver.csr 

The command runs and prompts you to enter a PEM pass phrase and verify it. Write down the phrase because you will need it later. 

It will then ask you to enter information that will be incorporated into your certificate request. When the command finishes, it has created several files, including privkey.pem, in c:\wamp\apache2\bin. 

REMOVE PASSPHRASE 

Run the following command: 

openssl rsa -in privkey.pem -out webserver.key 

You will be prompted for the pass phrase from the previous step. The RSA key is written and the file webserver.key is now available in the folder. 

CONVERT INTO SIGNED CERTIFICATE 

Run the following command to create a certificate which expires after one year: 

openssl x509 -in webserver.csr -out webserver.cert -req -signkey webserver.key -days 365 


STORE CERTIFICATE FILES 

Create a folder c:\wamp\OpenSSL with the following subfolders: 

certs 
crl 
newcerts 
private 

Copy the following files to certs: 

webserver.cert 
webserver.csr 
webserver.key 

Copy the following files to private: 

.rnd 
privkey.pem 
cacert.pem (same as above, just a wild guess) 


MODIFY HTTPD-SSL.CONF 

Change the following lines, adjusting the email address and the paths to your settings: 

SSLSessionCache "shmcb:C:/wamp/Apache2/logs/ssl_scache(512000)" 

SSLMutex default 

# General setup for the virtual host 
DocumentRoot "C:/www/mysecuresite" 
ServerName localhost:443 
ServerAdmin myemail@example.com 
ErrorLog "C:/wamp/logs/mysecuresite_error_log" 
TransferLog "C:/wamp/logs/mysecuresite_access_log" 

SSLCertificateFile "C:/wamp/OpenSSL/certs/webserver.cert" 

SSLCertificateKeyFile "C:/wamp/OpenSSL/certs/webserver.key" 

SSLCARevocationPath "C:/wamp/OpenSSL/crl" 

<Directory "C:/wamp/Apache2/cgi-bin"> 

CustomLog "C:/wamp/logs/ssl_request_log" \ 
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" 



MODIFY OPENSSL.CNF 

There is a file openssl.cnf in c:\wamp\Apache2\conf even though no extension is shown in Windows Explorer. Go to the DOS command prompt and run DIR to see the file extension. Make a backup copy of this file first and rename it in DOS to openssl.cnf.txt so that you can edit it. 

Modify the base directory: 

dir = c:/wamp/OpenSSL # Where everything is kept 

Go to the DOS prompt and change the name of the file back to openssl.cnf. 


MODIFY HTTPD.CONF 


Change
#LoadModule ssl_module modules/mod_ssl.so
to
LoadModule ssl_module modules/mod_ssl.so

Last, but not least, make sure your secure site is part of the virtual hosts in Apache: 

# Secure (SSL/TLS) connections 
#Include conf/extra/httpd-ssl.conf 
Include conf/extra/httpd-ssl.conf 


TEST HTTPS 

Run httpd –t and make sure the syntax is OK. 

Restart Apache. 

Check that port 443 is open by running the following in the command prompt: 

netstat -an | more 


Test the https connection from your browser and hopefully it works :-) 



CLIENT CERTIFICATES 

For details on how to generate a client certificate see the instructions at [www.apache-ssl.org

Senin, 09 April 2012

Langkah pertama download versi phpMyAdmin versi terbaru di http://www.phpmyadmin.net/home_page/downloads.php.
saya menggunakan phpMyAdmin-3.4.5-all-languages.7z
Setelah download selesai , extract file tersebut. Lalu buat database : phpmyadmin .
Lalu import file create_tables.sql dan upgrade_tables_mysql_4_1_2+.sql dari folder script.
Replace phpmyadmin yang lama dengan yang baru , buka file config.default.php dari folder libraries.
kemudian ubah seperti dibawah ini :
/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';

Simpan dan jalankan http://localhost/phpmyadmin/

Selamat mencoba...
Contoh:
Jika pada apache

RewriteEngine On
RewriteRule ^index\.html$ ./index.php?mdrw=on
RewriteRule ^manual\.html$ ./index.php?action=manual&mdrw=on
RewriteRule ^([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vtopic&forum=$1&page=$2&mdrw=on

Maka pada Nginx
rewrite ^index\.html$ index.php?mdrw=on last;
rewrite ^manual\.html$ index.php?action=manual&mdrw=on last;
rewrite ^([0-9]+)_([0-9]+)\.html$ index.php?action=vthread&forum=$1&page=$2&mdrw=on last;

Semoga bermanfaat
Nginx (baca: engine x) adalah server HTTP dan Proxy dengan kode sumber terbuka yang bisa juga berfungsi sebagai proxy IMAP/POP3. Kode sumber nginx ditlis oleh seorang warga negara Rusia yang bernama Igor Sysoev pada tahun 2002 dan dirilis ke publik pada tahun 2004. Nginx terkenal karena stabil, memiliki tingkat performansi tinggi dan minim mengonsumsi sumber daya(sumber: wikipedia).

untuk download Nginx+Php+MySql dapat menuju langsung ke http://code.google.com/p/wemp/downloads/list 


Senin, 02 April 2012

Using a CREATE TABLE statement

The syntax for creating a primary key using a CREATE TABLE statement is:

CREATE TABLE table_name
(column1 datatype null/not null,
column2 datatype null/not null,
...
CONSTRAINT constraint_name PRIMARY KEY (column1, column2, . column_n)
);

For Example:

CREATE TABLE supplier
(supplier_idnumeric(10)not null,
supplier_namevarchar2(50)not null,
contact_namevarchar2(50),
CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)
);
In this example, we've created a primary key on the supplier table called supplier_pk. It consists of only one field - the supplier_id field.

We could also create a primary key with more than one field as in the example below:
CREATE TABLE supplier
(supplier_idnumeric(10)not null,
supplier_namevarchar2(50)not null,
contact_namevarchar2(50),
CONSTRAINT supplier_pk PRIMARY KEY (supplier_id, supplier_name)
);

Using an ALTER TABLE statement

The syntax for creating a primary key in an ALTER TABLE statement is:

ALTER TABLE table_name
add CONSTRAINT constraint_name PRIMARY KEY (column1, column2, ... column_n);

For Example:


ALTER TABLE supplier
add CONSTRAINT supplier_pk PRIMARY KEY (supplier_id);
In this example, we've created a primary key on the existing supplier table called supplier_pk. It consists of the field called supplier_id.

We could also create a primary key with more than one field as in the example below:

ALTER TABLE supplier
add CONSTRAINT supplier_pk PRIMARY KEY (supplier_id, supplier_name);

Drop a Primary Key

The syntax for dropping a primary key is:

ALTER TABLE table_name
drop CONSTRAINT constraint_name;

For Example:


ALTER TABLE supplier
drop CONSTRAINT supplier_pk;
In this example, we're dropping a primary key on the supplier table called supplier_pk.

Disable a Primary Key

The syntax for disabling a primary key is:

ALTER TABLE table_name
disable CONSTRAINT constraint_name;

For Example:


ALTER TABLE supplier
disable CONSTRAINT supplier_pk;
In this example, we're disabling a primary key on the supplier table called supplier_pk.

Enable a Primary Key

The syntax for enabling a primary key is:

ALTER TABLE table_name
enable CONSTRAINT constraint_name;

For Example:


ALTER TABLE supplier
enable CONSTRAINT supplier_pk;
In this example, we're enabling a primary key on the supplier table called supplier_pk.

Minggu, 01 April 2012

Buka file config.inc.php yang ada di folder phpMyadmin kemudian gantilah seperti dibawah ini
$cfg['blowfish_secret'] = ‘isidenganterserahanda’;
$cfg['Servers'][$i]['auth_type']     = 'cookie';    // Authentication method (config, http or cookie based)?]
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password
Hasil:

Setting phpMyAdmin Dengan Cookie

Subscribe to RSS Feed Follow me on Twitter!