ไปดาวโหลด
https://github.com/win-acme/win-acme/releases/tag/v2.1.20.1
แล้ว เลือก win-acme.v2.1.20.1185.x64.pluggable.zip
แตกไฟล์ และ run เลือก New Certificate ..
ใน IIS ต้อง แก้ binding เป็นชื่อ Server ด้วย
ไปดาวโหลด
https://github.com/win-acme/win-acme/releases/tag/v2.1.20.1
แล้ว เลือก win-acme.v2.1.20.1185.x64.pluggable.zip
แตกไฟล์ และ run เลือก New Certificate ..
ใน IIS ต้อง แก้ binding เป็นชื่อ Server ด้วย
เวลา compile จะติด Security ที่ file .resx วิธีแก้ ต้องกำหนด Trust site วิธีการ ต้องไปเปิด IE และ ไปที่ internet setting
ตั้งให้เป็น Trust site
ถ้าใช้ Nodejs ร่วมกับ IIS ต้องใช้ url Rewrite และ reverse proxy เพื่อ ไปทำการ ส่ง และเปิด Port ระหว่าง IIS และ Node
โดยที่ Node จะทำงานเป็น Localhost:port
ต้องไป Load โปรแกรม
http://www.iis.net/downloads/microsoft/url-rewrite
และ
https://www.microsoft.com/en-us/download/details.aspx?id=47333
สร้าง Virtual Directory สร้าง Folder เช่น /abc ต้อง convert เป็น application ด้วย และ
สร้าง reverse proxy เวลาสร้าง ให้สร้าง ง่ายๆ ใส่ localhost และ web.com ธรรมดา แล้วค่อย มา Edit
มา ที่ localhost:port
และ อย่างลืม ตอน reverse rule ต้อง บอกให้เต็ม เช่น http://www.xyz.com/abc..
ปัญหา ถ้า ตั้ง Compress จะเกิด Error gzip
อันนี้ต้องตั้ง ค่า Rule ตาม Link นี้
ดูตัวอย่าง web.config ใน คำตอบ
เมื่อลง Mongodb เป็น Local host แล้ววิธี แก้ให้ Mongodb connect จาก ด้านนอก
1. add user admin และ password ก่อน
mongo
use admin
db.createUser( { user: "name", pwd: "pass", roles: [{ role: "root", db:"admin"}] } )
2 แก้ mongod.conf เพื่อ ให้ access จาก network อื่นได้
sudo vi /usr/local/etc/mongod.confsystemLog: destination: file path: /usr/local/var/log/mongodb/mongo.log logAppend: true storage: dbPath: /usr/local/var/mongodb net: bindIp: 127.0.0.1 -> 0.0.0.0 หรือ IP ที่ต้องการ3 Reboot หรือ restart services mongod
Window server กัน การเปิด Port มากกว่า 5000 ใน registry
https://docs.microsoft.com/en-US/troubleshoot/windows-client/networking/connect-tcp-greater-than-5000-error-wsaenobufs-10055
Regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
On the Edit menu, click New, and then add the following registry entry:
Value Name: MaxUserPort
Value Type: DWORD Value data: 65534
File powershell จะนามสกุล .ps1
comment ใช้ # นำหน้า
การเรียก process ใช้ & นำหน้า
มี argument ใช้ param($ตัวแปร)
ตัวอย่าง เป้นการ list process ทีเปิดport ใว้
การ filter ให้ใช้ regex
# kill process select port
Write-Output "Kill process at port"
param ($port)
$foundProcesses = netstat -ano | findstr :$port
$activePortPattern = ":$port\s.+LISTENING\s+\d+$"
# search between number and string
$pidNumberPattern = "\d+$"
# if search between number use "\d+\d"
#If
IF ($foundProcesses | Select-String -Pattern $activePortPattern -Quiet) {
$matches = $foundProcesses | Select-String -Pattern $activePortPattern
$firstMatch = $matches.Matches.Get(0).Value
#Match by regex
$pidNumber = [regex]::match($firstMatch, $pidNumberPattern).Value
taskkill /pid $pidNumber /f
}