Installation source
http://mirror01.idc.hinet.net/CentOS/7/os/x86_64/
Linux: August 2019 Archives
curl 要測試自訂的域名及綁定 IP 通常是在 hosts 設定
curl 在 7.21.3 之後, 加了一個 --resolve 參數, 可以在本身綁定而不需修改 hosts
例:
curl --resolve domain.com:80:192.168.1.1 http://domain.com
curl --resolve domain.com:443:192.168.1.1 https://domain.com
它就會直接去連 192.168.1.1 而不會參考域名的解析
PHP 在 5.5.0 之後 curl_setopt 也加入 CURLOPT_RESOLVE 參數
$ch = curl_init("https://domain.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_RESOLVE, array("domain.com:443:192.168.1.1"));
echo curl_exec($ch);
CentOS 6 的 curl 版本是 7.19.7, 不支援, 需升級 libcurl 及 curl
rpm -ivh http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/city-fan.org-release-2-1.rhel6.noarch.rpm
yum-config-manager --enable city-fan.org
yum -y update curl
CentOS 7 的 curl 版本是 7.29.0, 已有支援 --resolve, 但若想裝最新版的 curl, 還是可以裝 city-fan.org repo
rpm -ivh http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/city-fan.org-release-2-1.rhel7.noarch.rpm
yum-config-manager --enable city-fan.org
yum -y update curl
Caddy Web Server 目的是簡化 SSL 憑證的設定, 它可以做到自動化,
甚至可以幫你自動 Renew, 設定也很簡單, 很適合用在小型網站或測試、開發環境
在網站上選擇好 Plugins 後, 會產生一行安裝指令(如下面這行), 執行後會執行檔會在 /usr/local/bin/caddy,
它是 Go 寫的, 這個執行檔不需要其他相依的 Library
curl https://getcaddy.com | bash -s personal hook.service,http.authz,http.cache,http.expires,http.ipfilter,http.locale,http.login
其中 hook.service 是用來建立服務用的 (-service參數)
建立 Caddy config 及 log 目錄
mkdir /etc/caddy /var/log/caddy
Caddy config 範例檔 /etc/caddy/Caddyfile
有兩個域名, 都有 PHP (需跑 php-fpm 服務)
domain1.com 使用自動憑證, 有開 https 及 http, http 有加 rewrite rule
domain2.com 使用現有憑證, 只開 https
建立服務、啟用、啟動
caddy -service install -agree=true -http2 -quic -log /var/log/caddy/caddy.log -conf=/etc/caddy/Caddyfile
systemctl enable caddy
systemctl start caddy
About this Archive
This page is an archive of entries in the Linux category from August 2019.
Linux: July 2019 is the previous archive.
Linux: February 2020 is the next archive.
Find recent content on the main index or look in the archives to find all content.
Linux: Monthly Archives
- Linux: February 2020
- Linux: August 2019
- Linux: July 2019
- Linux: May 2019
- Linux: November 2018
- Linux: July 2018
- Linux: April 2018
- Linux: February 2018
- Linux: December 2017
- Linux: November 2017
- 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 (85)
- Data (161)
- FreeBSD (30)
- Fun (4)
- Game (9)
- Google (40)
- Hosting (19)
- IM (30)
- Life (28)
- Linux (229)
- Misc (64)
- My Program (10)
- Network (83)
- News (255)
- Notes (388)
- Photo (7)
- Programming (34)
- Security (19)
- Shell (29)
- Software (303)
- SQL (29)
- Travel (11)
- Tutorial (14)
- Windows (67)
- [GuestBook] (1)
- An
- Android (36)
- Cloud (19)
- Other OS (2)
- Sports (1)
- VM (6)
- Web (7)
Monthly Archives
- February 2020 (1)
- January 2020 (1)
- December 2019 (3)
- September 2019 (1)
- August 2019 (4)
- July 2019 (1)
- June 2019 (2)
- May 2019 (3)
- April 2019 (1)
- February 2019 (1)
- January 2019 (1)
- December 2018 (2)
- November 2018 (1)
- July 2018 (6)
- May 2018 (1)
- April 2018 (5)
- March 2018 (2)
- February 2018 (5)
- December 2017 (2)
- November 2017 (1)
- 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 (6)
- 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 (10)
- 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