目次
つぶやき
技術系や雑感等は再編集して本文の記事にする事を前提としているので、こっちにLinkを張らないでください。
Let's Encryptを少し調べてみた
FreeBSDでacme-clientを利用してLet's Encryptの証明書取得を行うことを考えた。ので、ちょっと調べたメモ
FreeBSD 11.0 Release
FreeBSD 11.0 Releaseが出ている。 元々は、8月くらいにShipされるはずだったのだが、OpenSSLを始めとする様々な脆弱性が公開されたことから、その対応を待って公開することになったものだ。 そのせいもあって、Release時点で11.0-RELEASEではなく11.0-RELEASE-p1として公開された。
# 実際には、11.0 は少し前に公開されたのだが、脆弱性問題があるので使うな!ということになっていた。
さて、というわけで、手元のFreeBSD 10.3で動いているServerを11.0にupgradeしようとしたメモを。
FreeBSDはOSのUpgradeが原則としてとても簡単なOSである。
- freebsd-update -r 11.0 upgrade
- freebsd-update install
- reboot
- freebsd-update install
- (場合によってpkg-static upgrade -f pkgを先に実行)
- pkg update
- pkg upgrade
- portsnap fetch
- portsnap update
- (場合によってfreebsd-update installを実行)
- reboot
のような手順でいいのだが、今回は少しハマったので愚痴を兼ねて。
まだ、SLB系とDNS系しかupgradeしていないのでこのくらいだが、もしかしたらもっと出るかもしれない…出たら追記する。
FreeBSDでOBSを使う
OS-XやWindowsでStreaming配信を行う際にしばしば利用される配信ソフトウェアにOBS-studioがある。 このソフトウェアはFree and Open Sourceとして公開されているが、これが大変によくできたSoftwareで、こんなのFreeでいいの?と思うような出来である。
このOBS、長らくWindows/MacOS-Xでしか動かないのだろうと思っていたら、よく見るとLinuxの文字列があった。もしかしてと思ってportsを調べてみたら…「すごいや、OBSはFreeBSDにもあったんだ」と。
ということで、FreeBSDでOBSを動かしてみようと。
FreeBSDにNGiNXをSourceからInstall
Sourceからといっても、全部頑張るのは管理上も面倒なので、最小限だけpkgで導入する
- FreeBSDをInstall
- pkg update; pkg upgradeを実行
- pkg install wget git openssl pcre
- NGiNXを持ってくる。NGiNXの公式のDownload pageからNGiNXを拾う
wget https://nginx.org/download/nginx-x.xx.x.tar.gz(このURLはWeb Pageから正しいものを得てください)- 署名の検証は各自でおこなうこと
- NGiNX RTMPモジュールを取得する
- Gitで公開されているので、https://github.com/arut/nginx-rtmp-moduleを参照して必要なURLを得ること
- 展開する
- tar xzf nginx-x.xx.x.tar.gz
- コンパイルする
- configureの引数にRTMPモジュールの設定を入れるのを忘れないように
- configure –prefix=/usr/local –add-module=../nginx-rtmp-module
- make install
- あとは、NGiNXの設定をするだけ
squid on freebsd memo
ちょっとした理由で、ProxyServerを作る羽目になったので、メモ
- pkg install squid
- check /var/squid/cache , /var/log/squid
- vi /boot/loader.conf
kern.ipc.msgmnb=8192 kern.ipc.msgssz=64 kern.ipc.msgtql=2048
- echo 'squid_enable=yes' » /etc/rc.conf.local
- SQUID COnfiguration
- AquidのConfigurationは、上からParseされるので、注意(末尾に書けばいいというものではない)
- 今回はFreeBSDのInstall時のsquid.confの先頭に以下を追加するだけで良い
*** squid.conf.sample Thu Aug 20 19:18:40 2015 --- squid.conf Wed Aug 26 14:03:38 2015 *************** *** 2,7 **** --- 2,15 ---- # Recommended minimum configuration: # + visible_hostname squid1 + + # Auth Param + auth_param basic program /usr/local/libexec/squid/basic_pam_auth + auth_param basic children 2 startup=2 idle=1 + auth_param basic realm Squid proxy-caching web server + auth_param basic credentialsttl 2 hours + # Example rule allowing access from your local networks. # Adapt to list your (internal) IP networks from where browsing # should be allowed *************** *** 24,29 **** --- 32,39 ---- acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT + acl pamauth proxy_auth REQUIRED + # # Recommended minimum Access Permission configuration: # *************** *** 52,64 **** http_access allow localnet http_access allow localhost # And finally deny all other access to this proxy http_access deny all # Squid normally listens to port 3128 ! http_port 3128 ! # Uncomment and adjust the following to add a disk cache directory. #cache_dir ufs /var/squid/cache 100 16 256 # Leave coredumps in the first cache dir --- 62,85 ---- http_access allow localnet http_access allow localhost + http_access allow pamauth + # And finally deny all other access to this proxy http_access deny all # Squid normally listens to port 3128 ! #http_port 3128 ! http_port pppp ! icp_port 0 ! ! # NEIGHBOR SELECTION ! # TEST ! cache_peer aaa.aaa.aaa.aaa parent pppp 0 no-query ! acl TEST dst nnn.nnn.nnn.nnn/mm ! cache_peer_access aaa.aaa.aaa.aaa allow TEST ! never_direct allow TEST ! # Uncommen an adjust the following to add a disk cache directory. #cache_dir ufs /var/squid/cache 100 16 256 # Leave coredumps in the first cache dir
- /etc/pam.d/squid
auth required pam_unix.so no_warn try_first_pass account required pam_unix.so
詳しいことは別の記事でまとめる
