喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 喜悦证交所 | 帮助

RSS 订阅当前论坛  

$5.95 Web Hosting     

上一主题 下一主题
     
标题: [问题] 请教一个让我非常迷惑linux的问题  
 
wleige (一天到晚游泳的鱼)
高级会员
Rank: 4
中级会员


UID 64348
精华 0
积分 639
帖子 676
金钱 639 喜悦币
威望 0
人脉 0
阅读权限 50
注册 2005-5-25
来自 周口人在上海
状态 离线
[广告]: Enom域名自助付费 自助注册 自助PUSH 主流域名COM等一律57.99元年
请教一个让我非常迷惑linux的问题

redhat9.0上安装apache 目录/usr/local/apache
redhat9.0上自带httpd 目录/var/sbin/httpd
但每次启动自己安装的apache时,都会启动系统自带的httpd

用/usr/local/apache/bin/httpd -k start 也没有用

于是我已修改了脚本文件/etc/rc.d/init.d/httpd
#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 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/apache/conf/httpd.conf

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/httpd ]; then
        . /etc/sysconfig/httpd
fi

# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""

# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.

# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/local/apache/bin/apachectl
httpd=${HTTPD-/usr/local/apache/bin/httpd}
prog=httpd
RETVAL=0

# check for 1.3 configuration
check13 () {
        CONFFILE=/usr/local/apache/conf/httpd.conf
        GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
        GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
        GONE="${GONE}AccessConfig|ResourceConfig)"
        if grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
                echo
                echo 1>&2 " Apache 1.3 configuration directives found"
                echo 1>&2 " please read /usr/share/doc/httpd-2.0.40/migration.html"
                failure "Apache 1.3 config directives test"
                echo
                exit 1
        fi
}

# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure.  So we just do it the way init scripts
# are expected to behave here.
start() {
        echo -n $"Starting $prog: "
        check13 || exit 1
        daemon $httpd $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
        return $RETVAL
}
stop() {
        echo -n $"Stopping $prog: "
        killproc $httpd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
}
reload() {
        echo -n $"Reloading $prog: "
        check13 || exit 1
        killproc $httpd -HUP
        RETVAL=$?
        echo
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status $httpd
        RETVAL=$?
        ;;
  restart)
        stop
        start
        ;;
  condrestart)
        if [ -f /var/run/httpd.pid ] ; then
                stop
                start
        fi
        ;;
  reload)
        reload
        ;;
  graceful|help|configtest|fullstatus)
        $apachectl $@
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
        exit 1
esac

exit $RETVAL

一样不行,晕了晕了




有勇气来改变可以改变的事情,有胸怀来接受不可改变的事情,有智慧来分辨两者的不同。http://www.featuredbride.com
2007-8-8 04:32 PM#1
查看资料  访问主页  Blog  发短消息  QQ  顶部
 
wzhu (wzhu)
版主
Rank: 7Rank: 7Rank: 7
C[A-Z]O


UID 68040
精华 0
积分 47793
帖子 1568
金钱 47770 喜悦币
威望 0
人脉 23
阅读权限 100
注册 2006-1-14
来自 湖北荆州>陕西西安>辽宁 ...
状态 离线
[广告]: Enom域名自助付费 自助注册 自助PUSH 主流域名COM等一律57.99元年
ntsysv

将httpd选中部分去掉,

service httpd stop

看看




<?wzhu
wzhu.print("http://www.cncmm.com");
?>
2007-8-8 05:28 PM#2
查看资料  访问主页  Blog  发短消息  QQ  顶部
 
xieaotian (老老仙)
版主
Rank: 7Rank: 7Rank: 7


UID 82205
精华 1
积分 1268
帖子 1496
金钱 1268 喜悦币
威望 0
人脉 0
阅读权限 100
注册 2006-10-26
来自 老老神仙部落
状态 离线
[推荐阅读] 使用mail函数还要进行其他的配置吗?
1:先停止一切apache服务或相关进程。
2:把/var/sbin/httpd 卸载,然后重新安装干净的apache服务器进行编译。
应该不会有问题的。有问题在来发帖。




http://www.okpython.com
让中国的python发展的更快。
2007-9-5 02:17 PM#3
查看资料  访问主页  Blog  发短消息  QQ  顶部
 
ChinaID
中级会员
Rank: 3Rank: 3
中级会员


UID 24280
精华 0
积分 405
帖子 422
金钱 405 喜悦币
威望 0
人脉 0
阅读权限 30
注册 2003-10-31
来自 SiChuan
状态 离线
[推荐阅读] 让php输出错误就这么难吗?
如果不太熟悉编写启动命令的话,可以使用webmin来创建一个启动项。



free, take dream fly.
www.freesDream.com
2007-9-7 10:28 PM#4
查看资料  访问主页  Blog  发短消息  QQ  ICQ 状态  Yahoo!  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.026585 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP