2008年10月30日星期四
2008年10月28日星期二
Linux/Unix Shell Script To Find Your Google Page Rank
http://linuxshellaccount.blogspot.com/2008/10/linuxunix-shell-script-to-find-your.html
2008年10月27日星期一
ouxunsi视频网站搭建(2)
openfire + red5 + (openmeetings / jwchat / spark)
1. 安装JDK1.6
下载jdk-6u3-linux-i586.bin
# chmod +x jdk-6u3-linux-i586.bin
# ./jdk-6u3-linux-i586.bin
# mv jdk1.6.3 /usr/local/ ----------移动位置
# mv jdk1.6.3 jdk1.6 ----------文件夹改名
配置环境变量
# vi /etc/profile
在末尾追加
#Java environment
export JAVA_HOME=/usr/local/jdk1.6
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
:wq保存退出。
# source /etc/profile -------------使配置生效
执行# java -version 命令,显示
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
2.安装ANT
下载apache-ant-1.7.0-bin.tar.gz
# tar zxvf apache-ant-1.7.0-bin.tar.gz
# mv apache-ant-1.7.0 /usr/local/
# mv apache-ant-1.7.0 ant
配置环境变量
# vi /etc/profile
在末尾追加
#Ant environment
export ANT_HOME=/usr/local/ant
export PATH=$ANT_HOME/bin:$PATH
:wq保存退出。
# source /etc/profile
执行ant -version命令,显示
Apache Ant version 1.7.0 compiled on December 13 2006
安装成功!
2.安装openfire
在http://www.igniterealtime.org/downloads/index.jsp#openfire上下载openfire-3.5.1-1.i386.rpm包
# rpm -ivh openfire-3.5.1-1.i386.rpm
默认安装在 /opt/openfire
# vi /etc/sysconfig/iptables
追加下面2行
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9090 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9091 -j ACCEPT
:wq保存退出后执行
# service iptables restart
可以使用下面的命令启动服务:
# /opt/openfire/bin/openfire.sh
或者用保存在/etc/init.d/下的openfire脚本启动服务,命令是/etc/init.d/openfire start
脚本如下:
#!/bin/sh
#
# openfire Stops and starts the Openfire XMPP service.
#
# chkconfig: 2345 99 1
# description: Openfire is an XMPP server, which is a server that facilitates \
# XML based communication, such as chat.
# config: /opt/openfire/conf/openfire.xml
# config: /etc/sysconfig/openfire
# pidfile: /var/run/openfire.pid
#
# This script has currently been tested on Redhat, CentOS, and Fedora based
# systems.
#
#####
# Begin setup work
#####
# Initialization
PATH="/sbin:/bin:/usr/bin:/usr/sbin"
RETVAL=0
# Check that we are root ... so non-root users stop here.
[ "`id -u`" = 0 ] || exit 1
# Get config.
[ -f "/etc/sysconfig/openfire" ] && . /etc/sysconfig/openfire
# If openfire user is not set in sysconfig, set to daemon.
[ -z "$OPENFIRE_USER" ] && OPENFIRE_USER="daemon"
# If pid file path is not set in sysconfig, set to /var/run/openfire.pid.
[ -z "$OPENFIRE_PIDFILE" ] && OPENFIRE_PIDFILE="/var/run/openfire.pid"
# -----------------------------------------------------------------
# If a openfire home variable has not been specified, try to determine it.
if [ -z "$OPENFIRE_HOME" -o ! -d "$OPENFIRE_HOME" ]; then
if [ -d "/usr/share/openfire" ]; then
OPENFIRE_HOME="/usr/share/openfire"
elif [ -d "/usr/local/openfire" ]; then
OPENFIRE_HOME="/usr/local/openfire"
elif [ -d "/opt/openfire" ]; then
OPENFIRE_HOME="/opt/openfire"
else
echo "Could not find Openfire installation under /opt, /usr/share, or /usr/local."
echo "Please specify the Openfire installation location as variable OPENFIRE_HOME"
echo "in /etc/sysconfig/openfire."
exit 1
fi
fi
# If log path is not set in sysconfig, set to $OPENFIRE_HOME/logs.
[ -z "$OPENFIRE_LOGDIR" ] && OPENFIRE_LOGDIR="${OPENFIRE_HOME}/logs"
# Attempt to locate java installation.
if [ -z "$JAVA_HOME" ]; then
if [ -d "${OPENFIRE_HOME}/jre" ]; then
JAVA_HOME="${OPENFIRE_HOME}/jre"
elif [ -d "/etc/alternatives/jre" ]; then
JAVA_HOME="/etc/alternatives/jre"
else
jdks=`ls -r1d /usr/java/j*`
for jdk in $jdks; do
if [ -f "${jdk}/bin/java" ]; then
JAVA_HOME="$jdk"
break
fi
done
fi
fi
JAVACMD="${JAVA_HOME}/bin/java"
if [ ! -d "$JAVA_HOME" -o ! -x "$JAVACMD" ]; then
echo "Error: JAVA_HOME is not defined correctly."
echo " Can not sure execute $JAVACMD."
exit 1
fi
# Prepare location of openfire libraries
OPENFIRE_LIB="${OPENFIRE_HOME}/lib"
# Prepare openfire command line
OPENFIRE_OPTS="${OPENFIRE_OPTS} -DopenfireHome=${OPENFIRE_HOME} -Dopenfire.lib.dir=${OPENFIRE_LIB}"
# Prepare local java class path
if [ -z "$LOCALCLASSPATH" ]; then
LOCALCLASSPATH="${OPENFIRE_LIB}/startup.jar"
else
LOCALCLASSPATH="${OPENFIRE_LIB}/startup.jar:${LOCALCLASSPATH}"
fi
# Export any necessary variables
#export JAVA_HOME JAVACMD
export JAVA_HOME=/usr/local/jdk1.6
export JAVACMD=/usr/local/jdk1.6/bin/java
# Lastly, prepare the full command that we are going to run.
OPENFIRE_RUN_CMD="${JAVACMD} -server ${OPENFIRE_OPTS} -classpath \"${LOCALCLASSPATH}\" -jar \"${OPENFIRE_LIB}/startup.jar\""
#####
# End setup work
#####
start() {
OLD_PWD=`pwd`
cd $OPENFIRE_LOGDIR
# Start daemons.
echo -n "Starting openfire: "
rm -f nohup.out
sudo su -s /bin/sh -c "nohup $OPENFIRE_RUN_CMD > $OPENFIRE_LOGDIR/nohup.out 2>&1 &" $OPENFIRE_USER
RETVAL=$?
PID=`ps ax --width=1000 | grep openfire | grep startup.jar | awk '{print $1}'`
if [ $RETVAL -eq 0 -a ! -z "$PID" -a ! -z "$OPENFIRE_PIDFILE" ]; then
echo $PID > $OPENFIRE_PIDFILE
fi
echo
[ $RETVAL -eq 0 -a -d /var/lock/subsys ] && touch /var/lock/subsys/openfire
sleep 1 # allows prompt to return
cd $OLD_PWD
}
stop() {
# Stop daemons.
echo -n "Shutting down openfire: "
[ -f "$OPENFIRE_PIDFILE" ] && kill `cat $OPENFIRE_PIDFILE`
RETVAL=$?
echo
[ $RETVAL -eq 0 -a -f "$OPENFIRE_PIDFILE" ] && rm -f $OPENFIRE_PIDFILE
[ $RETVAL -eq 0 -a -f "/var/lock/subsys/openfire" ] && rm -f /var/lock/subsys/openfire
}
restart() {
stop
sleep 10 # give it a few moments to shut down
start
}
condrestart() {
[ -e "/var/lock/subsys/openfire" ] && restart
return 0
}
status() {
pid=`cat $OPENFIRE_PIDFILE 2>&1`
if [ "$?" = "1" ]; then
echo "openfire is not running"
RETVAL=0
else
ps -p $pid > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo "openfire is running"
RETVAL=0
else
echo "openfire is not running"
RETVAL=0
fi
fi
}
# Handle how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
condrestart
;;
reload)
restart
;;
status)
status
;;
*)
echo "Usage $0 {start|stop|restart|status|condrestart|reload}"
RETVAL=1
esac
exit $RETVAL
脚本到此结束。
设置为开机自启动
# chkconfig openfire on
# chkconfig --list openfire
openfire 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
设置成功!
接下来在浏览器中输入http://你的服务器的IP:9090即可开始即时通讯服务器配置
(1)语言选择:中文简体
(2)服务期设置:选择域及端口,建议默认
(3)数据库设置:根据需要,这里选“标准数据库”
(4)标准数据库设置:选择MySQL,数据库URL填入你的数据库地址,端口和数据库名称(请自行创建)用户名密码填入你的mysql的帐号密码,其他根据需要选择填写。继续之后会在你的mysql中创建表并初始化。
(5)特性设置:如果你不打算用LDAP,保留默认
(6)管理员帐户设置:填入系统管理员信息
(7)安装完成
至此,Openfire安装完毕。你可以继续登录到管理控制台,进行更为详细的设置。
服务器到此安装完成。建议客户端在windows上使用spark,因为Spark和Openfire能够很好的相互支持,是黄金组合。
下载地址:http://www.igniterealtime.org/downloads/index.jsp#spark
安装比较简单,安装完成后就可以注册-->登录-->使用了。挺不错的开源聊天软件。
3. 安装Red5
下载Red5的安装文件,下载地址:http://osflash.org/red5
# tar zxvf red5-0.6.3.tar.gz
# cd red5-0.6.3
# ant
编译完后把dist文件夹内的文件copy到 /var/www/red5 文件夹下。
# vi /etc/sysconfig/iptables
开放端口,添加以下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1935 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1936 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1945 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5080 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8088 -j ACCEPT
# /etc/rc.d/init.d/iptables restart
重启防火墙
#cd /var/www/red5
# ./red5.sh &
启动服务
可以访问http://ip:5080。
安装完成。
http://www.javaeye.com/topic/212656
1. 安装JDK1.6
下载jdk-6u3-linux-i586.bin
# chmod +x jdk-6u3-linux-i586.bin
# ./jdk-6u3-linux-i586.bin
# mv jdk1.6.3 /usr/local/ ----------移动位置
# mv jdk1.6.3 jdk1.6 ----------文件夹改名
配置环境变量
# vi /etc/profile
在末尾追加
#Java environment
export JAVA_HOME=/usr/local/jdk1.6
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
:wq保存退出。
# source /etc/profile -------------使配置生效
执行# java -version 命令,显示
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
2.安装ANT
下载apache-ant-1.7.0-bin.tar.gz
# tar zxvf apache-ant-1.7.0-bin.tar.gz
# mv apache-ant-1.7.0 /usr/local/
# mv apache-ant-1.7.0 ant
配置环境变量
# vi /etc/profile
在末尾追加
#Ant environment
export ANT_HOME=/usr/local/ant
export PATH=$ANT_HOME/bin:$PATH
:wq保存退出。
# source /etc/profile
执行ant -version命令,显示
Apache Ant version 1.7.0 compiled on December 13 2006
安装成功!
2.安装openfire
在http://www.igniterealtime.org/downloads/index.jsp#openfire上下载openfire-3.5.1-1.i386.rpm包
# rpm -ivh openfire-3.5.1-1.i386.rpm
默认安装在 /opt/openfire
# vi /etc/sysconfig/iptables
追加下面2行
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9090 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9091 -j ACCEPT
:wq保存退出后执行
# service iptables restart
可以使用下面的命令启动服务:
# /opt/openfire/bin/openfire.sh
或者用保存在/etc/init.d/下的openfire脚本启动服务,命令是/etc/init.d/openfire start
脚本如下:
#!/bin/sh
#
# openfire Stops and starts the Openfire XMPP service.
#
# chkconfig: 2345 99 1
# description: Openfire is an XMPP server, which is a server that facilitates \
# XML based communication, such as chat.
# config: /opt/openfire/conf/openfire.xml
# config: /etc/sysconfig/openfire
# pidfile: /var/run/openfire.pid
#
# This script has currently been tested on Redhat, CentOS, and Fedora based
# systems.
#
#####
# Begin setup work
#####
# Initialization
PATH="/sbin:/bin:/usr/bin:/usr/sbin"
RETVAL=0
# Check that we are root ... so non-root users stop here.
[ "`id -u`" = 0 ] || exit 1
# Get config.
[ -f "/etc/sysconfig/openfire" ] && . /etc/sysconfig/openfire
# If openfire user is not set in sysconfig, set to daemon.
[ -z "$OPENFIRE_USER" ] && OPENFIRE_USER="daemon"
# If pid file path is not set in sysconfig, set to /var/run/openfire.pid.
[ -z "$OPENFIRE_PIDFILE" ] && OPENFIRE_PIDFILE="/var/run/openfire.pid"
# -----------------------------------------------------------------
# If a openfire home variable has not been specified, try to determine it.
if [ -z "$OPENFIRE_HOME" -o ! -d "$OPENFIRE_HOME" ]; then
if [ -d "/usr/share/openfire" ]; then
OPENFIRE_HOME="/usr/share/openfire"
elif [ -d "/usr/local/openfire" ]; then
OPENFIRE_HOME="/usr/local/openfire"
elif [ -d "/opt/openfire" ]; then
OPENFIRE_HOME="/opt/openfire"
else
echo "Could not find Openfire installation under /opt, /usr/share, or /usr/local."
echo "Please specify the Openfire installation location as variable OPENFIRE_HOME"
echo "in /etc/sysconfig/openfire."
exit 1
fi
fi
# If log path is not set in sysconfig, set to $OPENFIRE_HOME/logs.
[ -z "$OPENFIRE_LOGDIR" ] && OPENFIRE_LOGDIR="${OPENFIRE_HOME}/logs"
# Attempt to locate java installation.
if [ -z "$JAVA_HOME" ]; then
if [ -d "${OPENFIRE_HOME}/jre" ]; then
JAVA_HOME="${OPENFIRE_HOME}/jre"
elif [ -d "/etc/alternatives/jre" ]; then
JAVA_HOME="/etc/alternatives/jre"
else
jdks=`ls -r1d /usr/java/j*`
for jdk in $jdks; do
if [ -f "${jdk}/bin/java" ]; then
JAVA_HOME="$jdk"
break
fi
done
fi
fi
JAVACMD="${JAVA_HOME}/bin/java"
if [ ! -d "$JAVA_HOME" -o ! -x "$JAVACMD" ]; then
echo "Error: JAVA_HOME is not defined correctly."
echo " Can not sure execute $JAVACMD."
exit 1
fi
# Prepare location of openfire libraries
OPENFIRE_LIB="${OPENFIRE_HOME}/lib"
# Prepare openfire command line
OPENFIRE_OPTS="${OPENFIRE_OPTS} -DopenfireHome=${OPENFIRE_HOME} -Dopenfire.lib.dir=${OPENFIRE_LIB}"
# Prepare local java class path
if [ -z "$LOCALCLASSPATH" ]; then
LOCALCLASSPATH="${OPENFIRE_LIB}/startup.jar"
else
LOCALCLASSPATH="${OPENFIRE_LIB}/startup.jar:${LOCALCLASSPATH}"
fi
# Export any necessary variables
#export JAVA_HOME JAVACMD
export JAVA_HOME=/usr/local/jdk1.6
export JAVACMD=/usr/local/jdk1.6/bin/java
# Lastly, prepare the full command that we are going to run.
OPENFIRE_RUN_CMD="${JAVACMD} -server ${OPENFIRE_OPTS} -classpath \"${LOCALCLASSPATH}\" -jar \"${OPENFIRE_LIB}/startup.jar\""
#####
# End setup work
#####
start() {
OLD_PWD=`pwd`
cd $OPENFIRE_LOGDIR
# Start daemons.
echo -n "Starting openfire: "
rm -f nohup.out
sudo su -s /bin/sh -c "nohup $OPENFIRE_RUN_CMD > $OPENFIRE_LOGDIR/nohup.out 2>&1 &" $OPENFIRE_USER
RETVAL=$?
PID=`ps ax --width=1000 | grep openfire | grep startup.jar | awk '{print $1}'`
if [ $RETVAL -eq 0 -a ! -z "$PID" -a ! -z "$OPENFIRE_PIDFILE" ]; then
echo $PID > $OPENFIRE_PIDFILE
fi
echo
[ $RETVAL -eq 0 -a -d /var/lock/subsys ] && touch /var/lock/subsys/openfire
sleep 1 # allows prompt to return
cd $OLD_PWD
}
stop() {
# Stop daemons.
echo -n "Shutting down openfire: "
[ -f "$OPENFIRE_PIDFILE" ] && kill `cat $OPENFIRE_PIDFILE`
RETVAL=$?
echo
[ $RETVAL -eq 0 -a -f "$OPENFIRE_PIDFILE" ] && rm -f $OPENFIRE_PIDFILE
[ $RETVAL -eq 0 -a -f "/var/lock/subsys/openfire" ] && rm -f /var/lock/subsys/openfire
}
restart() {
stop
sleep 10 # give it a few moments to shut down
start
}
condrestart() {
[ -e "/var/lock/subsys/openfire" ] && restart
return 0
}
status() {
pid=`cat $OPENFIRE_PIDFILE 2>&1`
if [ "$?" = "1" ]; then
echo "openfire is not running"
RETVAL=0
else
ps -p $pid > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo "openfire is running"
RETVAL=0
else
echo "openfire is not running"
RETVAL=0
fi
fi
}
# Handle how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
condrestart
;;
reload)
restart
;;
status)
status
;;
*)
echo "Usage $0 {start|stop|restart|status|condrestart|reload}"
RETVAL=1
esac
exit $RETVAL
脚本到此结束。
设置为开机自启动
# chkconfig openfire on
# chkconfig --list openfire
openfire 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
设置成功!
接下来在浏览器中输入http://你的服务器的IP:9090即可开始即时通讯服务器配置
(1)语言选择:中文简体
(2)服务期设置:选择域及端口,建议默认
(3)数据库设置:根据需要,这里选“标准数据库”
(4)标准数据库设置:选择MySQL,数据库URL填入你的数据库地址,端口和数据库名称(请自行创建)用户名密码填入你的mysql的帐号密码,其他根据需要选择填写。继续之后会在你的mysql中创建表并初始化。
(5)特性设置:如果你不打算用LDAP,保留默认
(6)管理员帐户设置:填入系统管理员信息
(7)安装完成
至此,Openfire安装完毕。你可以继续登录到管理控制台,进行更为详细的设置。
服务器到此安装完成。建议客户端在windows上使用spark,因为Spark和Openfire能够很好的相互支持,是黄金组合。
下载地址:http://www.igniterealtime.org/downloads/index.jsp#spark
安装比较简单,安装完成后就可以注册-->登录-->使用了。挺不错的开源聊天软件。
3. 安装Red5
下载Red5的安装文件,下载地址:http://osflash.org/red5
# tar zxvf red5-0.6.3.tar.gz
# cd red5-0.6.3
# ant
编译完后把dist文件夹内的文件copy到 /var/www/red5 文件夹下。
# vi /etc/sysconfig/iptables
开放端口,添加以下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1935 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1936 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1945 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5080 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8088 -j ACCEPT
# /etc/rc.d/init.d/iptables restart
重启防火墙
#cd /var/www/red5
# ./red5.sh &
启动服务
可以访问http://ip:5080。
安装完成。
http://www.javaeye.com/topic/212656
2008年10月26日星期日
phpbb3 用户同步的想法
1. 需要考虑已有用户的同步问题,已有用户的密码采用了md5加密。
2. 注册时,将新用户的密码md5加密后,再送给phpbb3注册
3. 登录时,判断该用户是否在phpbb3中,假如没有则自动同步。
4. 修改phpbb3的注册入口到当前主站的注册入口
5. 修改phpbb3的用户登录入口,需要将用户输入的密码进行md5加密后,再送给phpbb3验证
6. 修改phpbb3的用户修改密码入口,到主站的修改密码入口。
http://www.gnuedu.org/view/printview-23.html
2. 注册时,将新用户的密码md5加密后,再送给phpbb3注册
3. 登录时,判断该用户是否在phpbb3中,假如没有则自动同步。
4. 修改phpbb3的注册入口到当前主站的注册入口
5. 修改phpbb3的用户登录入口,需要将用户输入的密码进行md5加密后,再送给phpbb3验证
6. 修改phpbb3的用户修改密码入口,到主站的修改密码入口。
http://www.gnuedu.org/view/printview-23.html
2008年10月16日星期四
Flex Mp3 Player
1. http://axel.cfwebtools.com/index.cfm/2007/10/18/Open-source-flex-xml-mp3-player
2. http://ntt.cc/2008/02/19/a-small-open-source-flash-mp3-player.html
3. http://www.lemlinh.com/flash-source-as-30-xml-mp3-player
2. http://ntt.cc/2008/02/19/a-small-open-source-flash-mp3-player.html
3. http://www.lemlinh.com/flash-source-as-30-xml-mp3-player
2008年10月9日星期四
P2P Video on JXTA study (add google talk , Libjingle, XMPP)
1. 下载 jxta 2.5.2版本
2. 服务端的采用何种形式部署?
3. 客户端采用swing的形式,还是applet的形式,还是flash的形式?
4. 普通用户,管理员用户,高级用户
5. 阶段性目标
5.1 服务端运行
5.2 客户端运行
5.3 客户端和服务端通讯,并且登陆成功。
5.4 多用户登陆,查看在线用户。 在线/离开/掉线/隐身/忙碌/勿扰
5.5 文字聊天
5.6 收听语音节目
5.7 收看视频节目
5.8 建立语音聊天室 (高级用户)
5.9 建立视频聊天室 (高级用户)
5.10 普通用户加入语音聊天室
5.11 普通用户语音聊天
5.12 普通用户加入视频聊天室
5.13 普通用户视频聊天
5.14 共享文件夹
5.15 分布式搜索共享文件夹
参考文章:
http://technica.blogbus.com/logs/15909321.html
http://www.cnblogs.com/jobs/archive/2007/03/25.html
http://sourceforge.net/projects/activex
http://osflash.org/red5/linux-install
http://www.linuxidc.com/Linux/2008-04/12293.htm
http://soft.zdnet.com.cn/software_zone/2007/1009/543087.shtml
http://www.d5power.com/thread-35-1-1.html
http://blog.zol.com.cn/779/article_778677.html
http://xinsync.xju.edu.cn/index.php/archives/2656#more-2656
-- Performance Issue: just extend the class MultiThreadedApplicationAdapter instead of the previous ApplicationAdapter and make sure your code is thread-safe
http://xinsync.xju.edu.cn/index.php/archives/2284#more-2284
-- 直接修改得到一个版本?
XMPP for flex <-- client
XMPP wildfire (java) <-- server
1. http://blog.csdn.net/rongjch/archive/2006/04/20/670721.aspx
2. http://hi.baidu.com/jabber/blog/category/Wildfire
3. http://www.xiongcaocao.com/yaotian/diary/122
使用wildfire和linq在一个客户端整合QQ,MSN,Gtalk。
1. http://www.jivesoftware.org/ 感谢jive提供了如此优秀的xmpp服务端和客户端库文件。
2. http://www.google.com/talk/intl/zh-CN/ 感谢gtalk对xmpp协议的支持。
3. http://linq.sourceforge.net/ 非常优秀的xmpp客户端。
4. http://lumaqq.linuxsir.org/main/ 超级出色的纯java的qq客户端。
5.http://hi.baidu.com/jabber 一个很不错的关于xmpp的blog。
http://wangcheng.javaeye.com/blog/153548
Flex2基于XMPP的chat程序(二)
暂定框架
1. 目标。
20个视频聊天室
1个公共文字聊天室
1.1. 公共文字聊天室
所有人群聊,直接滚屏即可。
1.2. 视频聊天室
1个主持人。
1个视频双向直连观众 第一梯队
2个声频直连观众 第二梯队
1 http://www.javaeye.com/topic/154697
构建 基于openfire + jwchat 的 WEB IM
2. http://code.google.com/p/xmpphp/
3. http://fairyfish.net/2008/08/28/xmpphp/
4. http://wiki.jabber.org/web/Bidirectional-streams_Over_Synchronous_HTTP_(BOSH)_(XEP-0124)
2. 服务端的采用何种形式部署?
3. 客户端采用swing的形式,还是applet的形式,还是flash的形式?
4. 普通用户,管理员用户,高级用户
5. 阶段性目标
5.1 服务端运行
5.2 客户端运行
5.3 客户端和服务端通讯,并且登陆成功。
5.4 多用户登陆,查看在线用户。 在线/离开/掉线/隐身/忙碌/勿扰
5.5 文字聊天
5.6 收听语音节目
5.7 收看视频节目
5.8 建立语音聊天室 (高级用户)
5.9 建立视频聊天室 (高级用户)
5.10 普通用户加入语音聊天室
5.11 普通用户语音聊天
5.12 普通用户加入视频聊天室
5.13 普通用户视频聊天
5.14 共享文件夹
5.15 分布式搜索共享文件夹
参考文章:
http://technica.blogbus.com/logs/15909321.html
http://www.cnblogs.com/jobs/archive/2007/03/25.html
http://sourceforge.net/projects/activex
http://osflash.org/red5/linux-install
http://www.linuxidc.com/Linux/2008-04/12293.htm
http://soft.zdnet.com.cn/software_zone/2007/1009/543087.shtml
http://www.d5power.com/thread-35-1-1.html
http://blog.zol.com.cn/779/article_778677.html
http://xinsync.xju.edu.cn/index.php/archives/2656#more-2656
-- Performance Issue: just extend the class MultiThreadedApplicationAdapter instead of the previous ApplicationAdapter and make sure your code is thread-safe
http://xinsync.xju.edu.cn/index.php/archives/2284#more-2284
-- 直接修改得到一个版本?
XMPP for flex <-- client
XMPP wildfire (java) <-- server
1. http://blog.csdn.net/rongjch/archive/2006/04/20/670721.aspx
2. http://hi.baidu.com/jabber/blog/category/Wildfire
3. http://www.xiongcaocao.com/yaotian/diary/122
使用wildfire和linq在一个客户端整合QQ,MSN,Gtalk。
1. http://www.jivesoftware.org/ 感谢jive提供了如此优秀的xmpp服务端和客户端库文件。
2. http://www.google.com/talk/intl/zh-CN/ 感谢gtalk对xmpp协议的支持。
3. http://linq.sourceforge.net/ 非常优秀的xmpp客户端。
4. http://lumaqq.linuxsir.org/main/ 超级出色的纯java的qq客户端。
5.http://hi.baidu.com/jabber 一个很不错的关于xmpp的blog。
http://wangcheng.javaeye.com/blog/153548
Flex2基于XMPP的chat程序(二)
暂定框架
1. 目标。
20个视频聊天室
1个公共文字聊天室
1.1. 公共文字聊天室
所有人群聊,直接滚屏即可。
1.2. 视频聊天室
1个主持人。
1个视频双向直连观众 第一梯队
2个声频直连观众 第二梯队
1 http://www.javaeye.com/topic/154697
构建 基于openfire + jwchat 的 WEB IM
2. http://code.google.com/p/xmpphp/
3. http://fairyfish.net/2008/08/28/xmpphp/
4. http://wiki.jabber.org/web/Bidirectional-streams_Over_Synchronous_HTTP_(BOSH)_(XEP-0124)
2008年10月2日星期四
ouxunsi视频网站搭建
1. 确认登录服务器没有问题。[ok 20080909]
1.1 服务器上已经存在的服务分析
----------------------------------------
# netstat -an | grep -e "LISTEN"
tcp 0 0 0.0.0.0:905 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN <-- mysql服务
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN <-- ftp服务
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN
tcp 0 0 :::8009 :::* LISTEN
tcp 0 0 :::80 :::* LISTEN <-- http服务
tcp 0 0 :::6000 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN <-- ssh服务
unix 2 [ ACC ] STREAM LISTENING 8533 /var/run/xdmctl/dmctl/socket
unix 2 [ ACC ] STREAM LISTENING 8565 /var/run/xdmctl/dmctl-:0/socket
unix 2 [ ACC ] STREAM LISTENING 7071 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 6575 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 6505 /tmp/.font-unix/fs7100
unix 2 [ ACC ] STREAM LISTENING 8560 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 6367 /dev/gpmctl
unix 2 [ ACC ] STREAM LISTENING 6059 /var/run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 6452 /var/run/iiim/.iiimp-unix/9010
----------------------------------------
1.2 已经存在的相关应用分析
java version "1.5.0_07" 安装位置 /usr/java/jdk1.5.0_07
apache-tomcat-6.0.10 安装位置 /usr/apache-tomcat-6.0.10
mysql Ver 14.12 Distrib 5.0.45 安装位置 /usr/mysql-5.0.45-linux-i686
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
----------------------------------------
# ps -ef | grep -e "java"
root 4254 1 0 Jul29 ? 12:17:31 /usr/java/jdk1.5.0_07/bin/java -
Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.log
ging.config.file=/usr/apache-tomcat-6.0.10/conf/logging.properties -server -XX:P
ermSize=64M -XX:MaxPermSize=128M -Djava.endorsed.dirs=/usr/apache-tomcat-6.0.10/
endorsed -classpath :/usr/apache-tomcat-6.0.10/bin/bootstrap.jar:/usr/apache-tom
cat-6.0.10/bin/commons-logging-api.jar -Dcatalina.base=/usr/apache-tomcat-6.0.10
-Dcatalina.home=/usr/apache-tomcat-6.0.10 -Djava.io.tmpdir=/usr/apache-tomcat-6
.0.10/temp org.apache.catalina.startup.Bootstrap start
# gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/u
sr/share/info --enable-shared --enable-threads=posix --disable-checking --with-s
ystem-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-aw
t=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
# java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode)
# /usr/mysql-5.0.45-linux-i686/bin/mysql -V
/usr/mysql-5.0.45-linux-i686/bin/mysql Ver 14.12 Distrib 5.0.45, for pc-linux-g
nu (i686) using readline 5.0
----------------------------------------
2. 安装apache服务器,测试index.html [ok 20081003]
2.0 安装Apache日志截断程序cronolog
wget -c wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
tar -zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure --prefix=/usr/ouxunsi/video/install/cronolog
make
make install
2.1 下载
wget -c http://apache.freelamp.com/httpd/httpd-2.2.9.tar.gz
2.2 解压缩,配置,编译,安装
tar -zxvf httpd-2.2.9.tar.gz
cd httpd-2.2.9
./configure \
--prefix=/usr/ouxunsi/video/install/apache2 \
--enable-so \
--enable-rewrite=static \
--enable-cache \
--enable-file-cache \
--enable-mem-cache \
--enable-disk-cache \
--enable-static-support \
--enable-static-htpasswd \
--enable-static-htdigest \
--enable-static-rotatelogs \
--enable-static-logresolve \
--enable-static-htdbm \
--enable-static-ab \
--enable-static-checkgid \
--disable-cgid \
--disable-cgi
========================================
编译配置说明
./configure //配置源代码树
--prefix=/usr/ouxunsi/video/install/apache2 //体系无关文件的顶级安装目录PREFIX ,也就Apache的安装目录。
--enable-so //打开 so 模块,so 模块是用来提 DSO 支持的 apache 核心模块
--enable-rewrite=static //打开rewrite 功能模块
--enable-mods-shared=all //编译全部的模板,对于不需要我们可以在httpd.conf去掉。这个选项打开可能会需要有更多的依赖库,在这里可以去掉
--enable-cache //支持缓存
--enable-file-cache //支持文件缓存
--enable-mem-cache //支持记忆缓存
--enable-disk-cache //支持磁盘缓存
--enable-static-support //支持静态连接(默认为动态连接)
--enable-static-htpasswd //使用静态连接编译 htpasswd - 管理用于基本认证的用户文件
--enable-static-htdigest //使用静态连接编译 htdigest - 管理用于摘要认证的用户文件
--enable-static-rotatelogs //使用静态连接编译 rotatelogs - 滚动 Apache 日志的管道日志程序
--enable-static-logresolve //使用静态连接编译 logresolve - 解析 Apache 日志中的IP地址为主机名
--enable-static-htdbm //使用静态连接编译 htdbm - 操作 DBM 密码数据库
--enable-static-ab //使用静态连接编译 ab - Apache HTTP 服务器性能测试工具
--enable-static-checkgid //使用静态连接编译 checkgid
--disable-cgid //禁止用一个外部 CGI 守护进程执行CGI脚本
--disable-cgi //禁止编译 CGI 版本的 PHP
--enable-ssl // 编译 ssl模块。这个选项打开可能需要更多的依赖库,在这里可以去掉
=============================
make
make install
2.3 配置apache2的端口和根目录
cd /usr/ouxunsi/video/install/apache2
cp conf/httpd.conf conf/httpd.conf.20081003
vi conf/httpd.conf
==========================================
Listen 80 --> Listen 8080
DirectoryIndex index.html --> DirectoryIndex index.php index.html
DocumentRoot "/usr/ouxunsi/video/install/apache2/htdocs" --> DocumentRoot "/usr/ouxunsi/video/htdocs"
-->
==========================================
2.4 配置cronolog日志截断程序
vi conf/httpd.conf
==========================================
CustomLog "logs/access_log" common
-->
CustomLog "|/usr/ouxunsi/video/install/cronolog/sbin/cronolog /usr/ouxunsi/v
ideo/install/apache2/logs/access_log.%Y%m%d" combined
==========================================
3. 安装php环境,测试phpinfo.php (应该在安装完 mysql 之后安装)
3.0 需要lib-xml2
wget -c ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/updates/x86_64/zlib-devel-1.2.1.2-1.2.x86_64.rpm
wget -c ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/os/x86_64/StartCom/RPMS/libxml2-devel-2.6.16-6.x86_64.rpm
rpm -i libxml2-devel-2.6.16-6.x86_64.rpm zlib-devel-1.2.1.2-1.2.x86_64.rpm
3.1 下载
wget -c http://cn.php.net/get/php-5.2.6.tar.gz/from/this/mirror
3.2 解压缩,编译,安装
tar -zxvf php-5.2.6.tar.gz
cd php-5.2.6
ln -sf libjpeg.so.62.0.0 libjpeg.so
ln -sf libpng.so.3.1.2.7 libpng.so
./configure \
--prefix=/usr/ouxunsi/video/install/php5 \
--with-apxs2=/usr/ouxunsi/video/install/apache2/bin/apxs \
--with-mysql=/usr/ouxunsi/video/install/mysql5 \
--disable-debug \
--with-zlib \
--enable-mbstring \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--enable-fastcgi \
--with-config-file-scan-dir=/usr/ouxunsi/video/install/php5/etc/php \
--with-mysqli=/usr/ouxunsi/video/install/mysql5/bin/mysql_config
make
make test
make install
cp php.ini-dist /usr/ouxunsi/video/install/php5/etc/php/php.ini
3.3 整合php和apache2
#make install 会自动修改http.conf 加上 LoadModule php5_module modules/libphp5.so
只需要在最后一行加上:
AddType application/x-httpd-php .php
或者更加安全的:
SetHandler application/x-httpd-php
4. 安装mysql服务器
4.0 需要安装g++ 和 ncurse-devel
wget -c ftp://mirror.switch.ch/pool/3/mirror/centos/4.6/os/x86_64/CentOS/RPMS/gcc-c++-3.4.6-9.x86_64.rpm
wget -c ftp://mirror.switch.ch/pool/3/mirror/centos/4.6/os/x86_64/CentOS/RPMS/libstdc++-devel-3.4.6-9.x86_64.rpm
wget -c ftp://mirror.switch.ch/pool/3/mirror/centos/4.6/os/x86_64/CentOS/RPMS/libstdc++-3.4.6-9.x86_64.rpm
wget -c ftp://ftp.chg.ru/pub/Linux/scientific/41/x86_64/SL/RPMS/ncurses-devel-5.4-13.x86_64.rpm
rpm -i gcc-c++-3.4.6-9.x86_64.rpm libstdc++-devel-3.4.6-9.x86_64.rpm libstdc++-3.4.6-9.x86_64.rpm ncurses-devel-5.4-13.x86_64.rpm
4.1 已经存在了一个mysql5数据库,需要注意修改端口号和相关的目录。不需要重复增加mysql用户帐号了。
wget -c http://mysql.mirror.rafal.ca/Downloads/MySQL-5.0/mysql-5.0.67.tar.gz
cd /usr/ouxunsi/video/download/mysql-5.0.67
mkdir /usr/ouxunsi/video/install/mysql5
mkdir /usr/ouxunsi/video/var/lib/mysql5
./configure \
--prefix=/usr/ouxunsi/video/install/mysql5 \
--localstatedir=/usr/ouxunsi/video/var/lib/mysql5 \
--with-comment=Source \
--with-server-suffix=-Community \
--with-mysqld-user=mysql \
--without-debug \
--with-big-tables \
--with-charset=utf8 \
--with-collation=utf8_unicode_ci \
--with-extra-charsets=all \
--with-pthread \
--enable-static \
--enable-thread-safe-client \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--enable-assembler \
--without-innodb \
--without-ndb-debug
make
make install
cd /usr/ouxunsi/video/install/mysql5
#useradd mysql //添加 mysql 用户,已经存在,所以不用重复添加
./bin/mysql_install_db --user=mysql
chown -R root:mysql .
chown -R mysql /usr/ouxunsi/video/var/lib/mysql5
chgrp -R mysql .
cp share/mysql/my-huge.cnf .
vi my-huge.cnf
==========================================
port: 3306 --> 3307 两个地方
socket: /tmp/mysql.sock --> /tmp/mysqlvideo.sock 两个地方
==========================================
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqlvideo
vi /etc/rc.d/init.d/mysqlvideo
==========================================
datadir=/var/lib/mysql5
conf=/usr/ouxunsi/video/install/mysql5/my-huge.cnf
把"$bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &"替换为(双引号中的)
"$bindir/mysqld_safe --defaults-file=/usr/ouxunsi/video/install/mysql5/my-huge.cnf --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &"(双引号中的)
==========================================
chmod 755 /etc/rc.d/init.d/mysqlvideo
chkconfig --add mysqlvideo
4.2 启动数据库
/etc/rc.d/init.d/mysqlvideo start
4.3 修改root用户密码
./bin/mysql -u root -S /tmp/mysqlvideo.sock
======================================================
mysql> use mysql
mysql> update user set password=password('video') where user='root';
mysql> FLUSH PRIVILEGES;
======================================================
4.4 停止数据库运行
/etc/rc.d/init.d/mysqlvideo stop
5. 安装svn服务器,是否可以提供密码保护(使用svn+ssh实现)
5.0 需要expat-devel neon等库
wget -c ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/os/x86_64/StartCom/RPMS/expat-devel-1.95.7-4.x86_64.rpm
rpm -i expat-devel-1.95.7-4.x86_64.rpm
wget -c ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/os/x86_64/StartCom/RPMS/neon-devel-0.24.7-4.x86_64.rpm
wget -c http://ftp.riken.go.jp/Linux/cern/slc41/updates/x86_64/RPMS/openssl-devel-0.9.7a-43.10.x86_64.rpm
wget -c http://ftp.riken.go.jp/Linux/cern/slc41/updates/x86_64/RPMS/krb5-devel-1.3.4-33.x86_64.rpm
wget -c http://ftp.riken.go.jp/Linux/cern/slc41/updates/x86_64/RPMS/e2fsprogs-devel-1.35-12.4.EL4.x86_64.rpm
rpm -i neon-devel-0.24.7-4.x86_64.rpm openssl-devel-0.9.7a-43.10.x86_64.rpm krb5-devel-1.3.4-33.x86_64.rpm e2fsprogs-devel-1.35-12.4.EL4.x86_64.rpm
5.1 下载svn源代码
wget -c http://subversion.tigris.org/downloads/subversion-1.5.2.tar.gz
tar -zxvf subversion-1.5.2.tar.gz
cd subversion-1.5.2
./configure --with-apr=/usr/ouxunsi/video/install/apache2 \
--with-apr-util=/usr/ouxunsi/video/install/apache2 \
--prefix=/usr/ouxunsi/video/install/subversion \
--with-ssl \
--with-neon=/usr
make
make install
5.2 创建代码库
cd /usr/ouxunsi/video/
mkdir svnroot
cd svnroot
svnadmin create .
5.3 增加一个软链接到svnserve 从而可以使用 svn+ssh
ln -s /usr/ouxunsi/video/install/subversion/bin/svnserve /usr/bin/svnserve
svn checkout svn+ssh://root@xxx.xxx.xxx.xxx/usr/ouxunsi/video/svnroot .
6. 安装web ftp服务器
6.1 下载安装
wget -c ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.1.tar.gz
tar -zxvf proftpd-1.3.1.tar.gz
cd proftpd-1.3.1
mkdir /usr/ouxunsi/video/install/proftpd
mkdir /usr/ouxunsi/video/install/proftpd/etc
./configure --prefix=/usr/ouxunsi/video/install/proftpd \
--sysconfdir=/usr/ouxunsi/video/install/proftpd/etc
make
make install
6.2 配置proftpd.conf
cd /usr/ouxunsi/video/install/proftpd/etc
cp proftpd.conf proftpd.conf.20081010
vi proftpd.conf
====================================================
Port 21 --> Port 8021
Group nogroup --> Group nobody
注释所有Anonymous部分
在最后增加如下行,定义虚拟用户和目录权限
RequireValidShell off
AuthOrder mod_auth_file.c
AuthUserFile /usr/ouxunsi/video/install/proftpd/etc/passwd
AuthGroupFile /usr/ouxunsi/video/install/proftpd/etc/group
SystemLog /usr/ouxunsi/video/var/proftpd.log
AllowGroup editor
====================================================
cp /usr/ouxunsi/video/download/proftpd-1.3.1/contrib/ftpasswd .
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=editor01 --uid=2001 --home=/usr/ouxunsi/video/htdocs --shell=/bin/false
./ftpasswd --group --name=editor --gid=2001 --file /usr/ouxunsi/video/install/proftpd/etc/group
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=ftpupload --uid=2001 --home=/usr/ouxunsi/video/ftpupload --shell=/bin/false
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=editor01 --uid=99 --gid=99 --home=/usr/ouxunsi/video/htdocs --shell=/bin/false
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=ftpupload --uid=99 --gid=99 --home=/usr/ouxunsi/video/ftpupload --shell=/bin/false
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=ftpupload --uid=2 --gid=2 --home=/usr/ouxunsi/video/ftpupload --shell=/bin/false
<-- 因为apache httpd2默认的用户名为daemon,所以需要用同样的,从而避免权限问题。
chown -R nobody:nobody /usr/ouxunsi/video/htdocs
chmod -R 777 /usr/ouxunsi/video/htdocs
6.3 配置启动脚本
cp /usr/ouxunsi/video/download/proftpd-1.3.1/contrib/dist/rpm/proftpd.init.d /usr/ouxunsi/video/install/proftpd
vi /usr/ouxunsi/video/install/proftpd/proftpd.init.d
===========================================
PATH="$PATH:/usr/local/sbin" --> PATH="$PATH:/usr/ouxunsi/video/install/proftpd/sbin"
===========================================
参考文章:
[01] http://www.centoschina.com/read.php?tid-9692.html
centos 5.0 编译安装apache 2.2.6+php5.2.5+mysql5.0.46+Zend笔记
[02] http://www.javaeye.com/topic/203986
Linux下两个不同版本Mysql的安装实战(Mysql5和mysql4)
[03] http://203.208.37.104/search?q=cache:61JaO2KxL5gJ:bbs.dadipedia.com/showthread.php%3Ft%3D24+subversion+%E7%BC%96%E8%AF%91+with-neon+with-ssl&hl=zh-CN&ct=clnk&cd=1&gl=cn&st_usg=ALhdy292DtxQYGhYxFtJKeHaST1h_1KwNA
LAMP, Trac, SQLite3, SubVersion 编译参数
1.1 服务器上已经存在的服务分析
----------------------------------------
# netstat -an | grep -e "LISTEN"
tcp 0 0 0.0.0.0:905 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN <-- mysql服务
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN <-- ftp服务
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN
tcp 0 0 :::8009 :::* LISTEN
tcp 0 0 :::80 :::* LISTEN <-- http服务
tcp 0 0 :::6000 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN <-- ssh服务
unix 2 [ ACC ] STREAM LISTENING 8533 /var/run/xdmctl/dmctl/socket
unix 2 [ ACC ] STREAM LISTENING 8565 /var/run/xdmctl/dmctl-:0/socket
unix 2 [ ACC ] STREAM LISTENING 7071 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 6575 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 6505 /tmp/.font-unix/fs7100
unix 2 [ ACC ] STREAM LISTENING 8560 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 6367 /dev/gpmctl
unix 2 [ ACC ] STREAM LISTENING 6059 /var/run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 6452 /var/run/iiim/.iiimp-unix/9010
----------------------------------------
1.2 已经存在的相关应用分析
java version "1.5.0_07" 安装位置 /usr/java/jdk1.5.0_07
apache-tomcat-6.0.10 安装位置 /usr/apache-tomcat-6.0.10
mysql Ver 14.12 Distrib 5.0.45 安装位置 /usr/mysql-5.0.45-linux-i686
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
----------------------------------------
# ps -ef | grep -e "java"
root 4254 1 0 Jul29 ? 12:17:31 /usr/java/jdk1.5.0_07/bin/java -
Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.log
ging.config.file=/usr/apache-tomcat-6.0.10/conf/logging.properties -server -XX:P
ermSize=64M -XX:MaxPermSize=128M -Djava.endorsed.dirs=/usr/apache-tomcat-6.0.10/
endorsed -classpath :/usr/apache-tomcat-6.0.10/bin/bootstrap.jar:/usr/apache-tom
cat-6.0.10/bin/commons-logging-api.jar -Dcatalina.base=/usr/apache-tomcat-6.0.10
-Dcatalina.home=/usr/apache-tomcat-6.0.10 -Djava.io.tmpdir=/usr/apache-tomcat-6
.0.10/temp org.apache.catalina.startup.Bootstrap start
# gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/u
sr/share/info --enable-shared --enable-threads=posix --disable-checking --with-s
ystem-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-aw
t=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
# java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode)
# /usr/mysql-5.0.45-linux-i686/bin/mysql -V
/usr/mysql-5.0.45-linux-i686/bin/mysql Ver 14.12 Distrib 5.0.45, for pc-linux-g
nu (i686) using readline 5.0
----------------------------------------
2. 安装apache服务器,测试index.html [ok 20081003]
2.0 安装Apache日志截断程序cronolog
wget -c wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
tar -zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure --prefix=/usr/ouxunsi/video/install/cronolog
make
make install
2.1 下载
wget -c http://apache.freelamp.com/httpd/httpd-2.2.9.tar.gz
2.2 解压缩,配置,编译,安装
tar -zxvf httpd-2.2.9.tar.gz
cd httpd-2.2.9
./configure \
--prefix=/usr/ouxunsi/video/install/apache2 \
--enable-so \
--enable-rewrite=static \
--enable-cache \
--enable-file-cache \
--enable-mem-cache \
--enable-disk-cache \
--enable-static-support \
--enable-static-htpasswd \
--enable-static-htdigest \
--enable-static-rotatelogs \
--enable-static-logresolve \
--enable-static-htdbm \
--enable-static-ab \
--enable-static-checkgid \
--disable-cgid \
--disable-cgi
========================================
编译配置说明
./configure //配置源代码树
--prefix=/usr/ouxunsi/video/install/apache2 //体系无关文件的顶级安装目录PREFIX ,也就Apache的安装目录。
--enable-so //打开 so 模块,so 模块是用来提 DSO 支持的 apache 核心模块
--enable-rewrite=static //打开rewrite 功能模块
--enable-mods-shared=all //编译全部的模板,对于不需要我们可以在httpd.conf去掉。这个选项打开可能会需要有更多的依赖库,在这里可以去掉
--enable-cache //支持缓存
--enable-file-cache //支持文件缓存
--enable-mem-cache //支持记忆缓存
--enable-disk-cache //支持磁盘缓存
--enable-static-support //支持静态连接(默认为动态连接)
--enable-static-htpasswd //使用静态连接编译 htpasswd - 管理用于基本认证的用户文件
--enable-static-htdigest //使用静态连接编译 htdigest - 管理用于摘要认证的用户文件
--enable-static-rotatelogs //使用静态连接编译 rotatelogs - 滚动 Apache 日志的管道日志程序
--enable-static-logresolve //使用静态连接编译 logresolve - 解析 Apache 日志中的IP地址为主机名
--enable-static-htdbm //使用静态连接编译 htdbm - 操作 DBM 密码数据库
--enable-static-ab //使用静态连接编译 ab - Apache HTTP 服务器性能测试工具
--enable-static-checkgid //使用静态连接编译 checkgid
--disable-cgid //禁止用一个外部 CGI 守护进程执行CGI脚本
--disable-cgi //禁止编译 CGI 版本的 PHP
--enable-ssl // 编译 ssl模块。这个选项打开可能需要更多的依赖库,在这里可以去掉
=============================
make
make install
2.3 配置apache2的端口和根目录
cd /usr/ouxunsi/video/install/apache2
cp conf/httpd.conf conf/httpd.conf.20081003
vi conf/httpd.conf
==========================================
Listen 80 --> Listen 8080
DirectoryIndex index.html --> DirectoryIndex index.php index.html
DocumentRoot "/usr/ouxunsi/video/install/apache2/htdocs" --> DocumentRoot "/usr/ouxunsi/video/htdocs"
==========================================
2.4 配置cronolog日志截断程序
vi conf/httpd.conf
==========================================
CustomLog "logs/access_log" common
-->
CustomLog "|/usr/ouxunsi/video/install/cronolog/sbin/cronolog /usr/ouxunsi/v
ideo/install/apache2/logs/access_log.%Y%m%d" combined
==========================================
3. 安装php环境,测试phpinfo.php (应该在安装完 mysql 之后安装)
3.0 需要lib-xml2
wget -c ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/updates/x86_64/zlib-devel-1.2.1.2-1.2.x86_64.rpm
wget -c ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/os/x86_64/StartCom/RPMS/libxml2-devel-2.6.16-6.x86_64.rpm
rpm -i libxml2-devel-2.6.16-6.x86_64.rpm zlib-devel-1.2.1.2-1.2.x86_64.rpm
3.1 下载
wget -c http://cn.php.net/get/php-5.2.6.tar.gz/from/this/mirror
3.2 解压缩,编译,安装
tar -zxvf php-5.2.6.tar.gz
cd php-5.2.6
ln -sf libjpeg.so.62.0.0 libjpeg.so
ln -sf libpng.so.3.1.2.7 libpng.so
./configure \
--prefix=/usr/ouxunsi/video/install/php5 \
--with-apxs2=/usr/ouxunsi/video/install/apache2/bin/apxs \
--with-mysql=/usr/ouxunsi/video/install/mysql5 \
--disable-debug \
--with-zlib \
--enable-mbstring \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--enable-fastcgi \
--with-config-file-scan-dir=/usr/ouxunsi/video/install/php5/etc/php \
--with-mysqli=/usr/ouxunsi/video/install/mysql5/bin/mysql_config
make
make test
make install
cp php.ini-dist /usr/ouxunsi/video/install/php5/etc/php/php.ini
3.3 整合php和apache2
#make install 会自动修改http.conf 加上 LoadModule php5_module modules/libphp5.so
只需要在最后一行加上:
AddType application/x-httpd-php .php
或者更加安全的:
SetHandler application/x-httpd-php
4. 安装mysql服务器
4.0 需要安装g++ 和 ncurse-devel
wget -c ftp://mirror.switch.ch/pool/3/mirror/centos/4.6/os/x86_64/CentOS/RPMS/gcc-c++-3.4.6-9.x86_64.rpm
wget -c ftp://mirror.switch.ch/pool/3/mirror/centos/4.6/os/x86_64/CentOS/RPMS/libstdc++-devel-3.4.6-9.x86_64.rpm
wget -c ftp://mirror.switch.ch/pool/3/mirror/centos/4.6/os/x86_64/CentOS/RPMS/libstdc++-3.4.6-9.x86_64.rpm
wget -c ftp://ftp.chg.ru/pub/Linux/scientific/41/x86_64/SL/RPMS/ncurses-devel-5.4-13.x86_64.rpm
rpm -i gcc-c++-3.4.6-9.x86_64.rpm libstdc++-devel-3.4.6-9.x86_64.rpm libstdc++-3.4.6-9.x86_64.rpm ncurses-devel-5.4-13.x86_64.rpm
4.1 已经存在了一个mysql5数据库,需要注意修改端口号和相关的目录。不需要重复增加mysql用户帐号了。
wget -c http://mysql.mirror.rafal.ca/Downloads/MySQL-5.0/mysql-5.0.67.tar.gz
cd /usr/ouxunsi/video/download/mysql-5.0.67
mkdir /usr/ouxunsi/video/install/mysql5
mkdir /usr/ouxunsi/video/var/lib/mysql5
./configure \
--prefix=/usr/ouxunsi/video/install/mysql5 \
--localstatedir=/usr/ouxunsi/video/var/lib/mysql5 \
--with-comment=Source \
--with-server-suffix=-Community \
--with-mysqld-user=mysql \
--without-debug \
--with-big-tables \
--with-charset=utf8 \
--with-collation=utf8_unicode_ci \
--with-extra-charsets=all \
--with-pthread \
--enable-static \
--enable-thread-safe-client \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--enable-assembler \
--without-innodb \
--without-ndb-debug
make
make install
cd /usr/ouxunsi/video/install/mysql5
#useradd mysql //添加 mysql 用户,已经存在,所以不用重复添加
./bin/mysql_install_db --user=mysql
chown -R root:mysql .
chown -R mysql /usr/ouxunsi/video/var/lib/mysql5
chgrp -R mysql .
cp share/mysql/my-huge.cnf .
vi my-huge.cnf
==========================================
port: 3306 --> 3307 两个地方
socket: /tmp/mysql.sock --> /tmp/mysqlvideo.sock 两个地方
==========================================
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqlvideo
vi /etc/rc.d/init.d/mysqlvideo
==========================================
datadir=/var/lib/mysql5
conf=/usr/ouxunsi/video/install/mysql5/my-huge.cnf
把"$bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &"替换为(双引号中的)
"$bindir/mysqld_safe --defaults-file=/usr/ouxunsi/video/install/mysql5/my-huge.cnf --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &"(双引号中的)
==========================================
chmod 755 /etc/rc.d/init.d/mysqlvideo
chkconfig --add mysqlvideo
4.2 启动数据库
/etc/rc.d/init.d/mysqlvideo start
4.3 修改root用户密码
./bin/mysql -u root -S /tmp/mysqlvideo.sock
======================================================
mysql> use mysql
mysql> update user set password=password('video') where user='root';
mysql> FLUSH PRIVILEGES;
======================================================
4.4 停止数据库运行
/etc/rc.d/init.d/mysqlvideo stop
5. 安装svn服务器,是否可以提供密码保护(使用svn+ssh实现)
5.0 需要expat-devel neon等库
wget -c ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/os/x86_64/StartCom/RPMS/expat-devel-1.95.7-4.x86_64.rpm
rpm -i expat-devel-1.95.7-4.x86_64.rpm
wget -c ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/os/x86_64/StartCom/RPMS/neon-devel-0.24.7-4.x86_64.rpm
wget -c http://ftp.riken.go.jp/Linux/cern/slc41/updates/x86_64/RPMS/openssl-devel-0.9.7a-43.10.x86_64.rpm
wget -c http://ftp.riken.go.jp/Linux/cern/slc41/updates/x86_64/RPMS/krb5-devel-1.3.4-33.x86_64.rpm
wget -c http://ftp.riken.go.jp/Linux/cern/slc41/updates/x86_64/RPMS/e2fsprogs-devel-1.35-12.4.EL4.x86_64.rpm
rpm -i neon-devel-0.24.7-4.x86_64.rpm openssl-devel-0.9.7a-43.10.x86_64.rpm krb5-devel-1.3.4-33.x86_64.rpm e2fsprogs-devel-1.35-12.4.EL4.x86_64.rpm
5.1 下载svn源代码
wget -c http://subversion.tigris.org/downloads/subversion-1.5.2.tar.gz
tar -zxvf subversion-1.5.2.tar.gz
cd subversion-1.5.2
./configure --with-apr=/usr/ouxunsi/video/install/apache2 \
--with-apr-util=/usr/ouxunsi/video/install/apache2 \
--prefix=/usr/ouxunsi/video/install/subversion \
--with-ssl \
--with-neon=/usr
make
make install
5.2 创建代码库
cd /usr/ouxunsi/video/
mkdir svnroot
cd svnroot
svnadmin create .
5.3 增加一个软链接到svnserve 从而可以使用 svn+ssh
ln -s /usr/ouxunsi/video/install/subversion/bin/svnserve /usr/bin/svnserve
svn checkout svn+ssh://root@xxx.xxx.xxx.xxx/usr/ouxunsi/video/svnroot .
6. 安装web ftp服务器
6.1 下载安装
wget -c ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.1.tar.gz
tar -zxvf proftpd-1.3.1.tar.gz
cd proftpd-1.3.1
mkdir /usr/ouxunsi/video/install/proftpd
mkdir /usr/ouxunsi/video/install/proftpd/etc
./configure --prefix=/usr/ouxunsi/video/install/proftpd \
--sysconfdir=/usr/ouxunsi/video/install/proftpd/etc
make
make install
6.2 配置proftpd.conf
cd /usr/ouxunsi/video/install/proftpd/etc
cp proftpd.conf proftpd.conf.20081010
vi proftpd.conf
====================================================
Port 21 --> Port 8021
Group nogroup --> Group nobody
注释所有Anonymous部分
在最后增加如下行,定义虚拟用户和目录权限
RequireValidShell off
AuthOrder mod_auth_file.c
AuthUserFile /usr/ouxunsi/video/install/proftpd/etc/passwd
AuthGroupFile /usr/ouxunsi/video/install/proftpd/etc/group
SystemLog /usr/ouxunsi/video/var/proftpd.log
AllowGroup editor
====================================================
cp /usr/ouxunsi/video/download/proftpd-1.3.1/contrib/ftpasswd .
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=editor01 --uid=2001 --home=/usr/ouxunsi/video/htdocs --shell=/bin/false
./ftpasswd --group --name=editor --gid=2001 --file /usr/ouxunsi/video/install/proftpd/etc/group
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=ftpupload --uid=2001 --home=/usr/ouxunsi/video/ftpupload --shell=/bin/false
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=editor01 --uid=99 --gid=99 --home=/usr/ouxunsi/video/htdocs --shell=/bin/false
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=ftpupload --uid=99 --gid=99 --home=/usr/ouxunsi/video/ftpupload --shell=/bin/false
./ftpasswd --passwd --file /usr/ouxunsi/video/install/proftpd/etc/passwd --name=ftpupload --uid=2 --gid=2 --home=/usr/ouxunsi/video/ftpupload --shell=/bin/false
<-- 因为apache httpd2默认的用户名为daemon,所以需要用同样的,从而避免权限问题。
chown -R nobody:nobody /usr/ouxunsi/video/htdocs
chmod -R 777 /usr/ouxunsi/video/htdocs
6.3 配置启动脚本
cp /usr/ouxunsi/video/download/proftpd-1.3.1/contrib/dist/rpm/proftpd.init.d /usr/ouxunsi/video/install/proftpd
vi /usr/ouxunsi/video/install/proftpd/proftpd.init.d
===========================================
PATH="$PATH:/usr/local/sbin" --> PATH="$PATH:/usr/ouxunsi/video/install/proftpd/sbin"
===========================================
参考文章:
[01] http://www.centoschina.com/read.php?tid-9692.html
centos 5.0 编译安装apache 2.2.6+php5.2.5+mysql5.0.46+Zend笔记
[02] http://www.javaeye.com/topic/203986
Linux下两个不同版本Mysql的安装实战(Mysql5和mysql4)
[03] http://203.208.37.104/search?q=cache:61JaO2KxL5gJ:bbs.dadipedia.com/showthread.php%3Ft%3D24+subversion+%E7%BC%96%E8%AF%91+with-neon+with-ssl&hl=zh-CN&ct=clnk&cd=1&gl=cn&st_usg=ALhdy292DtxQYGhYxFtJKeHaST1h_1KwNA
LAMP, Trac, SQLite3, SubVersion 编译参数
订阅:
博文 (Atom)