ttserver 用ttservctl启动,默认是全部的host可以访问
如果在配置文件加了
prog="ttservctl"
cmd="ttserver"
basedir="/var/ttserver"
host="192.168.100.151" #光加这个不起作用
port="1978"
除了加上上面的之外,还要在脚本里加
start(){
printf 'Starting the server of Tokyo Tyrant\n'
mkdir -p "$basedir"
if [ -z "$basedir" ] || [ -z "$port" ] || [ -z "$pidfile" ] || [ -z "$dbname" ] ; then
printf 'Invalid configuration\n'
retval=1
elif ! [ -d "$basedir" ] ; then
printf 'No such directory: %s\n' "$basedir"
retval=1
elif [ -f "$pidfile" ] ; then
pid=`cat "$pidfile"`
printf 'Existing process: %d\n' "$pid"
retval=1
else
cmd="$cmd -port $port -dmn -pid $pidfile"
if [ -n "$host" ] ; then
cmd="$cmd -host $host"
fi
if [ -n "$logfile" ] ; then
cmd="$cmd -log $logfile"
fi
本文详细介绍了如何使用ttservctl启动ttserver,并通过配置文件进行精细化设置,包括指定主机、端口等参数,确保服务器稳定运行。

被折叠的 条评论
为什么被折叠?



