つぶやき
技術系や雑感等は再編集して本文の記事にする事を前提としているので、こっちにLinkを張らないでください。
メモ
systemctl disable auditd.service systemctl disable kdump.service systemctl disable tuned.service systemctl mask NetworkManager systemctl stop wpa_supplicant systemctl mask NetworkManager-dispatcher
Ubuntu 15.10にZenPhotoを入れる
メモ
静止画像ならこれで問題ないが、動画の場合に問題が出ることがわかった。ので、ZenPhoto自体をあきらめるしかないかもしれない。 もしそれが正しいのならば、WordPressでギャラリーをやるしかないかもしれない
あと、FreeBSDでZenPhotoを実行すると、ファイル名の問題が起こることが判明した。要するに日本語ファイル名のハンドル問題。 したがって、Linux系で頑張るしかないかもしれない。その場合、FreeBSDのNFSも捨てる羽目になるかもしれない…
- UbuntuをVMとしてInstall
- minimumで入れる
- 初期設定だけする
- /etc/network/interfacesを修正
- UID/GIDの変更など
- Rootになれるようにする人は、/etc/group のsudoグループに追加
- apt-get update
- apt-get upgrade
- NFS Client
- apt-get install nfs-common
- sshd
- .ssh/authorized_keys を入れる
- portを変える
- PasswordAuthentication no
- UseDNS no
- PermitRootLogin no
- ufwで必要なportのみ開ける
- ufw allow (ssh port)
- ufw allow (MySQL port)
- ufw allow http
- ufw enable
- 最小限のToolを導入
- apt-get chrony
- Zabbix-Agentd (Zabbix公式Repoから)
- dpkg -i zabbix-release_3.0-1+trusty_all.deb
- apt-get update
- apt-get install zabbix-agent
- NGiNX (NGiNX公式Repoから)
- curl http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
- sudo sh -c “echo 'deb http://nginx.org/packages/mainline/ubuntu/ wily nginx' » /etc/apt/sources.list”
- sudo sh -c “echo 'deb-src http://nginx.org/packages/mainline/ubuntu/ codename nginx' » /etc/apt/sources.list”
- sudo apt-get update
- sudo apt-get install nginx
- MariaDB Client
- ここ を参照
- sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
- sudo add-apt-repository 'deb [arch=amd64,i386] http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.1/ubuntu wily main'
- sudo apt-get update
- sudo apt-get install mariadb-client
- PHP関連
- sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-mysql php5-gd
- あとは普通にZenPhoto関連の設定をするだけ
PHP LDAP Admin
OpenLDAP用のData管理Applicationをいろいろ探しているのだがなかなかいいものがない。
- Yet Another LDAP Administrator PHP。2008年で更新が止まっている
- PHP LDAPAdmin PHP。2012年で更新が止まっている
- PWM Java(J2SE/Tomcat)
- FusionDirectory PHP/Perl
- GOsa2PHP。2012年で更新が止まっている
さすがに、更新が止まっているものを何も考えずに使うのは恐ろしい。 個人的にjavaは面倒見切れないので避けたい
という理由で、LDAP Account ManagerかFusionDirectoryにしようかと考えている。
Unicorn
Redmineを建てる際に、unicornで少しハマったので、記録として。
世に流通しているUnicornの設定において、起動後ProcessのUID/GIDを変える設定で正しく動くものが見つからなかった。
これは、どうやら、Unicornが5.0に上がった際に、Codeが変更されたためらしい。
したがって、Unicorn 5.0以降(試したのは5.0.1)のものを利用する場合には、以下のCodeを参照し、適切に修正すること。
- unicorn.rb
# -*- coding: utf-8 -*- # Unicorn Configuration File for Redmine # http://unicorn.bogomips.org/examples/unicorn.conf.rb $unicorn_user = "redmine" $unicorn_group = "redmine" @dir = "/some/where/redmine" working_directory @dir worker_processes 2 listen "/var/run/unicorn.sock", :backlog => 32 timeout 30 pid "/var/run/unicorn.pid" stdout_path File.expand_path("log/unicorn.stdout.log", @dir) stderr_path File.expand_path("log/unicorn.stderr.log", @dir) preload_app true check_client_connection false GC.respond_to?(:copy_on_write_friendly=) && GC.copy_on_write_friendly = true before_fork do |server, worker| defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! old_pid = "#{server.config[:pid]}.oldbin" if old_pid != server.pid begin sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU Process.kill(sig, File.read(old_pid).to_i) rescue Errno::ENOENT, Errno::ESRCH end end end after_fork do |server, worker| defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection begin worker.user($unicorn_user,$unicorn_group) rescue => ex STDERR.puts "could not change user, oh well" STDERR.puts ex.to_s raise ex end end
とても助かりました。ありがとう → ran
Dokuwiki plugins
Dokuwikiは、最近、Pluginを入れるときに、SSLでの接続を確認する模様。
FeeBSDの場合にやっておくべきこと(CentOSやUbuntuでは試してない)は
- php-opensslを入れる→PHPでSSLを利用できるようにする
- ca_root_nssを入れる→MozillaがInstallするCA証明書を入れる
の2点。
どはまったので、メモ。
あと、ついでに、PluginをDokuwikiからいじるには、php-zlibが要るので忘れないように。
