玄箱HG(lenny)へwebdavを導入する

玄箱HG(lenny)へwebdavを導入する 参考 Apache 2.2 WebDAV 設定 Apache関連 前提事項 apache2,sslは導入済み su 実行済み webdavディレクトリを作成する cd 任意のディレクトリ mkdir webdav chown www-data:www-data webdav chmod 700 webdav 確認 ls -l drwx------ 2 www-data www-data 4096 2012-05-29 22:22 webdav webdavアクセスユーザを作成 sudo htpasswd -c /etc/apache2/dav.passwd [username] 確認 cat /etc/apache2/dav.passwd ちなみにユーザの確認は cat /etc/passwd apache の設定に Webdav へのアクセスを設定する sudo vi /etc/apache2/sites-available/[target_site_settings_file] 以下を追加 Alias /webdav "作成したディレクトリ" <Location /webdav> DAV On Options indexes FollowSymlinks Order allow,deny allow from all AuthType Basic AuthName "Authentification Required" AuthUserFile /etc/apache2/dav.passwd Require user [username] # ユーザを指定する場合 </Location> ※ Options indexes FollowSymlinks設定 Options -indexes FollowSymlinksとすると index.htmlが存在しない場合などに、ファイル一覧を表示する機能を 無効にできる。 http://www.atmarkit.co.jp/flinux/rensai/linuxtips/705noindexes.html ...

2012-05-29 ·  2012-05-29 · 1 分 · 168 文字

玄箱HG(lenny) Apache2 再起動時にでる警告を消す

玄箱HG(lenny) Apache2 再起動時に警告がでる apache2 再起動やら設定リロードなどで下記エラーが出る場合の対処 エラー内容 以下のようなログがでる Could not reliably determine the server's fully qualified domain name, using 192.168.24.2 for ServerName ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.24.2 for ServerName ...done. 対処 cd /etc/apache2 vi apache2.conf ### Section 1: Global Environment # # The directives in this section affect the overall operation of Apache, # such as the number of concurrent requests it can handle or where it # can find its configuration files. # Servername サーバ名 ↑これ追加 確認 /etc/init.d/apache2 restart Restarting web server: apache2 ... waiting .. → エラーがでなくなった!

2012-05-28 ·  2012-05-28 · 1 分 · 98 文字

玄箱HG(debian lenny) のデータをLinkstationを起動、マウントして、rsyncするバックアップ処理を作った

玄箱HG(debian lenny) のデータをLinkstationを起動、マウントして、rsyncするバックアップ処理を作った 大まかな仕様は以下 通常電源OFF状態の、同一ネットワーク内にあるLinkstationを 定時刻に wakeonlan にて起動 起動した Linkstation をネットワーク経由にてマウント サーバデータを全てrsyncしてバックアップ 処理の開始、終了時、特定のメールアドレスへメール送信する 必要パッケージのインストール sudo apt-get update sudp apt-get upgrade sudo apt-get install wakeonlan sudo apt-get install rsync # mysql はインストール済みとする # python はインストール済みとする メール送信処理 特定アドレスにGメール送信する処理 Gmail 送信処理本体 GmailApi.py と、それを使用する sendMail.pyで構成 まずは、Gmail送信処理から 新規作成 vim GmailApi.py #!/usr/bin/python # -*- coding: utf-8 -*- import smtplib from email.MIMEText import MIMEText from email.Header import Header from email.Utils import formatdate class sendGmail: def __init__(self, encoding, subject, body, from_addr, to_addr, login_addr, passwd): self.date = formatdate() self.encoding = encoding self.subject = subject self.body = body.encode('utf-8') self.from_addr = from_addr self.to_addr = to_addr self.login_addr = login_addr self.passwd = passwd def sendMail(self): msg = MIMEText(self.body, 'html', self.encoding) msg['Subject'] = Header(self.subject, self.encoding) msg['From'] = self.from_addr msg['To'] = self.to_addr msg['Date'] = self.date s = smtplib.SMTP('smtp.gmail.com', 587) s.ehlo() s.starttls() s.ehlo() s.login(self.login_addr, self.passwd) s.sendmail(self.from_addr, self.to_addr, msg.as_string()) s.close() 上記を使用し、Gmail送信する処理 引数は以下で ...

2011-11-18 ·  2011-11-18 · 5 分 · 930 文字

玄箱HG debian lenny (14) 強引にIntelliParkを無効にする

玄箱HG debian lenny (14) 強引にIntelliParkを無効にする IntelliParkを無効にする WD製2TibHDDである、WD20EARS-2TB-SATA300において、HDDアクセスが無かった場合の省電力モードを強制的に無効にする方法です。 省電力モードなるものは一般的にHDDの寿命を縮めるなどの理由より。 こちらを参考に「 ハードウェア linux WD WD20EARSの正しい扱い方 」 シェルの作成 以下のようなシェルを作成し適当なディレクトリへ配置します $ vi disable-intellipark.sh #!/bin/sh while true;do date > /tmp/disable-intellipark sleep 5 done 以下のようなシェルを作成し/etc/init.d 配下に配置します $ vi kick.disable-intellipark.sh echo ================================ echo [start] disable-intellipark echo ================================ . /上記シェルスクリプトを配置したディレクトリ/disable-intellipark.sh & echo ================================ echo [end] disable-intellipark echo ================================ 起動設定 init.dへ配備します $ cd /etc/init.d $ sudo update-rc.d kick.disable-intellipark.sh defaults $ sudo reboot 停止設定 init.dから排除します $ cd /etc/init.d $ sudo update-rc.d -f kick.disable-intellipark.sh remove $ sudo reboot ちなみに・・・として、intelliparkの発動回数を数える方法はこちら $ sudo apt-get install smartmontools $ sudo smartctl -a /dev/hda | grep Load_Cycle_Count 193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 2332 20110607.22:28 193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 2646

2011-06-07 ·  2011-06-07 · 1 分 · 112 文字

玄箱HG debian lenny (13) ロケール設定

玄箱HG debian lenny (13) ロケール設定 ロケール設定 .bashrc 設定 追加&編集 文字コード設定 export LANG=ja_JP.UTF-8 ls オプション追加 export LS_OPTIONS='--color=auto --show-control-chars' # eval `dircolors` alias ls='ls $LS_OPTIONS' alias ll='ls $LS_OPTIONS -la' alias l='ls $LS_OPTIONS -lA' .bashrc を反映させる source .bashrc locales インストール $ sudo apt-get install locales Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: python2.6-minimal python2.6 python-minimal libkrb53 libfuse2 python libfusefs-ruby1.8 libruby1.8 libntfs-3g75 Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: locales 0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded. Need to get 4757kB of archives. After this operation, 13.1MB of additional disk space will be used. Get:1 ftp://ftp2.jp.debian.org stable/main locales 2.11.2-10 [4757kB] Fetched 4757kB in 2s (1932kB/s) perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "ja_JP.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Preconfiguring packages ... Selecting previously deselected package locales. (Reading database ... 14438 files and directories currently installed.) Unpacking locales (from .../locales_2.11.2-10_all.deb) ... Processing triggers for man-db ... locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Setting up locales (2.11.2-10) ... Generating locales (this might take a while)... Generation complete. dpkg-reconfigure locales実行 ...

2011-05-27 ·  2011-05-27 · 3 分 · 442 文字