การเข้า ssh บน google cloud เพื่อจัดการเครื่องบริการ

php-fpm
php-fpm

เมื่อ sign in เข้าไปแล้วก็จะพบกับคำว่า My console
ซึ่งจะต้องเลือกว่าเข้า Project ไหนที่เรากำลังจัดการอยู่ เมื่อเลือกแล้วก็จะมีตัวเลือก

Overview
Permissions
APIs & auth
Monitoring
Source Code
Deploy & Manage
[Compute]
Networking
Storage
Big Data

ในการเข้าจัดการเครื่องที่เลือกได้
เข้า Compute จะพบ App Engine, Compute Engine และ Container Engine
ซึ่งกรณีนี้เลือก Compute Engine ก็จะพบอีกมาก ผมเลือก VM instances ที่สร้างไว้
ก็จะเป็นการสร้าง instance ที่กำหนดว่าใช้ server แบบไหน ภาษาอะไร
งานที่ผมเข้าไปจัดการ Linux :Debian บน AMD64 + Nginx ก็จะใช้ SSH ที่อยู่หลัง instance ตัวที่สร้างขึ้น

$sudo su
#cd /opt/bitnami/nginx/conf/bitnami

พบว่า index ใน location ไม่ได้กำหนด index.php ก็ต้องเพิ่มเข้าไป
เพราะที่มีนั้น มีแต่ index.html กับ index.htm ไม่ใส่จะเป็นปัญหากับ wordpress

พบปัญหา 502 bad gateway แล้วก็พบคำแนะนำ
ใน http://serverfault.com/questions/457911/nginx-php-fpm-502-bad-gateway
จากการตรวจสอบ พบว่าไม่สอดคล้องกับสิ่งที่พบใน google cloud และไม่ใช่วิธีแก้ปัญหา
จึงไม่ได้ปรับแฟ้ม bitnami.conf ที่อยู่ใน google cloud

ตรวจสอบว่า php-fpm ทำงานอยู่ด้วย #ps -aux|grep php พบว่าทำงานอยู่
ตรวจสอบด้วย phpinfo() ก็บพว่า php-fpm ทำงานอยู่
ใน #tail /opt/bitnami/nginx/logs/access.log แต่ไม่ได้แสดงว่า php-fpm ทำงานด้วยรึเปล่า
พบว่า /opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf มีการ config การทำงานของ php-fpm เรียบร้อย
และ bitnami.conf ก็ include แฟ้ม phpfastcgi.conf มาเรียบร้อย
สรุปว่า nginx เรียกใช้ phpfastcgi หรือ php-fpm แน่นอน
เพราะเวลามีปัญหากับ php ใน error.log จะมีข้อความ
เช่น FastCGI send in stderr: “PHP Message: WordPress database error Table ‘xxx’ does’t exist for query SELECT …