トップ  >  FreeBSD10.1  >  FreeBSDサーバー構築マニュアル

FreeBSDサーバー構築マニュアル ⇒ http://freebsd.server-manual.com/


 FreeBSD9 インストール後の初期設定 


  portsツリー更新では、ee /etc/crontabのみの編集で良い。 ←約1時間5分


  FreeBSD Update (セキュリティアップデート機能)では、ee /etc/crontabのみの編集で良い。


  次の、①freebsd-updateのミラーを変更する場合②ユーザー追加③TCP Wrapper設定 の編集は不要なので、SSH設定以降を編集すること。


  SSH設定のee /etc/ssh/sshd_configでは、[AllowUsers user_name]をコメント行にしておく。


一般ユーザーのsu許可では、既に⇒wheel:*:0:root,******* となっている。



 FreeBSD UTF-8化 ← 数時間掛かるが入力すること。



 ログローテーション logrotate インストール /usr/local/etc/logrotate.confのファイルにerrors root無し。



 apache24


    pkg install apache24 ⇒ cd /usr/ports/www/apache24


    make BATCH=yes WITH_SUEXEC=yes SUEXEC_DOCROOT=/home WITHOUT_IPV6=yes install clean ←約15分


    apache24インストール後、# ee /etc/rc.confに、「sshd_enable="YES"」の次に、「apache24_enable="YES"」を追記します。


  これでも起動時に警告が表示されるので、まず、ホスト名を解決できるようにします。


  # ee /etc/hosts  (わかりにくいのですが、今回ホスト名をlocalhostとしています。)


::1                     localhost localhost.my.domain


127.0.0.1             localhost localhost.my.domain localhost


    追記した後、ping [追加したホスト名]で応答があればOK  ping localhost ← 終了はCtrl+c


次に、httpd.confServerNameを変更します。


     # ee /usr/local/etc/apache24/httpd.conf


    ServerAdmin you@example.com   ←you@example.comとなっている箇所を、管理者のメールアドレスに変更


    ServerAdmin postmaster@ localhost


    #ServerName www.example.com:80   www.example.com:80となっている箇所を、[ホスト名]:80に変更


ServerName localhost:80


#<Directory "/usr/local/www/apache24/data"> ←/usr/local/www/apache24/dataを変更


<Directory "/usr/home/*******/public_html">


    これで警告なしで起動してくれるので、これ以外のFreeBSDサーバー構築マニュアル(今回pkgtools.conf編集は実施)で書き換えは必要ない。



    # /usr/local/etc/rc.d/apache24 start


Performing sanity check on apache24 configuration:


Syntax OK


Starting apache24


    ブラウザ(http://192.168.11.2/)で表示してみると、It works!が表示されました。



It works!が表示されない場合】/usr/local/etc/rc.d/apache22: WARNING: failed to start apache22


 原因:ホスト名/サーバ名の設定不 参考【http://www.kishiro.com/FreeBSD/apache13_mod_ssl.html


 ① ee /etc/rc.conf ⇒ hostname="FreeBSD"


 ② ee /etc/hosts ⇒ 127.0.0.1               localhost.kishiro.com localhost FreeBSD


 ③ ee /usr/local/etc/apache24/httpd.conf ⇒ ServerName FreeBSD



/usr/local/etc/rc.d/apache24 startでのエラー対処法(自己流)】エラー行をコメント行に変更


ee /usr/local/etc/apache22/extra/httpd-languages.conf ⇒ 例:81及び88


 ②ee /usr/local/etc/apache22/extra/httpd-userdir.conf ⇒ 例:10及び12



 mysql56


  ■pkgtools.conf編集後、


cd /usr/ports/databases/mysql56-server


    make BATCH=yes WITH_CHARSET=utf8 install clean ←約55分


   rehash


  cd php56-extensions  ⇒  cd /usr/ports/lang/php56-extensions


    make configmbstringsにチェック


make BATCH=yes WITH_GD=yes WITH_MBSTRING=yes WITH_MYSQL=yes install clean ←約25分


  この後、サーバー構築マニュアルに従い、DBIインストール(約2分)とDBDインストール(約2分)を実行する。


  my.cnf編集では、cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnfmedium箇所を[default]で実行のこと。


  cp /usr/local/share/mysql/my- default.cnf /etc/my.cnf


以降、FreeBSDサーバー構築マニュアルのままの入力で良い。

ERROR 1045 (28000)】↓エラー表示例


ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


このエラーはパスワードが設定されているユーザーを使用して MySQL サーバに接続する際に、パスワードを送信しなかった場合にこのエラーが表示されます。


 ⇒対応策:パスワードを送信するオプション「-p」をつけると MySQL サーバに接続できるようになります。


 mysql -u root -p


 Enter password:


 php56


 ①ee /usr/local/etc/pkgtools.conf ← pkgtools.confに2行追加


  MAKE_ARGS = {


    'lang/php56' => 'WITH_APACHE=yes', ←追加


    'lang/php56-extensions' => 'WITH_GD=yes WITH_MBSTRING=yes WITH_MYSQL=yes', ←追加


  }


pkg install mod_php56 php56-mysql php56-mysqli ← php5インストール


  ee /usr/local/etc/apache24/httpd.conf ← httpd.confを編集して、次の3行のコメント解除


    LoadModule include_module libexec/apache24/mod_include.so


    LoadModule negotiation_module libexec/apache24/mod_negotiation.so


    LoadModule userdir_module libexec/apache24/mod_userdir.so


 php5-extensionsインストールした後、FreeBSDサーバー構築マニュアルに従い残りの入力作業を行う。


 ⑤作成したinfo.phpファイルをpublic_htmlフォルダ内に複写


 ⑥ブラウザで確認 (http://192.168.11.2/info.php にアクセス)



その他は以前のバージョンと同じ。


 

前
アプリケーションインストール前の作業
カテゴリートップ
FreeBSD10.1
次
XOOPSが使えない?

Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/bulletin/class/bulletin.php line 208
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/bulletin/class/bulletin.php line 494
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/main/index.php line 22
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/main/index.php line 26
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/main/index.php line 30
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/main/index.php line 34
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/main/index.php line 38
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/main/index.php line 42
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/include/common_functions.php line 30
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/include/common_functions.php line 31
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelCategory.class.php line 34
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelCategory.class.php line 54
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelCategory.class.php line 64
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelCategory.class.php line 244
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelCategory.class.php line 250
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelContent.class.php line 32
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelContent.class.php line 59
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelContent.class.php line 148
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelContent.class.php line 362
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoModelContent.class.php line 375
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/include/common_prepend.inc.php line 23
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/include/common_prepend.inc.php line 34
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoControllerGetContent.class.php line 26
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoControllerGetContent.class.php line 54
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoControllerGetContent.class.php line 79
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file xoops_trust_path/modules/pico/class/PicoControllerAbstract.class.php line 49
Unknown Condition [8192]: Assigning the return value of new by reference is deprecated in file class/smarty/plugins/function.d3comment.php line 42