Jump to content
cade

Php & Https

Recommended Posts

aku ada website yg berfungsi ngan http jer.....tp ada plak satu page yg aku rasa memerlukan extra security... so aku ingt nk pakai https? Aku harap otai2 bole la guide aku utk setup benda alah nih....jgn cakap terlalu general. Kang ilmu sesat plak yg aku warisi....

Share this post


Link to post
Share on other sites

Soalan masih generel lagi tu bro, cuba spesific lai. :lol: Part mana yg tak paham. nak install ke? nak configure ke? nak running?

kalo nak install.. aku suggest install openSSL http://www.openssl.org/source/ (open source)

pastu webserver kalo pki Apache, kena configure balik la apache tuh.

# ./configure --enable-ssl

kalo nak guna utk localhost, dah leh test dah ssl guna skrip kat bawah, tapi kalo nak guna dlm LAN ke? atau Internet ke, kena la open port 443 kat firewall server tu.

# iptables -A INPUT -i eth0 --protocol udp --source-port 443 -j ACCEPT

# iptables -A INPUT -i eth0 --protocol tcp --source-port 443 -j ACCEPT

# iptables -A OUTPUT -o eth0 --protocol udp --destination-port 443 -j ACCEPT

# iptables -A OUTPUT -o eth0 --protocol tcp --destination-port 443 -j ACCEPT

Pastu buat port forward dari gateway/router ke server

Pastu dah leh test guna php.

<?php
if($_SERVER['HTTPS'])
echo 'https is ON';
?>

Optional:

Kalo nak accept user dari internet for online payment kena install cert..

Kalo dlm satu server guna bnyk domain, edit httpd.conf kat vhost. configure cert tu bagi setiap vhost

Dah siap! :lol:

guide tu secara general je, boleh jadi tak sesuai dengan network ko. sbb tu kena spesific lagi soalan.. server pakai Windows/Linux? gateway internet pakai server box atau router blackbox. sbb kalau pakai server box linux nak port forward dia lain cara dia, kalau gateway pakai router kotak yg TMnet bagi tu plak lain cara dia. pastu kena tengok plak brand apa router tu. lain brand lain cara nak forward.. uhuhu..

Share this post


Link to post
Share on other sites

# iptables -A INPUT -i eth0 --protocol udp --source-port 443 -j ACCEPT
# iptables -A INPUT -i eth0 --protocol tcp --source-port 443 -j ACCEPT
# iptables -A OUTPUT -o eth0 --protocol udp --destination-port 443 -j ACCEPT
# iptables -A OUTPUT -o eth0 --protocol tcp --destination-port 443 -j ACCEPT

bro, yg ni nk run camna eh?

Aku guna windows dgn WAMP jer...sbb nk bt development masa tuh....(ni kat pc aku la)

So skrg aku ada website yg host kat linux, aku cume leh pakai cpanel jer utk administer hosting aku tuh....So camna aku nk open port 443 tuh kalo aku host guner shared hosting camnih?

Ada idea x?

Aiyah... nk install cert tuh camner eh? Aku reti development basic PHP jer...nk configure PHP ni pon terhegeh2....

Tp senario aku mcm aku terang kat atas.. So ada certain part aku kena gune https utk antar sensitive info.....so kat situ la kesedaran tu timbul

ps: ko nih mmg experience. Kalo leh include skali url yg best kat aku skali ye sifoo

Share this post


Link to post
Share on other sites

since ko pakai windows, command iptables tu ko abaikan... yg tu utk firewall dlm linux . huhu

Kalo ko pakai WAMP aku suggest ko cari WAMP yg suppot SSL. Ko check tengok kat sini http://en.wikipedia.org/wiki/Comparison_of_WAMPs

XAMPP pun popular gak.

http://www.apachefriends.org/en/xampp-windows.html

Ko nak install satu-satu ke or guna package? Kalo ko lebih selesa guna package pasang siap macam XAMPP senang sikit, tapi kalo ko nak install satu-satu.. payah sikit la keje, kena download source Apache + PHP + OpenSSL pastu kena download gcc utk Windows pastu compile & config satu-satu.. since ko dah pakai Windows, aku suggest ko pakai je yg pakej pasang siap utk tidak memeningkan kepada ko.

