เปิดใช้งาน SSL บน UwAmp

https or ssl
จะขอให้ทำตามทีละขั้นตอนเลยนะครับ
  1. เปิดหน้าต่างหลัก UwAmp ขึ้นมา คลิกที่ปุ่ม Apache config
  2. คลิกแถบ Modules
  3. ติ๊ก ssl module แล้วกด ok
  4. กำหนด OPENSSL environment ให้กับ Windows นะครับ ตามขั้นตอนย่อยต่อไปนี้
    1. หาไฟล์ openssl.cnf ซึ่งหากติดตั้ง UwAmp ตำแหน่งดั้งเดิมจะอยู่ที่ C:\UwAmp\bin\apache\conf\openssl.cnf
    2. เปิด command prompt (start > cmd)
    3. พิมพ์คำสั่งดังนี้ set OPENSSL_CONF=C:\UwAmp\bin\apache\conf\openssl.cnf จากนั้นถือเป็นอันเสร็จสิ้นการกำหนด OPENSSL environment
  5. สร้าง key สำหรับ SSL ตามขั้นตอนต่อไปนี้ (อ้างอิงวิธีทำจาก http://www.neubreed.com.au/blog/enabling-and-configuring-ssl-for-apache-2-2-under-windows-wamp-server-2 นะครับ)
    1. เปิด command prompt (start > cmd)
    2. cd /UwAmp/bin/apache/bin
    3. openssl genrsa -des3 -out ../conf/server.key 1024
    4. openssl rsa -in ../conf/server.key -out ../conf/server.pem
    5. openssl req -new -key ../conf/server.key -out ../conf/server.csr
    6. หากมี error แจ้งว่า Unable to load config info... ให้ทำตามข้อ 4 หลักอีกครั้ง
    7. หากไม่มี error ระบบจะขึ้นหน้าถามต่างๆ ให้เรากรอก เช่น
      Country Name (2 letter code) [AU]: TH
      State or Province Name (full name) [Some-State]: Bangkok
      Locality Name (eg, city) []: City
      Organization Name (eg, company) [Internet Widgits Pty Ltd]: My company
      Organizational Unit Name (eg, section) []:
      Common Name (eg, YOUR name) []: mycom (อันนี้ให้กรอกชื่อคอมของเรา)
      Email Address []: my@emailaddress.tld
      A challenge password []:
      An optional company name []:
      
    8. openssl x509 -req -days 365 -in ../conf/server.csr -signkey ../conf/server.key -out ../conf/server.crt
  6. เปิดไฟล์ C:\UwAmp\bin\apache\conf\httpd_uwamp.conf
  7. ที่ด้านล่างสุดของไฟล์ ต่อจาก </VirtualHost> ปิด ให้ใส่ดังต่อไปนี้
    <VirtualHost *:443>
       #UWAMP Generate Virtual Host
       SSLEngine on
        SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
        SSLCertificateFile "C:/UwAmp/bin/apache/conf/server.crt"
        SSLCertificateKeyFile "C:/UwAmp/bin/apache/conf/server.key"
        DocumentRoot "C:/my-sites/"
    </VirtualHost>
    

    โดย C:/my-sites/ ให้เปลี่ยนเป็นตำแหน่งโฟลเดอร์ที่เก็บ www root ของคุณ.

  8. กด save ไฟล์
  9. restart apache

จากนั้นเป็นอันเสร็จขั้นตอนทั้งหมด เมื่อ apache restart สำเร็จ แสดงว่าไม่ควรจะมีปัญหาแล้ว ให้ทดลอง browse ไปที่ http://localhost และ https://localhost จะพบว่ามันแสดงหน้าตรงกัน ทั้งนี้ https://localhost อาจมีการแจ้ง error ก่อน ขึ้นอยู่กับแต่ละเบราเซอร์ ให้เรากดดำเนินการต่อไปก็จะสามารถเข้าชมเว็บไซต์ได้ตามปกติครับ.

บางกรณีอาจมี error ในหน้าต่างหลักของ UwAmp เช่น sslpassphrasedialog builtin is not supported on win32 ให้ทำการปิด SSLPassPhraseDialog โดยใส่ # ไว้ข้างหน้า ในไฟล์ C:\UwAmp\bin\apache\conf\extra\httpd-ssl_uwamp.conf แล้ว save ไฟล์ และ restart apache ก็น่าจะไม่มีปัญหาแล้วครับ.

2 comments on “เปิดใช้งาน SSL บน UwAmp

ใส่ความเห็น

อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น ช่องข้อมูลจำเป็นถูกทำเครื่องหมาย *

คุณอาจใช้แท็กHTMLและแอททริบิวต์เหล่านี้: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.