Category Archives: CentOS

[Python] fix error while loading shared libraries: libpython2.7.so.1.0

error log: /opt/rh/python27/root/usr/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory check libpython2.7.so.1.0 exist? find . -name ‘libpython2.7.so.1.0’ if the file was exist: edit the ldconfig config echo “/opt/rh/python27/root/usr/lib64” > /etc/ld.so.conf.d/python27.conf ldconfig … Continue reading

Posted in CentOS, Python | Leave a comment

Add git branch name to bash prompt

edit ~/.bash_profile

Posted in CentOS, Git, Linux, Mac, Ubuntu | Leave a comment

Apache SSL Enable

環境 CentOS 5.x i386 產生 key

產生 csr

cat csr,將資料丟到憑證申請的網站輸入

以namecheap的comodo憑證為例,選擇伺服器為 apache + mod_ssl,會回傳兩個檔案至mail中 cowman_ip.ca-bundle cowman_ip.crt 安裝mod_ssl

取消需要輸入phase的機制

編輯 apache 設定檔,範例是在 /etc/httpd/conf.d/ssl.conf

將 http 轉至 https,修改 /etc/httpd/conf/httpd.conf

重新啟動 apache

!! 記得檢查iptables防火牆設定

Posted in Apache, CentOS, SSL | Leave a comment

使用GMail SMTP寄信 – ssmtp (CentOS)

yum install ssmtp vim /etc/ssmtp/ssmtp.conf root=username@gmail.com mailhub=smtp.gmail.com:587 RewriteDomain= Hostname=username@gmail.com UseSTARTTLS=yes AuthUser=username@gmail.com AuthPass=password FromLineOverride=YES TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt alternatives –config mta 選擇 /usr/sbin/sendmail.ssmtp 檢查目前sendmail方式 sendmail -V sSMTP 2.61 (Not sendmail at all) 測試 echo “This is a test” | mail -s “Test” cowman.chiang@gmail.com Reference … Continue reading

Posted in CentOS | Leave a comment

使用GMail SMTP寄信 – command (CentOS)

近來發現diary log幾乎都收不到了 測試了一下, 發現連手動執行script都失敗 所以想一下就改用GMail SMTP應該比較保險 Reference: 在 Linux 上直接用 Gmail SMTP 寄信 yum install mailx vim ~/.mailrc account gmail { set smtp-use-starttls set smtp=smtp://smtp.gmail.com:587 set smtp-auth=login set smtp-auth-user=username@gmail.com set smtp-auth-password=password set from=”username@gmail.com” set ssl-verify=ignore set nss-config-dir=/root/.pki/nssdb set nss-config-dir=/etc/pki/nssdb } … Continue reading

Posted in CentOS | Leave a comment

CentOS 快速安裝 Nginx with RTMP module

跟 之前裝在Ubuntu的那一篇 一樣 都是沒有設定stat的部分, 需要在另外修改 大致上跟Ubuntu的方式都相同 只是要注意的為 init script 可不可正常進行 測試的範例中是修改 nginx.conf 將 pid 那一行給取消註腳

Posted in CentOS, Nginx, RTMP | Leave a comment

Resize Virtual Disk – VMware ESXi 4.1 & CentOS 5.5 x86

使用vSphere Client登入調整硬體的設定,將硬碟空間增大 (由20G -> 80G) 將VM Guest重開機 以ssh登入VM Guest 輸入fdisk -l取得目前磁碟資訊

根據4回傳的資訊,輸入fdisk /dev/sda

[備註] Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known … Continue reading

Posted in CentOS, VMware | Leave a comment