« iTune Music Serverを作ろう (4) | Main | iTune Music Serverを作ろう (6) »

March 28, 2006

iTune Music Serverを作ろう (5)

さて,諸君具合はどうだろうか?こころぐサーバーが落ちていたのでメモ帳にメモリながら作業をしていた.
さて...
次は,ports以外のセキュリティアップデートも含めたBSDのアップデートだ.
そういえば,言い忘れたがportsのアップデートについてはここを参照してくれたまえ.
それから,以下のfreeBSD updateでは,果たしてすべてのセキュリティアップデートが適用されるのか私は知らない.心配性な人はここを参照にしこしこ取り組んでくれたまえ.私も時々やっている.

- FreeBSD updateのインストール

$ cd /usr/ports/security/freebsd-update
$ sudo make install clean

- FreeBSD updateの実行

$ sudo cp /usr/local/etc/freebsd-update.conf.sample /usr/local/etc/freebsd-update.conf
$ sudo freebsd-update fetch
$ sudo freebsd-update install

/boot/kernelとかが更新されているようだったら再起動しよう.

$ sudo shutdown -r now

さて,ようやく,メインのサーバープログラムのインストールだ.まずは,諸君のPCからUnixマシンにファイルを転送するシステムとしてWebDAVサーバーを構築する.これは結構面倒いけど,ftpしたりするより楽ちんなのでぜひともやっていただきたい.これからはWebDAVだ.
なお,WebDAVの構築についてはFreeBSD Expert 2005の“Apache2+WebDAV+Subversion+LDAPでExpertなシステム構築”(宮本久仁男氏)を参考にして行っている.あと,Windowsとの連携などでWebDAVの本“WebDAVシステム構築ガイド――Apache/IIS/Subversion/Jakarta Slide”もいいかもしれない.wakatonoさんは自分でページをおつくりにもなっているぞ.いずれにしろSubversionやLDAPはただおくだけなら必要ないが,今後WebDAVにどっぷりはまっちゃったときのために入れておくのはいいのではないのではないだろうか.
では,WebDAVサーバーの構築だ.

- autoconf 2.59のインストール

$ cd /usr/ports/devel/autoconf259
$ sudo make install clean

- BerkeleyDB 4.2のインストール
db 4.3,db 4.4とportにはあるが,結局は4.2を使うようなので素直に4.2をインストールしておく.

$ cd /usr/ports/databases/db42
$ sudo make install clean

- expat2のインストール

$ cd /usr/ports/textproc/expat2
$ sudo make install clean

で,

===> expat-2.0.0_1 is already installed
You may wish to ``make deinstall'' and install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old port of textproc/expat2
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/textproc/expat2.

と出てとまる.そこで,

$ sudo make deinstall
$ sudo make reinstall

とすればOKだ.

- Apache22のインストールwith LDAP

Apacheは最新の2.2を使ってみよう.

$ cd /usr/ports/www/apache22
$ sudo make WITH_BERKELEYDB=db42 -DWITH_LDAP
$ sudo make install clean

- Apacheの設定

設定ファイルhttpd.confをviで編集しよう

$ sudo vi /usr/local/etc/apache22/httpd.conf

LoadModuleの前にあるコメントアウトをみんなはずそう.なんでも実装するのだ.特に,dav_moduleとdav_fs_moduleはコメントアウトされているとだめだめだ.
後は,

#ServerName www.example.com:80

とあるのを,コメントをはずし,IPアドレスを入れて,あるいは,

ServerName localhost:80

とかにしよう.

それから/etc/rc.confの設定だ.
次の一行を最後に加えよう.

apache22_enable="YES"

これで,設定はOKだ.再起動して,メインのWindowsマシンか何かで,http://<IPアドレス>/とやってみよう.
最近のApacheのスタート画面は無愛想だ, "It works" としかでない.英語のわからない自分としてはやたら不安になるページである.でもこれでいいのだ.

- Subversionのインストール

さて,なんの役に立つか知らないが,将来に備えてSubversionをインストールしよう.上記の本のとおり,

$ cd /usr/ports/devel/subversion
$ sudo make -DWITH_MOD_DAV_SVN
$ sudo make install clean

次はDAVの設定だ.

- dav.confを作る.
/usr/local/etc/apache22/Includesにdav.confを作る.

$ cd /usr/local/etc/apache22/Includes
$ sudo vi dav.conf

内容は以下のとおり

Alias /dav /home/dav
DAVLockDB /tmp/DAVLock

<Location /dav>
DAV on
Order deny,allow
Allow from All
</Location>

-davディレクトリ作成

/home/davをオーナーwww,グループwwwで作る.

$ cd /home
$ sudo mkdir dav
$ sudo chown www:www dav

