| xmllint --format - # need libxml2 package
| xmlstarlet fo # need xmlstarlet
Make it more readable.
Linux: May 2016 Archives
| python -m json.tool # need python package
| jq . # need jq package
Make it more readable.
nginx (發音 engine) 近幾年因為性能卓越, 市佔已愈來愈高, 僅次於 Apache, IIS, 排第三
官方有提供 Prebuilt Packages, 安裝很方便
Create /etc/yum.repos.d/nginx.repo
yum -y install nginx
PHP 在 configure 需加 --enable-fpm 參數
設定檔用預設的即可 cp sapi/fpm/php-fpm.conf /usr/local/etc/php-fpm.conf
執行 php-fpm 會 Listen 9000 Port
nginx 設定檔 /etc/nginx/conf.d/default.conf
這是 HTTP + HTTPS + PHP 的典型設定, DocumentRoot 在 /var/www/html
若 SSL 憑證是用 Let's Encrypt, ssl_certificate 這個參數要把這兩個檔合併 cert.pem, chain.pem
cat cert.pem chain.pem > cert_chain.pem
若只有 cert.pem 的內容, 試過一般瀏覽器可以正常, 但是 curl, wget, links, lynx, w3m 等 CLI 工具都會出現錯誤
curl: (60) Peer certificate cannot be authenticated with known CA certificates
wget: ERROR: The certificate of 'yourhost.com' is not trusted.
links: SSL error
lynx: SSL error:unable to get local issuer certificate
w3m: unable to get local issuer certificate
ERROR: The certificate of 'yourhost.com' hasn't got a known issuer.
ref. Install NGINX
openssl s_client 可用來查看 HTTPS Server 的憑證
openssl s_client -connect helloworld.letsencrypt.org:443
or
openssl s_client -host helloworld.letsencrypt.org -port 443
ssh user@host bash -s -- < local-script.sh
You can add arguments if you need.
ssh user@host bash -s -- < local-script.sh argv1
一般是建 Key 來達成 ssh 免密碼, 若不想建 Key, 可以用 sshpass
sshpass 可以在 ssh 時自動將密碼帶入
密碼可以用檔案(-f filename)或參數(-p password)或變數SSHPASS(-e)帶入
e.g.
sshpass -f pass_file ssh user@somewhere.com
sshpass -p password ssh user@somewhere.com
export SSHPASS=password
sshpass -e user@somewhere.com
當然也可以直接執行所連線主機的 command
sshpass -e user@somewhere.com cat /etc/hosts
Recent Entries
About this Archive
This page is an archive of entries in the Linux category from May 2016.
Linux: January 2016 is the previous archive.
Linux: June 2016 is the next archive.
Find recent content on the main index or look in the archives to find all content.
Linux: Monthly Archives
- Linux: September 2017
- Linux: December 2016
- Linux: June 2016
- Linux: May 2016
- Linux: January 2016
- Linux: October 2015
- Linux: September 2015
- Linux: August 2015
- Linux: July 2015
- Linux: May 2015
- Linux: April 2015
- Linux: March 2015
- Linux: January 2015
- Linux: October 2014
- Linux: September 2014
- Linux: August 2014
- Linux: July 2014
- Linux: May 2014
- Linux: April 2014
- Linux: January 2014
- Linux: October 2013
- Linux: September 2013
- Linux: July 2013
- Linux: June 2013
- Linux: May 2013
- Linux: November 2012
- Linux: September 2012
- Linux: August 2012
- Linux: July 2012
- Linux: June 2012
- Linux: March 2012
- Linux: February 2012
- Linux: January 2012
- Linux: December 2011
- Linux: September 2011
- Linux: August 2011
- Linux: July 2011
- Linux: June 2011
- Linux: May 2011
- Linux: April 2011
- Linux: March 2011
- Linux: February 2011
- Linux: December 2010
- Linux: November 2010
- Linux: October 2010
- Linux: September 2010
- Linux: August 2010
- Linux: July 2010
- Linux: June 2010
- Linux: May 2010
- Linux: April 2010
- Linux: March 2010
- Linux: February 2010
- Linux: January 2010
- Linux: December 2009
- Linux: November 2009
- Linux: October 2009
- Linux: September 2009
- Linux: August 2009
- Linux: July 2009
- Linux: June 2009
- Linux: April 2009
- Linux: March 2009
- Linux: December 2008
- Linux: October 2008
- Linux: September 2008
- Linux: July 2008
- Linux: June 2008
- Linux: April 2008
- Linux: March 2008
- Linux: February 2008
- Linux: January 2008
- Linux: October 2007
- Linux: September 2007
- Linux: August 2007
- Linux: May 2007
- Linux: October 2006
- Linux: August 2006
- Linux: May 2006
- Linux: March 2006
- Linux: January 2006
- Linux: November 2005
- Linux: October 2005
- Linux: May 2005
- Linux: February 2005
- Linux: January 2005
- Linux: December 2004
- Linux: November 2004
- Linux: October 2004
- Linux: September 2004
- Linux: August 2004
- Linux: July 2004
- Linux: June 2004
- Linux: April 2004
- Linux: March 2004
- Linux: February 2004
- Linux: January 2004
- Linux: December 2003
- Linux: November 2003
- Linux: October 2003
- Linux: August 2003
- Linux: July 2003
Categories
- 3C (34)
- Bookmark (87)
- Data (161)
- FreeBSD (30)
- Fun (4)
- Game (9)
- Google (40)
- Hosting (19)
- IM (27)
- Life (28)
- Linux (212)
- Misc (64)
- My Program (10)
- Network (78)
- News (256)
- Notes (388)
- Photo (7)
- Programming (32)
- Security (15)
- Shell (28)
- Software (300)
- SQL (26)
- Travel (11)
- Tutorial (13)
- Windows (60)
- [GuestBook] (1)
- An
- Android (34)
- Cloud (19)
- Other OS (1)
- Sports (1)
- VM (6)
- Web (7)
Monthly Archives
- October 2017 (3)
- September 2017 (6)
- May 2017 (1)
- February 2017 (3)
- January 2017 (1)
- December 2016 (2)
- October 2016 (2)
- September 2016 (2)
- June 2016 (5)
- May 2016 (15)
- April 2016 (5)
- February 2016 (2)
- January 2016 (9)
- December 2015 (1)
- November 2015 (2)
- October 2015 (3)
- September 2015 (7)
- August 2015 (3)
- July 2015 (7)
- June 2015 (1)
- May 2015 (3)
- April 2015 (3)
- March 2015 (3)
- February 2015 (1)
- January 2015 (1)
- December 2014 (3)
- October 2014 (11)
- September 2014 (7)
- August 2014 (5)
- July 2014 (6)
- June 2014 (2)
- May 2014 (9)
- April 2014 (6)
- March 2014 (1)
- February 2014 (1)
- January 2014 (5)
- November 2013 (4)
- October 2013 (2)
- September 2013 (2)
- August 2013 (4)
- July 2013 (4)
- June 2013 (6)
- May 2013 (6)
- April 2013 (7)
- March 2013 (5)
- February 2013 (2)
- January 2013 (7)
- December 2012 (5)
- November 2012 (10)
- October 2012 (1)
- September 2012 (7)
- August 2012 (6)
- July 2012 (6)
- June 2012 (7)
- May 2012 (6)
- April 2012 (7)
- March 2012 (5)
- February 2012 (10)
- January 2012 (14)
- December 2011 (9)
- November 2011 (8)
- October 2011 (4)
- September 2011 (11)
- August 2011 (25)
- July 2011 (19)
- June 2011 (13)
- May 2011 (12)
- April 2011 (18)
- March 2011 (14)
- February 2011 (7)
- January 2011 (7)
- December 2010 (6)
- November 2010 (16)
- October 2010 (17)
- September 2010 (11)
- August 2010 (6)
- July 2010 (10)
- June 2010 (10)
- May 2010 (14)
- April 2010 (14)
- March 2010 (16)
- February 2010 (4)
- January 2010 (13)
- December 2009 (10)
- November 2009 (18)
- October 2009 (11)
- September 2009 (14)
- August 2009 (10)
- July 2009 (6)
- June 2009 (5)
- May 2009 (3)
- April 2009 (12)
- March 2009 (18)
- February 2009 (7)
- January 2009 (14)
- December 2008 (15)
- November 2008 (12)
- October 2008 (9)
- September 2008 (10)
- August 2008 (13)
- July 2008 (28)
- June 2008 (17)
- May 2008 (13)
- April 2008 (15)
- March 2008 (7)
- February 2008 (5)
- January 2008 (2)
- November 2007 (4)
- October 2007 (8)
- September 2007 (7)
- August 2007 (3)
- July 2007 (10)
- June 2007 (4)
- May 2007 (5)
- April 2007 (9)
- March 2007 (11)
- February 2007 (7)
- January 2007 (4)
- December 2006 (9)
- November 2006 (14)
- October 2006 (10)
- September 2006 (9)
- August 2006 (6)
- July 2006 (15)
- June 2006 (22)
- May 2006 (17)
- April 2006 (13)
- March 2006 (18)
- February 2006 (10)
- January 2006 (28)
- December 2005 (17)
- November 2005 (15)
- October 2005 (18)
- September 2005 (24)
- August 2005 (39)
- July 2005 (14)
- June 2005 (22)
- May 2005 (32)
- April 2005 (27)
- March 2005 (32)
- February 2005 (20)
- January 2005 (38)
- December 2004 (49)
- November 2004 (38)
- October 2004 (24)
- September 2004 (23)
- August 2004 (38)
- July 2004 (39)
- June 2004 (38)
- May 2004 (17)
- April 2004 (32)
- March 2004 (15)
- February 2004 (6)
- January 2004 (19)
- December 2003 (19)
- November 2003 (15)
- October 2003 (15)
- September 2003 (12)
- August 2003 (20)
- July 2003 (26)
Recent Comments