pastu cert tu takyah instal dalam development server pun takpe, janji SSL jalan cukup. ko kata pakai Cpanel kat server lain kan? cert tu ko kena install under account Cpanel ko, contact ngan admin server soh dia install cert.. biasanya diorang akan kenakan charge/fees bulan-bulan.

camner bro.. ok tak...? huhu

ps: sifo tu takde ar... tapi pengalaman tu ade la sket2.. :ph34r:

Share this post


Link to post
Share on other sites

ekceli kalo ko taknak beli cert lagi pun takpe, ko leh test dulu guna shared SSL. Shared SSL biasanya free. ko kongsi dengan user-user lain dalam server tu. cumanya ko terpaksa pakai URL macam ni:

https://www.webhosting.com/~cade/index.php <-- yg ni shared SSL

kalo nak pakai special utk ko... ko kena beli private SSL

https://www.cade.com <-- Private SSL

mostly web hosting dah install dah SSL tinggal nak enablekan kan je..

Share this post


Link to post
Share on other sites

wah sampai detail camtu sekali penerangan ko berry kekeke

p/s pastikan anda sediakan sedikit RM untuk dibuat bayaran apply SSL huhu

Share this post


Link to post
Share on other sites

huhuhu.. aku ingat memula dia kata nak install kat server. tu yg siap kluar iptables, firewall semua tu.. last-last nak install kat cpanel.. :lol:

ya.. ya betul cakap ejoe, sediakan sedikit RM untuk bayaran SSL, semua kerja akan dilakukan oleh pihak hosting. pendek kata ada duit semua jalan.. :D

Share this post


Link to post
Share on other sites

hehehe....aku mana la paham benda ssl nih...benda ni baru giler la kat aku... korang gelakkan budak baru blajar plak :(

skrg nih kalo da enable nk kena buat apa lg?

Share this post


Link to post
Share on other sites

WampServer include skali dengan OpenSSL tak? kalo wamp 2.2.8 tu dah siap dengan openssl, ko edit je httpd.conf pastu masukkan;

module ssl_module.so

cuba ko baca kat topik ni: http://www.wampserver.com/phorum/read.php?2,32986,page=1

kat situ siap dia ajar camner nak install cert kat dalam httpd-ssl.conf

cuba dulu bro, kalo jadi kasi bagitau kat sini.. aku tak biasa guna pakej.. biasa install satu-satu pastu compile manual. maybe yg biasa pakai wamp ni leh ar share kat sini.

Edited by rasberry

Share this post


Link to post
Share on other sites

tutorial nih aku da cuba...tp aku fail plak....wahahaha....ok skrg nih, ko ada website yg configure sumer tuh manually tak? tunjuk cara satu2

Share this post


Link to post
Share on other sites

bro.... jarang org compile apache kat windows. aku cari gak tutorial kat net tapi tak jumpa, dr compile kat windows baik org compile terus kat linux... aku nak wat tutorial pun tak brp pandai lagi.., tapi aku leh kasi general guideline .

Mula2 ko download dulu gcc compiler utk Windows. Gcc ni leh guna utk compile Apache.

http://sourceforge.net/projects/gcw/

Pastu ko download Apache source. cari yg source punya bukan binary. kalau binary dia dah siap compile utk ko. ko biasa compile software under linux tak? sbb nak compile guna gcc ni kena tau camner nak configure pakej pastu build (make) ke binary n ko kena study camner nak guna gcc. tutorial cari kat google. :lol:

kalo ko dah ada Microsoft Visual, ko leh gak pakai C++ compiler. tupun kalo ko biasa wat software utk windows la.. http://httpd.apache.org/docs/2.0/platform/win_compiling.html

kalo ko nak compile pki gcc pun boleh.. http://httpd.apache.org/docs/2.0/install.html. aku rekemen pakai gcc lagi senang ..huhu

mcm aku ckp sebelum ni, kalo ko tak biasa ko guna je benda yg dah siap. susah-susah sangat ko pki je XAMPP. tak pun pki Apache2Triad dia siap skali OpenSSL ngan mod_ssl. jgn pening-pening kapla bro.. nak includekan ssl kat wamp 2.2 pun ko dah pening inikan pulak nak compile satu-satu.. huhu.. takpe bro, slow2 blaja.. blajar dulu compile Apache, pastu leh gerak gi mysql, php, ssl lak. aku pun dulu sampai bengkak2 mata nak bwt benda ni. hohoho

Edited by rasberry

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...