5392[TOP]
LANDISK鯖がお亡くなりに
KANOSO
2009/11/24 23:07

LANDISK初号機がお亡くなりになったよ〜

伊予のiMACだっけ?で鯖つくろっかな〜サイトってまだある?

メッセ立ち上げてよ〜


<メモ書き>
■rsync         ssh転送は出来たけど、パスワードをナシにしたい
[netbook]# vi /share/backup/rsync_backup
#!/bin/sh
rsync -av -e ssh --delete 192.168.1.XX:/share/www /share/
rsync -av -e ssh --delete 192.168.1.XX:/share/ftp-data /share/


■Apache2        アクセスは出来るがCGIが動いてないっぽい
→CGIは下記のリンクをすればOKでした
netbook:~$ln -s /usr/bin/perl /usr/local/bin/perl


netbook:~$vi /etc/apache2/conf/httpd.conf を編集

User www-data
Group www-data

ServerName netbook:80
#kano#DocumentRoot "/var/www/html"

##<Directory "/var/www/html">
<Directory "/var/www/">

AddHandler cgi-script .cgi .sh .pl


各Webを作成する。なぜかPASSWORDを聞いてきてしまうため
修正が必要
netbook:~$vi /etc/apache2/conf.d/www.conf
Alias /www/ "/share/www/"
<Directory "/share/www">
AuthUserFile /share/pass/.htpasswd
AuthGroupFile /dev/null
AuthName "UserID:kano Pass: <-nasi"
AuthType Basic
Require valid-user

Options MultiViews FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny

Allow from all
Deny from 122.152.128.0/23
Deny from 122.152.140.0/23
Deny from 64.124.85.212
Deny from 61.247.
Deny from 58.65.
Deny from 66.232.

Satisfy Any
</Directory>




■MySQL         インストール動作未確認
■PHP          PHP5をインストール動作未確認
# apt-get update ← APTデータベース更新

※ Apache1.3系との違いはphp5-apache → php5-apache2になった所です。

# apt-get install php5 php5-apache2 php5-devel php5-pear php5-mysql ← インストール

# update-alternatives --config apache2 ← 設定

There are 2 alternatives which provide `apache2'.

Selection Alternative
-----------------------------------------------
1 /usr/sbin/apache2.worker
*+ 2 /usr/sbin/apache2.prefork

Press enter to keep the default[*], or type selection number: 2
Using `/usr/sbin/apache2.prefork' to provide `apache2'.

# vi /etc/php5/php.ini ← 設定ファイル編集

output_buffering = On ← 出力バッファを有効に

output_handler = mb_output_handler ← 出力時に使用するハンドラ関数を指定

error_reporting = E_ALL & ~E_NOTIC ← ;を削除

;error_reporting = E_ALL ← ;を追加

magic_quotes_gpc = Off

default_charset = EUC-JP ← HTTPヘッダ charset を設定

mbstring.language = Japanese ← 言語のデフォルトを日本語に

mbstring.internal_encoding = UTF-8 ← 内部文字コードをUTF-8に(EUCの場合EUC-JP JISの場合SJIS)

mbstring.http_input = auto ← HTTP入力の文字コード

mbstring.http_output = EUC-JP ← HTTP出力文字コードをEUCに

mbstring.encoding_translation = On ← HTTP入力文字コードへの変換を有効に

mbstring.detect_order = auto ← 文字コード自動検出の優先順を自動に

mbstring.substitute_character = none; ← 処理できない文字の代替文字


■MMCache        インストール動作未確認
■Webalizer データ写しただけ未確認
■Samba3&NetBIOS     他PCから見えるけど日本語が文字化け中
【samba ユーザの作成】
まずは、「smbpasswd」を利用して、samba で使用するユーザを作成します。

# smbpasswd -a <ユーザ名>
  New SMB password:
  Retype new SMB password:


netbook:~$vi /etc/samba/smb.conf を下記の項目を追加修正
[global]
# code setting
dos charset = CP932
unix charset = UTF-8
display charset = EUCJP-MS

# access setting
workgroup = WORKGROUP
server string = Samba Server Version %v
map to guest = Bad User
null passwords = Yes
netbios name = NetBook
hosts allow = 127. 192.168.1.

# mangle
mangled names = yes
mangling method = hash2
mangle prefix = 4
mangling char = ~

# lock
kernel oplocks = Yes
oplocks = Yes

# hide Mac special files
veto files = /.AppleDB/.AppleDouble/.AppleDesktop/Network Trash Folder/\
TheFindByContentFolder/TheVolumeSettingsFolder/Temporary Items/.DS_Store/\
.VolumeIcon.icns/Icon?/.FBCIndex/.FBCLockFolder/Trash/
delete veto files = Yes
 →いらないかも


再起動
netbook:~$ /etc/init.d/smb restart
SMBサービスを停止中: [ OK ]
SMBサービスを起動中: [ OK ]

自動起動設定のついでに smb と nmb を起動させます。

# chkconfig smb on
# chkconfig nmb on
# chkconfig --list smb
smb 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# chkconfig --list nmb
nmb 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# /etc/rc.d/init.d/smb startSMBサービスを起動中: [ OK ]
# /etc/rc.d/init.d/nmb startNMBサービスを起動中: [ OK ]



■DDNSの自動更新     OK
/etc/cron.weekly ディレクトリに下記のスプリクトを入れる

netbook:~$vi ddns-cron
#!/bin/sh

DATE=`date +"%Y/%m/%d %X"`

wget -q -O - 'http://free.ddo.jp/dnsupdate.php?dn=アカウント&pw=パスワード' | \
awk '$0 ~ /SUCCESS/ || $0 ~ /FAIL/ { print date, $0;}' date="$DATE" >> /var/log/ddns.log


■SquirrelMail      まだ


■Telnet         デフォルトで使用不可になっているためxinetdを一部修正する
netbook:~$vi /etc/xinetd.d/telnet で編集
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no ←「yes」を「no」に

再起動
# /etc/rc.d/init.d/xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]

■サーバー公開に向けてのセキュリティ関係 まだ

PASS