これでDAVサーバーは完成だ.Apacheを再起動すればいいのだが,めんどくさいのでsudo shutdown -r now.
WindowsからWebフォルダーとしてアクセスしてみよう.
なお,重ねて申し上げるが,ここではファイアーウォール内のLANにサーバーを建てることを前提としている.ファイアーウォールがないと外から人が書き込んだり消去したりできてしまう.最悪なのはCDのファイルを置いて著作権の侵害になることだ.世の中はいろいろとめんどくさくなった注意しよう.
なお,UnixのBasic承認をしたDAVフォルダーにWebフォルダーとしてアクセスするにはコツがいるようだ,IEの詳細オプションで“統合Windows承認を使用する”のチェックをはずし,URLのおしりに "?" をつけるとうまくいくようだ.
さて,上野あたりまで来た.

<つづく>

|

« iTune Music Serverを作ろう (4) | Main | iTune Music Serverを作ろう (6) »

FreeBSD」カテゴリの記事

Comments

Hello, its fastidious paragraph regarding media print, we all be familiar with media is a great source of data.

Posted by: 1997 ford explorer check engine light | June 29, 2014 at 05:00 AM

Good day! I know this is somewhat off topic but I was wondering if you knew where I could find a captcha plugin for my comment form? I'm using the same blog platform as yours and I'm having trouble finding one? Thanks a lot!

Posted by: from quest protein bars this | August 27, 2014 at 06:09 PM

Hey there! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no data backup. Do you have any methods to stop hackers?

Posted by: Quest Bars | August 28, 2014 at 01:23 AM

Greetings, I believe your site could be having internet browser compatibility issues. When I take a look at your site in Safari, it looks fine however when opening in IE, it's got some overlapping issues. I merely wanted to give you a quick heads up! Apart from that, fantastic site!

Posted by: Quest Bars | August 28, 2014 at 11:50 AM

Howdy! Do you know if they make any plugins to help with SEO? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains. If you know of any please share. Many thanks!

Posted by: quest nutrition quest protein bars this | September 17, 2014 at 02:20 AM

Incredible! This blog looks exactly like my old one! It's on a totally different subject but it has pretty much the same page layout and design. Superb choice of colors! Quest Bars blogesaurus

Posted by: quest bars lawsuit | October 08, 2014 at 07:44 AM

Thanks a bunch for sharing this with all of us you really know what you are speaking about! Bookmarked. Kindly also seek advice from my web site =). We will have a link change contract between us

Posted by: Where To Buy Individual Quest Bars | October 09, 2014 at 05:38 AM

I have read so many posts concerning the blogger lovers but this piece of writing is in fact a fastidious article, keep it up. Quest Bars blogesaurus

Posted by: quest bars lawsuit | October 11, 2014 at 08:04 AM

Excellent blog post. I definitely appreciate this website. Thanks!

Posted by: Diet Plans for Women to Lose Weight | October 11, 2014 at 10:12 AM

Pretty section of content. I just stumbled upon your blog and in accession capital to say that I get actually loved account your blog posts. Any way I will be subscribing for your augment or even I fulfillment you get right of entry to consistently fast. Quest Bars blogesaurus

Posted by: quest protein bars | October 12, 2014 at 10:34 AM

FIFA 15 is the 22 edition of the known series of football simulators by EA Sports.

Posted by: FIFA 15 coin generator | October 13, 2014 at 12:17 AM

Hello it's me, I am also visiting this site daily, this site is truly pleasant and the people are actually sharing pleasant thoughts.

Posted by: Diet Plans to Lose Weight | October 19, 2014 at 01:03 AM

magnificent issues altogether, you simply won a new reader. What might you recommend in regards to your put up that you just made a few days in the past? Any certain?

Posted by: Diet Plans For Women | October 19, 2014 at 08:35 PM

Cool blog! Is yօur theme custom mаde or did үоu download it frօm someաhere? A theme liқe yoսrs ԝith a fеw simple adjustements ԝould reallү make mу blog jump out. Pleasе lеt me ҡnow wherе yοu got үour theme. Ϻаny thanks

Posted by: fs15 mods | December 16, 2014 at 03:21 AM

When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get four e-mails with the same comment. Is there any way you can remove me from that service? Thank you!

Posted by: Delhi Escort | December 20, 2014 at 02:40 PM

Wonderful goods from you, man. I've understand your stuff previous to and you're just extremely excellent. I actually like what you have acquired here, certainly like what you're saying and the way in which you say it. You make it entertaining and you still take care of to keep it wise. I can't wait to read far more from you. This is really a wonderful website.

Posted by: life fitness recumbent bike 9500hr | March 17, 2015 at 04:20 PM

Post a comment



(Not displayed with comment.)




TrackBack

TrackBack URL for this entry:
http://app.cocolog-nifty.com/t/trackback/37290/9296502

Listed below are links to weblogs that reference iTune Music Serverを作ろう (5):

« iTune Music Serverを作ろう (4) | Main | iTune Music Serverを作ろう (6) »