本格運用に向けて、もうちょっとセキュリティとか考えた設定にする。
- fastladderを実行するOSユーザを作る
# adduser Username: fastladder Full name: fastladder Uid (Leave empty for default): Login group [fastladder]: Login group is fastladder. Invite fastladder into other groups? []: Login class [default]: Shell (sh csh tcsh nologin) [sh]: Home directory [/home/fastladder]: /var/www/fastladder Use password-based authentication? [yes]: no Lock out the account after creation? [no]: Username : fastladder Password :
Full Name : fastladder Uid : 3134 Class : Groups : fastladder Home : /var/www/fastladder Shell : /bin/sh Locked : no OK? (yes/no): y adduser: INFO: Successfully added (fastladder) to the user database. Add another user? (yes/no): no Goodbye! - mysqlのユーザを作る(fastladder_productionデータベースは(1)で作った)
# mysql -p mysql> grant all on fastladder_production.* to fastladder@localhost identified by 'パスワード';
- fastladderディレクトリのオーナーをfastladderユーザにする。
# chown -R fastladder:fastladder /var/www/fastladder
- fastladder/config/database.yaml のusernameとpasswordをrootからfastladderのものに変える。
- /usr/local/etc/rc.d/fastladder を以下の内容で作成する。(postgresqlを参考に作った)
#!/bin/sh # PROVIDE: fastladder # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following line to /etc/rc.conf to enable fastladder: # # fastladder_enable="YES" # # optional # fastladder_flags="-b 127.0.0.1 -e production -d" # # This scripts takes one of the following commands: # # start stop prefix=/var/www/fastladder command=${prefix}/script/server . /etc/rc.subr load_rc_config fastladder # set defaults fastladder_enable=${fastladder_enable:-"NO"} fastladder_user=fastladder fastladder_flags=${fastladder_flags:-"-b 127.0.0.1 -e production -d"} name=fastladder rcvar=`set_rcvar` command_args="${fastladder_flags}" start_cmd='su -l ${fastladder_user} -c "exec ${command} ${command_args}"' stop_cmd='kill `cat /var/www/fastladder/tmp/pids/mongrel.pid`' run_rc_command "$1"
/etc/rc.confでfastladder_enable="YES"して、/usr/local/etc/rc.d/fastladder start で起動する。 - plaggerのfastladder.yamlのdatabaseの設定も、fastladderユーザに書き換える。
- plaggerの関連ファイルもfastladderオーナーに変更して、fastladderユーザのcrontabに仕込む。
カテゴリ
FreeBSDトラックバック(0)
このブログ記事を参照しているブログ一覧: fastladderインストール(3)
このブログ記事に対するトラックバックURL: https://www.wizard-limit.net/cgi-bin/mt/mt-tb.cgi/1423
コメントする