#author("2020-01-16T10:24:02+09:00","default:kuji","kuji")
#author("2020-01-16T13:27:16+09:00","default:kuji","kuji")
CONTENTS
#contents
----
Lastmodified &lastmod;
----
* FreeBSD setup [#z03a9999]

スクラッチインストール後、sshでリモート接続出来る所までセットアップできたら、リブート待ち時間の短縮を。[[起動メニュー待ち時間]]

 echo autoboot_delay=\"3\" >> /boot/loader.conf

*[[ports collection の更新]] [#e2f13ee8]

 portsnap fetch && portsnap extract

*[[portupgrade のインストール]] [#z3c67216]

 cd /usr/ports/ports-mgmt/portupgrade && make BATCH=yes install clean

perl ruby のデフォルトバージョンも同時にインストールされます。

*[[locate database 作成]] [#b812a7e0]

 /etc/periodic/weekly/310.locate

*screen [#e9c890f9]

 portinstall screen --batch

 echo termcap xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' >> /root/.screenrc

*[[コンソール上のログを採取]] [#x22af9c9]

*rsync [#l5d61a05]

 portinstall rsync --batch

* making BAMP [#cdecfa65]
**apache24 [#y3de4ee1]
 portinstall apache24 ⇒ make configMPM_EVENTにする
 portinstall mod_php72 ⇒ make config ZTSをチェック 
 echo apache24_enable=\"YES\" >> /etc/rc.conf

 /usr/local/etc/apache24 ⇒ /usr/local/etc/apache24_install
と改名して、バックアップの/usr/local/etc/apache24 を書き込む。

**php [#f44eadcf]

php72 php72-extensions record 以外のフルオプションでインストール

/usr/local/etc/php.ini をバックアップからコピーしてくる。

[[FreeBSD PHP-FPM]]


***apache24 log_rotate [#b51ae43a]


**portinstall security/py-certbot [#me13c42e]
py-certbotをインストールした直後の時点では /usr/lodal/etc/letsenclipt フォルダは生成されていない。

バックアップの該当ファイル.tar.gz を取ってきて解凍した。

**postfix [#hc81962e]

 portinstall postfix ⇒ python 37が依存関係からインストールされます



 echo postfix_enable=\"YES\" >> /etc/rc.conf
 echo sendmail_enable=\"NO\" >> /etc/rc.conf
 echo sendmail_submit_enable=\"NO\" >> /etc/rc.conf
 echo sendmail_outbound_enable=\"NO\" >> /etc/rc.conf
 echo sendmail_msp_queue_enable=\"NO\" >> /etc/rc.conf

バックアップの/usr/local/etc/postfix でバックアップ先を上書きする。

root のエイリアス設定をする。




** clamav [#y08c61b0]

 portinstall clamav

** amavisd [#v5823f3d]

 root@blackcube2:~ # /usr/local/etc/rc.d/amavisd reload
  The value of variable $myhostname is "blackcube2", but should have been
  a fully qualified domain name; perhaps uname(3) did not provide such.
  You must explicitly assign a FQDN of this host to variable $myhostname
  in amavisd.conf, or fix what uname(3) provides as a host's network name!
 root@blackcube2:~ #
 root@blackcube2:~ # /usr/local/etc/rc.d/amavisd reload
 The amavisd daemon is apparently not running, no PID file /var/amavis/amavisd.pid
 root@blackcube2:~ # /usr/local/etc/rc.d/amavisd start
 Starting amavisd.
 root@blackcube2:~ #


 
**MySQL [#u0eb4dbf]
 portinstall mysql57-server mysql57-client --batch  バックアップ元と同一バージョンにする
 echo mysql_enable=yes >> /etc/rc.conf

/var/db/mysql フォルダは、インストール直後に空の状態で作られる。
これをバックアップのフォルダで上書き。

さらに、/usr/local/etc/mysql/my.cnf もバックアップと同じにする。

これで、バックアップと同じ環境が再現・継承される。


** www [#a7fa82b2]

OpenPNE3.9を復旧させるので、バックアップの/usr/local/www/OpenPNE3 を含む www フォルダをcvfzp www.tar.gz /usr/local/www/ などとして、復旧先の/usr/local/に置き、xvfzp /usr/local/www/ する。

 # apachectl restart

する。

OpenPNE3がエラーするので、portinstall php72-pecl-mcrypt とかもしてエラー消失したような気がする。[[Nextcloud PHP]]

** phpmyadmin [#j57b7760]

 root@blackcube2:/usr/ports/databases/phpmyadmin # make DISABLE_VULNERABILITIES=yes install clean

** munin [#b58e7ebc]

 # portinstall munin-node
 # portinstall munin-master

 [FATAL] There is nothing to do here, since there are no nodes with any plugins.
 Please refer to http://munin-monitoring.org/wiki/FAQ_no_graphs at /usr/local/share/munin/munin-html line 40.

  munin-node-configure --shell | sh  [[Munin on NEC-Express5800/GT110b FreeBSD 8.1]]




 # The following plugins caused errors:
 # mysql_:
 #       Wrong amount of autoconf: expected 1 line, got 5 lines:
 #       [start]no (install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module)
 (@INC contains: /usr/local/libb/perl5/site_perl/mach/5.30 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.30/mach /usr/local/lib/perl5/5.30) at (eval 15) line 3.
 [newline]Perhaps the DBD::mysql perl module hasn't been fully installed,[newline]or perhaps the capitalisation of 'mysql' isn't right.[newline]Available drivers:
 DBM, ExampleP, File, Gofer, Mem, Pg, Proxy, Sponge.[newline])[end]

と言うエラーを貰うので、

 portinstall databases/p5-DBD-mysql

/boot/loader.conf  以下を書き加えてCPU_Tempなどをモニター [[Munin on NEC-Express5800/S70 タイプPJ FreeBSD 11.2R]]

 autoboot_delay="3"
 ipmi_load="YES"
 coretemp_load="YES"
 if_em_load="YES"
 accf_data_load="YES"
 accf_http_load="YES"

で、リンクを追加する。
 ~ # munin-node-configure --shell

*Apacheのモニター [#h2640935]
[[Munin de Apache]]

*smartd [#ldcf8671]
[[HDD管理 sysutils/smartmontools]]

 portinstall sysutils/smartmontools
 echo 'smartd_enable="YES"' >> /etc/rc.conf
----
mysqlが起動できたら、rootユーザのパスワードを設定します。インストール直後のrootパスワードは、/root/.mysql_secret にある.

 # mysql -u root -p
 Enter password: 
  
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 4
 Server version: 5.7.28-log
 
 Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
 
 Oracle is a registered trademark of Oracle Corporation and/or its
 affiliates. Other names may be trademarks of their respective
 owners.
 
 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
 root@localhost [(none)]>  SET PASSWORD FOR root@localhost=password('XXXXXXXXXX');
 Query OK, 0 rows affected, 1 warning (0.00 sec)

 root@localhost [(none)]>

[[mysql57]]

http://www.aiship.jp/knowhow/archives/28257

 portinstall databases/phpmyadmin --batch

 portinstall security/py-certbot

 portinstall munin-node munin-master --batch
 
*WWW2 [#w07d18b5]
 hostname="blackcube2.smb.net"
 keymap=jp
 sshd_enable="YES"
 moused_enable="YES"
 ntpd_enable="YES"
 # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
 dumpdev="AUTO"
 # Add After Install
 ntpdate_enable="YES"
 # Postfix
 postfix_enable="YES"
 sendmail_enable="NO"
 sendmail_submit_enable="NO"
 sendmail_outbound_enable="NO"
 sendmail_msp_queue_enable="NO"
 # Apache
 apache24_enable="YES"
 apache24_http_accept_enable="YES"
 mysql_enable="YES"
 munin_node_enable="YES"
 #clamd
 clamav_clamd_enable="YES"
 clamav_freshclam_enable="YES"
 amavisd_enable="YES"
 amavisd_pidfile="/var/amavis/amavisd.pid"
 smartd_enable="YES"
 scponlyc_enable="YES"
 named_enable="YES"
 php_fpm_enable="YES"
 monit_enable="YES"


----
Total access &counter(total);:本日 &counter(today);:昨日 &counter(yesterday);
#counter([total|today|yesterday]);

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS