2005年9月アーカイブ

Google Sitemaps

|

動的ページが多いのでaccess_logからURLを取得

★httpd.conf設定
イメージ無しでCustomLOG作成

# CustomLog logs/access_log common
CustomLog logs/access_log combined
SetEnvIf Request_URI "\.(gif)|(jpeg)|(jpg)|(png)$" no_log ←★追加
#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.



DocumentRoot /home/info/htdocs
ServerName hogehoge.jp
CustomLog logs/hogehoge.jp-access_log common env=!no_log ←★追加


★config.xml

base_url="http://www.hogehoge.jp/"
store_into="/home/info/htdocs/sitemap.xml.gz"
verbose="1"
>

に設定して不要な箇所は削除

★サーバーにアップ
sitemap_gen.py
config.xml

★crontab -eにて設定(root権限)

0 0-23/2 * * * python /home/hogehoge/htdocs/sitemap_gen.py --config=/home/hogehoge/htdocs/config.xml

参考URL
http://www.moratorian.com/old/doc/googlesitemaps.html

crontab
http://www.japan9.com/cgi/cron.cgi

noip

|

ダウンロードしたファイルを解凍します。
$ tar zxvf noip-2.0.14.tar.gz
解凍したディレクトリへ移動します。
$ cd noip-2.0.14
コンパイルします。
$ make
インストールします。
$ su
# make install

データ入力する

起動スクリプトのインストールをします。
# cp redhat.noip.sh /etc/init.d/noip
# chmod 755 /etc/init.d/noip
サーバー起動時にサービスが自動起動されるように設定します。
# /sbin/chkconfig noip on
noipサービスを開始します。
# /etc/init.d/noip start

MySQLインストールyum

|

# yum -y install mysql-server
# yum install mod_auth_mysql
# yum install php-mysql

# yum clean packages

# /etc/init.d/mysqld start
# chkconfig mysqld on
# chkconfig --list mysqld

Apache2のPHP Accelerator

|

インストール

#tar zxvf php_accelerator-1.3.3r2_php-4.3.0_linux_i686-glibc2.1.3.tgz
#cd php_accelerator-1.3.3r2_php-4.3.0_linux_i686-glibc2.1.3
#chmod +x php_accelerator_1.3.3r2.so
#chmod +x phpa_cache_admin
#cp php_accelerator_1.3.3r2.so /usr/local/lib
#cp phpa_cache_admin /usr/local/bin


PHPにモジュールとして設定

vi /etc/php.ini
; PHP Accelerator extension
zend_extension="/usr/local/lib/php_accelerator_1.3.3r2.so"
phpa.shm_user = apache
phpa.shm_group = apache
phpa.cache_dir = /var/cache/phpa

★memory_limit = 128Mに変更

キャッシュディレクトリ作成 (apacheはapacheの実行ユーザー)
mkdir /var/cache/phpa
chown apache.apache /var/cache/phpa
Apacheの再起動

/etc/rc.d/init.d/httpd restart

ランレベル変更

|

[/etc/inittab]
-------------------------
id:3:initdefault:
-------------------------

この数字を 3 とすれば "テキストログイン" に、5 と設定すれば "グラフィカルログイ
ン"となります。

Apache2 PHP4インストール

|

httpd

./configure --enable-dav --enable-dav-fs --enable-rewrite --enable-so --with-mpm=worker

$ make
# make install

自動起動設定
/etc/rc.d/init.d/httpd
を作成

内容:
#!/bin/bash
#
# Startup script for Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /usr/local/apache2/conf/httpd.conf

# See how we were called.
case "$1" in
start)
/usr/local/apache2/bin/apachectl start
;;
stop)
/usr/local/apache2/bin/apachectl stop
;;
status)
/usr/local/apache2/bin/apachectl status
;;
restart)
/usr/local/apache2/bin/apachectl restart
;;
graceful)
/usr/local/apache2/bin/apachectl graceful
;;
*)
echo "Usage: $0 {start|stop|restart|graceful|status}"
exit 1
esac

exit 0

chkconfig でランレベルを設定
chkconfig --add httpd

/usr/local/apache2/conf/httpd.conf を修正

LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php


PHP

./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-roxen-zts --enable-zend-multibyte --with-mysql --enable-track-vars --enable-mbstring --enable-mbregex --with-gd --with-png-dir=shared --with-jpeg-dir=shared --with-zlib-dir=shared --with-zlib

$ make
# make install
# cp php.ini-dist /usr/local/lib/php.ini

/usr/local/lib/php.iniを修正

mbstring.language = Japanese

ダウンロードした tar.gzファイルは、以下の一連の操作の前に /usr/local に移動しています。

shell# groupadd mysql
shell# useradd -g mysql mysql
shell# cd /usr/local
shell# tar xvzf mysql-standard-4.1.9-pc-linux-gnu-i686.tar.gz
shell# ln -s mysql-standard-4.1.9-pc-linux-gnu-i686 mysql
shell# cd mysql
shell# scripts/mysql_install_db --user=mysql
shell# chown -R root .
shell# chown -R mysql data
shell# chgrp -R mysql .
shell# bin/mysqld_safe --user=mysql &


---------------------------------------------

mysqld の自動起動設定 (rcファイル) # cd /usr/local/mysql

# cp -p ./support-files/mysql.server /etc/rc.d/init.d/mysql
# cd /etc/rc.d/init.d
# vi mysql

$bindir/mysqld_safe に -L japaneseオプションを付与します
$bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file -L japanese

# chkconfig --add mysql
# chkconfig --list mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#

このアーカイブについて

このページには、2005年9月に書かれたブログ記事が新しい順に公開されています。

前のアーカイブは2005年8月です。

次のアーカイブは2005年10月です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。