如何在CGI中重起apche?

x86 2002-08-27 07:33:55
我试过
`service httpd restart`

不可以
...全文
21 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
swotcoder 2002-11-20
  • 打赏
  • 举报
回复
webmin的source是open的。去看看
cawangjun 2002-08-28
  • 打赏
  • 举报
回复
假设apache安装在/usr/apache下,在httpd.conf中定义的httpd.pid存放在/usr/apache/logs/httpd.pid。

# file: /usr/apache/bin/restart.sh
kill `cat ../logs/httpd.pid`
./httpd
icuc88 2002-08-28
  • 打赏
  • 举报
回复
可以,但是不能马上重起:)
1、设置一个中间文件reboot_apache其中内容为0/1;
2、配置crond, 写一个shell(reboot_apache.sh)每5秒钟察看一次reboot_apache的内容;
3、如果内容为1,怎重新启动apache,如果为0则什么也不做;
4、写一个CGI,设置这个文件;
5、CGI不需要有root的权限,但是那个reboot_apache.sh需要以root的身份运行

rystar 2002-08-27
  • 打赏
  • 举报
回复
不可能实现的,你这不是坐在凳子上搬凳子吗?
服务器的重启都得有管理员来做!
JSONObject必包的Jar包及json生成的简单案例 所有commons包的网址: http://commons.apache.org/index.html 组装和解析JSONObject的Json字符串,共需要下面六个包: 1、json-lib 2、commons-beanutils 3、commons-collections 4、commons-lang 5、commons-logging 6、ezmorph 第零个包: json-lib-2.4-jdk15.jar http://sourceforge.net/projects/json-lib/files/json-lib/json-lib-2.4/ 下载地址:http://nchc.dl.sourceforge.net/project/json-lib/json-lib/json-lib-2.4/json-lib-2.4-jdk15.jar 第一个包: commons-beanutils-1.9.2.jar http://commons.apache.org/proper/commons-beanutils/download_beanutils.cgi 下载地址:http://mirrors.cnnic.cn/apache//commons/beanutils/binaries/commons-beanutils-1.9.2-bin.zip 第二个包: (注:此包不可用,改用旧包) commons-collections4-4.0.jar http://commons.apache.org/proper/commons-collections/download_collections.cgi 下载地址:http://apache.dataguru.cn//commons/collections/binaries/commons-collections4-4.0-bin.zip (注:此包可用,低版本的包稳定性更高) commons-collections-3.2.1.jar http://commons.apache.org/proper/commons-collections/download_collections.cgi 下载地址:http://mirrors.hust.edu.cn/apache//commons/collections/binaries/commons-collections-3.2.1-bin.zip 第三个包: (注:此包不可用,会造成程序出错,改用旧包) commons-lang3-3.3.2.jar http://commons.apache.org/proper/commons-lang/download_lang.cgi 下载地址:http://apache.dataguru.cn//commons/lang/binaries/commons-lang3-3.3.2-bin.zip (注:此包可用,低版本的包稳定性更高) commons-lang-2.6-bin http://commons.apache.org/proper/commons-lang/download_lang.cgi?Preferred=http%3A%2F%2Fapache.dataguru.cn%2F 下载地址:http://apache.dataguru.cn//commons/lang/binaries/commons-lang-2.6-bin.zip 第四个包: commons-logging-1.1.3.jar http://commons.apache.org/proper/commons-logging/download_logging.cgi 下载地址:http://apache.dataguru.cn//commons/logging/binaries/commons-logging-1.1.3-bin.zip 第五个包: ezmorph-1.0.2.jar http://ezmorph.sourceforge.net/ http://sourceforge.net/projects/ezmorph/files/ezmorph/ 下载地址:http://nchc.dl.sourceforge.net/project/ezmorph/ezmorph/ezmorph-1.0.6/ezmorph-1.0.6.jar

2,204

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 CGI
社区管理员
  • CGI社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