จดเก็บไว้ก่อน
โชว์รายการ process ที่กำลังทำงานอย่างละเอียด
ps auxfew
เช็คว่า process id ที่ระบุ รันจาก binary file path ไหน
ls -la /proc/$PID/ | grep exe
หาว่า process id ที่ระบุ ต่อ connection ไปที่ไหนหรือเปล่า
lsof -i -P -n | grep $PID
Just another WordPress Site
จดเก็บไว้ก่อน
โชว์รายการ process ที่กำลังทำงานอย่างละเอียด
ps auxfew
เช็คว่า process id ที่ระบุ รันจาก binary file path ไหน
ls -la /proc/$PID/ | grep exe
หาว่า process id ที่ระบุ ต่อ connection ไปที่ไหนหรือเปล่า
lsof -i -P -n | grep $PID
for u in `ls`; do
if [ -d $u/domains ]; then
# Get UID of directory name
uid=$(stat -c "%u" $u);
find $u -user $uid -exec chown $u "{}" \; ;
gid=$(stat -c "%g" $u);
find $u -group $gid -exec chgrp $u "{}" \; ;
if [ -f $u/public_html ]; then chown -h $u:$u $u/public_html ; fi;
fi;
done;
เคสปัญหา megento มันสร้าง symbolic link พวก static file ไว้ใน pub/ แต่มันสร้างแบบ static-path ลากมาตั้งแต่ /home/ เลย เลยทำให้มันปัญหากับสิทธิ์เว็บเซิร์ฟเวอร์ในการเข้าถึงไฟล์ เก็บคำสั่งไว้คร่าวๆ ก่อนแล้วกัน
#!/bin/sh
find -type l > links
while read i; do
target=$(readlink "${i}");
if [[ $target == /home/* ]]; then
count=$(grep -o "/" <<< "$i" | wc -l)
count=$(( $count - 1 ))
prefix=$( printf "%${count}s\n" | sed "s# #../#g" );
suffix=$( echo $target | sed 's#^.*/public_html/##' );
newlink="${prefix}${suffix}"
ln -sfv $newlink $i;
fi;
done < links