那位高手帮我看一下启动apache提示一下错误是怎么回事啊 系统是linux的

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了那位高手帮我看一下启动apache提示一下错误是怎么回事啊 系统是linux的相关的知识,希望对你有一定的参考价值。

ttpd:httpd: Syntax error on line 148 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_foo.so into server: /etc/httpd/modules/mod_foo.so: cannot open shared object file: No such file or directory

1,不知你的linux系统是什么版本(eg:centos, fedora)---因为不同的系统apache配置路径不同
2,我的是rhel6.2,路径:/etc/httpd/conf/httpd.conf---查看less /etc/httpd/conf/httpd.conf(第...行)
3,我的建议(懒人做法)---重装apache(yum install httpd)---按错误是你缺少了mod_foo.so模块
参考技术A /etc/httpd/conf/httpd.conf 的148行错误,这个模块mod_foo.so不存在,你把这行注释掉看看追问

怎么添加这个模块啊

追答

为什么加它,那是个例子

参考技术B /etc/httpd/conf/httpd.conf 这个文件第148行发现语法错误。无法载入/etc/httpd/modules/mod_foo.so模块到服务器中。/etc/httpd/modules/mod_foo.so无法找到。
解决办法:用管理员权限打开/etc/httpd/conf/httpd.conf ,跳到148行,在行首插入#号。

mod_foo.so模块是动态共享对象(DSO)支持的已编译二进制文件名。

基于DSO的功能有如下优点:
由于服务器包的装配工作可以在运行时使用httpd.conf中的配置命令LoadModule来进行,而不是在编译中使用编译选项来进行,因此显得更灵活。比如,只需要安装一个Apache,就可以运行多个不同的服务器实例(如标准&SSL版本,浓缩&功能加强版本[mod_perl、php])。
服务器可以在安装后使用第三方模块被轻易地扩展。这至少对厂商发行包的维护者有巨大的好处,他可以建立一个Apache核心包,而为诸如PHP、mod_perl、mod_fastcgi等扩展另建附加的包。
更简单的Apache模块原型。使用DSO配合apxs,可以脱离Apache源代码树,仅需要一个 apxs -i 和一个 apachectl restart 命令,就可以把刚开发的新模块纳入到运行中的Apache服务器。

DSO有如下缺点:
由于并不是所有操作系统都支持动态加载代码到一个程序的地址空间,因此DSO机制并不能用于所有平台。
由于Unix加载器必须进行符号解析,服务器的启动会慢20%左右。
在某些平台上,位置独立代码(positon independent code[PIC])需要复杂的汇编语言技巧来实现相对寻址,而绝对寻址则不需要,因此服务器在运行时会慢5%左右。
由于DSO模块不能在所有平台上被其他基于DSO的库所连接(ld -lfoo),比如,基于a.out的平台通常不提供此功能,而基于ELF的平台则提供,因此DSO机制并不能被用于所有类型的模块。或者可以这样说,编译为DSO文件的模块只能使用由Apache核心、C库(libc)和Apache核心所用的所有其他动态或静态的库、含有独立位置代码的静态库(libfoo.a)所提供的符号。而要使用其他代码,就只能确保Apache核心本身包含对此代码的引用,或者自己用dlopen()来加载此代码。

以上部份内容摘自Apache手册,特此声明。
参考技术C 你将/etc/httpd/conf/httpd.conf 148 行注释掉不就ok了。

java超难题,高手帮我看一下下哪里有错误,重谢!

该程序要实现的是,读取一个文本文档,例如有1~10行,要求按10~1行的顺序输出.并保存予原文件.
/*
* Main.java
*
* Created on 2000年9月29日, 下午5:17
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package javaapplication1;
import java.io.*;
import java.util.StringTokenizer;
/**
*
* @author admin
*/
public class Main

/** Creates a new instance of Main */
public Main()


/**
* @param args the command line arguments
*/
public static void main(String[] args)
// TODO code application logic here
char[] buffer=new char[1024];
Reader reader =null;
try

reader=new FileReader("D:\\新建 文本文档.txt");

int offset;
while((offset=reader.read(buffer))>0)
System.out.print(new String(buffer,0,offset));

catch(FileNotFoundException e)

e.printStackTrace();

catch(IOException e)

e.printStackTrace();

finally

if(reader!=null)
try

reader.close();

catch( IOException e)

String s= new String(buffer);
String p=new String();
String m=new String();
StringTokenizer tokenizer=new StringTokenizer(s,"\n");
while(tokenizer.hasMoreTokens())

p=tokenizer.nextToken();
m=p+m+" ";


String q=new String();
StringTokenizer tokenizer1=new StringTokenizer(m,"");
while(tokenizer.hasMoreTokens())

q=tokenizer1.nextToken();
Writer writer=null;
try

writer=new FileWriter("D:\\新建 文本文档.txt");
writer.write(p);

catch (Exception e)

e.printStackTrace();

finally

if (writer!=null)
try

writer.close();

catch(IOException e)






你的程序没有错误,只是没有实现反转写入。

//package com.color.io;

/*
* Main.java
*
* Created on 2000年9月29日, 下午5:17
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

/**
*
* @author admin
*/
public class Main

/** Creates a new instance of Main */
public Main()


/**
* @param args
* the command line arguments
* @throws IOException
*/
public static void main(String[] args) throws IOException
// TODO code application logic here
//按文件大小来产生构建buffer
char[] buffer = new char[(int)new File("D:\\新建 文本文档.txt").length()];
Reader reader = null;
try
reader = new FileReader("D:\\新建 文本文档.txt");

int offset;
while ((offset = reader.read(buffer)) > 0)
System.out.print(new String(buffer, 0, offset));
catch (FileNotFoundException e)
e.printStackTrace();
catch (IOException e)
e.printStackTrace();
finally
if (reader != null)
try
reader.close();
catch (IOException e)


//将整个文件读入,然后构造成一个String
String s = new String(buffer);
//将这个String按换行符拆分成String数组
String [] reverse = s.split("\r\n");
// 构造文件,原来那个文件
File file = new File("D:\\新建 文本文档.txt");
Writer writer = new FileWriter(file);
for(int i=reverse.length-1;i>=0;i--)
//反转写入
writer.write(reverse[i]+"\r\n");

writer.close();


参考技术A 哇哦 你搞错没有 你要我看到n年

但我有一个好办法 下载一个编程软件 将这些源程序代码粘贴进去

电运行 他会告诉你拿错了
参考技术B 你的思路有问题,给你一个思路:先把句子读到一个数组中就好办了, 参考技术C 哪错了,没看出来错啊!

以上是关于那位高手帮我看一下启动apache提示一下错误是怎么回事啊 系统是linux的的主要内容,如果未能解决你的问题,请参考以下文章

请高手帮我看下SecureCRT里的这个错误是啥意思,本人小白。如下图、

sol server 无法启动 帮我看一下错误信息,是啥原因

求助高手帮我看一下utils为空或不是对象是怎么回事

那位高手能帮我把电脑电的确定,退出,下一步,等等翻成英文

那位帮我看下这个句子对不对?为啥?

请高手帮我看下线程的错误