Create an account    
 home  
 
Web www.thaihealth.net
  You are here:> home>topics> linux for newbies > การติดตั้ง Secure Apache 2 ©
การติดตั้ง Secure Apache 2
Posted on Sunday, September 28 @ 02:00:00 GMT+7 by admin

linux for newbies

การติดตั้งSecure Apache 2

ภาคต่อจากการติดตั้ง Apache ธรรมดา เราลองใส่ mod_ssl ไปแล้ว ตอนนี้เราลองสร้าง certificate file เพื่อจะได้เข้าเรียกใช้ https กัน

การสร้าง secure Apache (โดยใช้ Apache-ssl หรือ Mod-ssl)

ผมจะไม่อธิบายศัพท์อะไรมากมายนะครับ เพราะนี่คือสมุดเลคเชอร์ของผมด้วย ศัพท์มีเยอะครับแนะนำให้อ่านก่อน ถ้าอยากทราบให้ดูได้ที่

http://www.dochost.net/manual

1.การสร้าง RSA key สำหรับ Apache

  • # openssl genrsa -des3 -out server.key 1024
  • ในกรณีที่ต้องการสร้าง decrypt version(ไม่แนะนำ)ใช้คำสั่ง
  • # openssl rsa -in server.key -out server.key.unsecure

2.การสร้าง CSR( certificate signing request) เพื่อส่งไปยังหน่วยงานที่ออกใบรับรอง

  • # openssl reg -new -key server.key -out server.csr
  • ตรวจสอบดูโดย
  • # openssl reg -noout -text -in server.csr

3.ส่ง server.csr ซึ่งจะเป็น text file ไปยังสถานที่รับจดทะเบียน เช่น verisign เพื่อซื้อ certificate ซึ่งจะได้เป็น Server.crt

4.เราอาจจะสร้าง certificate ด้วยตนเองได้ ซึ่งไม่แนะนำให้ทำใน production site แต่ทำได้โดย

  • # openssl genrsa -des3 -out ca.key 1024
  • # openssl reg -new -x509 -days 365 -key ca.key -out ca.crt
  • หา script ที่แถมมากับ openssl package จะอยู่ใน subdirectory /pkg.contrib/sign.sh
  • # ./sign.sh /path-to/server.csr ซึ่งเราจะได้ server.crt

5.ไม่ว่าเราจะส่งไป verisign หรือ sign เอง ตอนนี้จะได้สองไฟล์ที่สำคัญคือ server.crt และ server.key ให้กอปปี้ไปวางไว้ที่ /etc/ssl

6.หลังจากนั้นก็ปรับแต่งไฟล์ httpd.conf

SSLEngine on

SSLCertificateFile etc/ssl/server.crt

SSLCertificateKeyFile  etc/ssl/server.key

หรือปรับแต่งอื่น ๆ ซึ่งจะได้กล่าวต่อไป

การเรียกใช้ ลองเรียกเข้าที่ https://yourserver.com จะมีกล่องข้อความและรูปกุญแจอยู่ที่ข้างล่างขวา ซึ่งแสดงว่าเป็น secure server 


blog this


blog this

More about linux for newbies
· apache 2.0.54 has come, see the changes2005-06-25 13:20:47
· apache 2.0.49 released. Try!2004-03-23 12:27:38
· New Linux Server project2003-07-17 11:13:23

Comment Post
1  by
on Sunday, March 16 @ 19:31:54 GMT+7
منتديات [f.jsoftj.com

Read the rest of this comment...




Your Name:

[ New User ]

Subject:


Comment:

Allowed HTML:
<b> <i> <a> <em> <br> <strong> <blockquote> <tt> <li> <ol> <ul>
Security code:



T news tweak
 

       Sponsored Links
       Related Links
· More about linux for newbies
· News by admin


Most read story about linux for newbies:
 New Linux Server project(4466)

       Article Rating
Average Score: 0
Votes: 0

Please take a second and vote for this article:

Excellent
Very Good
Good
Regular
Bad


       Options

 Printer Friendly  Printer Friendly

 Send to a Friend  Send to a Friend

News ©

เล่นเกมส์ arcade games free!

main sitethaihealth | home | forums | downloads | topics

Seo from our desk thai seo
Web site engine code is Copyright © 2003 by PHP-Nuke.Copyright 2007 Thaihealth and pattaya doctor
Page Generation: 0.157 Seconds

Theme developed by WebDesignHQ.com Modified By DoctorNUKE