LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 627|回复: 4

启动apache时出错了

[复制链接]
发表于 2005-2-23 12:36:59 | 显示全部楼层 |阅读模式
在gentoo下安装好apache后,
/etc/init.d/apache2 start
* Starting apache2...
(2)No such file or directory: apache2: could not open error log file /usr/lib/apache2/logs/error_log.
Unable to open logs   
而我却找不到error_log这个文件,logs只是一个连接文件
ls -l
total 2
drwxr-xr-x  2 root root  400 Feb 21 23:04 build
lrwxrwxrwx  1 root root   17 Feb 21 23:04 conf -> /etc/apache2/conf
lrwxrwxrwx  1 root root   29 Feb 21 23:04 extramodules -> /usr/lib/apache2-extramodules
lrwxrwxrwx  1 root root    8 Feb 21 23:04 lib -> /usr/lib
lrwxrwxrwx  1 root root   16 Feb 21 23:04 logs -> /var/log/apache2
drwxr-xr-x  2 root root 1752 Feb 21 23:04 modules
是哪里出错了?
发表于 2005-2-23 12:39:15 | 显示全部楼层
我的/etc/apache2/conf/apache2.conf

希望对你有所帮助
  1. ### /etc/apache2/conf/apache2.conf
  2. ### $Id: apache2.conf,v 1.1 2004/03/22 21:17:57 stuart Exp $
  3. ###
  4. ### Main Configuration Section
  5. ### You really shouldn't change these settings unless you're a guru
  6. ###
  7. ServerRoot /usr/lib/apache2
  8. #ServerName localhost
  9. #LockFile /etc/apache2/apache2.lock
  10. PidFile /var/run/apache2.pid
  11. ErrorLog logs/error_log
  12. LogLevel warn
  13. DocumentRoot /var/www/localhost/htdocs


  14. ### Dynamic Shared Object (DSO) Support
  15. ###
  16. ### You should always leave these three, as they are needed for normal use.
  17. ### mod_access (Order, Allow, etc..)
  18. ### mod_log_config (Transferlog, etc..)
  19. ### mod_mime (AddType, etc...)
  20. ###
  21. LoadModule access_module                 modules/mod_access.so
  22. LoadModule auth_module                   modules/mod_auth.so
  23. LoadModule auth_anon_module              modules/mod_auth_anon.so
  24. LoadModule auth_dbm_module               modules/mod_auth_dbm.so
  25. LoadModule auth_digest_module            modules/mod_auth_digest.so
  26. LoadModule include_module                modules/mod_include.so
  27. LoadModule log_config_module             modules/mod_log_config.so
  28. LoadModule env_module                    modules/mod_env.so
  29. LoadModule mime_magic_module             modules/mod_mime_magic.so
  30. LoadModule cern_meta_module              modules/mod_cern_meta.so
  31. LoadModule expires_module                modules/mod_expires.so
  32. LoadModule headers_module                modules/mod_headers.so
  33. LoadModule usertrack_module              modules/mod_usertrack.so
  34. LoadModule unique_id_module              modules/mod_unique_id.so
  35. LoadModule setenvif_module               modules/mod_setenvif.so
  36. LoadModule proxy_module                  modules/mod_proxy.so
  37. LoadModule proxy_connect_module          modules/mod_proxy_connect.so
  38. LoadModule proxy_ftp_module              modules/mod_proxy_ftp.so
  39. LoadModule proxy_http_module                 modules/mod_proxy_http.so
  40. LoadModule mime_module                   modules/mod_mime.so
  41. LoadModule status_module                 modules/mod_status.so
  42. LoadModule autoindex_module              modules/mod_autoindex.so
  43. LoadModule asis_module                   modules/mod_asis.so
  44. LoadModule info_module                   modules/mod_info.so
  45. LoadModule cgi_module                    modules/mod_cgi.so
  46. LoadModule cgid_module                   modules/mod_cgid.so
  47. LoadModule vhost_alias_module                 modules/mod_vhost_alias.so
  48. LoadModule negotiation_module            modules/mod_negotiation.so
  49. LoadModule dir_module                    modules/mod_dir.so
  50. LoadModule imap_module                   modules/mod_imap.so
  51. LoadModule actions_module                modules/mod_actions.so
  52. LoadModule speling_module                modules/mod_speling.so
  53. LoadModule userdir_module                modules/mod_userdir.so
  54. LoadModule alias_module                  modules/mod_alias.so
  55. LoadModule rewrite_module                modules/mod_rewrite.so

  56. ###
  57. ### New Modules for 2.0 (some are experimental)
  58. ###
  59. LoadModule file_cache_module             modules/mod_file_cache.so
  60. LoadModule echo_module                   modules/mod_echo.so
  61. LoadModule charset_lite_module           modules/mod_charset_lite.so
  62. LoadModule cache_module                  modules/mod_cache.so
  63. LoadModule disk_cache_module             modules/mod_disk_cache.so
  64. LoadModule mem_cache_module              modules/mod_mem_cache.so
  65. LoadModule ext_filter_module             modules/mod_ext_filter.so
  66. LoadModule case_filter_module            modules/mod_case_filter.so
  67. LoadModule case_filter_in_module         modules/mod_case_filter_in.so
  68. LoadModule deflate_module                modules/mod_deflate.so
  69. #LoadModule optional_hook_export_module   modules/mod_optional_hook_export.so
  70. #LoadModule optional_hook_import_module   modules/mod_optional_hook_import.so
  71. #LoadModule optional_fn_import_module     modules/mod_optional_fn_import.so
  72. #LoadModule optional_fn_export_module     modules/mod_optional_fn_export.so
  73. #LoadModule bucketeer_module              modules/mod_bucketeer.so
  74. LoadModule logio_module                  modules/mod_logio.so

  75. ###
  76. ### Global Configuration
  77. ###
  78. # Splitting up apache2.conf into two files makes it easier to support
  79. # multiple configurations on the same serer.  In commonapache2.conf
  80. # you keep directives that apply to all implementations and in this
  81. # file you keep server-specific directives.  While we don't yet have
  82. # multiple configurations out-of-the-box, this allows us to do that
  83. # in the future easily.  (PERLPROXIED *ahem*)
  84. #
  85. # For Apache2 we load all conf files in conf/modules.d
  86. Include conf/modules.d/*.conf
  87. Include conf/commonapache2.conf

  88. ###
  89. ### IP Address/Port
  90. ###
  91. #BindAddress *
  92. Listen 80

  93. ###
  94. ### Log configuration Section
  95. ###
  96. <IfModule mod_log_config.c>
  97. #Single logfile with access, agent and referer information
  98. #This is the default, if vlogs are not defined for the main server
  99. CustomLog logs/access_log combined env=!VLOG
  100. #If VLOG is defined in conf/vhosts/vhosts.conf, we use this entry
  101. #CustomLog "|/usr/sbin/apache2splitlogfile" vhost env=VLOG
  102. </IfModule>

  103. ###
  104. ### Virtual Hosts
  105. ###
  106. # We include different templates for Virtual Hosting. Have a look in the
  107. # vhosts directory and modify to suit your needs.
  108. #Include conf/vhosts/vhosts.conf
  109. #Include conf/vhosts/dynamic-vhosts.conf
  110. #Include conf/vhosts/virtual-homepages.conf

  111. ###
  112. ### Performance settings Section
  113. ###
  114. #
  115. # Timeout: The number of seconds before receives and sends time out.
  116. #
  117. Timeout 300

  118. #
  119. # KeepAlive: Whether or not to allow persistent connections (more than
  120. # one request per connection). Set to "Off" to deactivate.
  121. #
  122. KeepAlive On

  123. #
  124. # MaxKeepAliveRequests: The maximum number of requests to allow
  125. # during a persistent connection. Set to 0 to allow an unlimited amount.
  126. # We recommend you leave this number high, for maximum performance.
  127. #
  128. MaxKeepAliveRequests 100

  129. #
  130. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  131. # same client on the same connection.
  132. #
  133. KeepAliveTimeout 15

  134. # prefork MPM [THIS IS THE DEFAULT]
  135. # StartServers: number of server processes to start
  136. # MinSpareServers: minimum number of server processes which are kept spare
  137. # MaxSpareServers: maximum number of server processes which are kept spare
  138. # MaxClients: maximum number of server processes allowed to start
  139. # MaxRequestsPerChild: maximum number of requests a server process serves
  140. <IfModule prefork.c>
  141. StartServers         5
  142. MinSpareServers      5
  143. MaxSpareServers     10
  144. MaxClients         150
  145. MaxRequestsPerChild  0
  146. </IfModule>

  147. # worker MPM
  148. # StartServers: initial number of server processes to start
  149. # MaxClients: maximum number of simultaneous client connections
  150. # MinSpareThreads: minimum number of worker threads which are kept spare
  151. # MaxSpareThreads: maximum number of worker threads which are kept spare
  152. # ThreadsPerChild: constant number of worker threads in each server process
  153. # MaxRequestsPerChild: maximum number of requests a server process serves
  154. <IfModule worker.c>
  155. StartServers         2
  156. MaxClients         150
  157. MinSpareThreads     25
  158. MaxSpareThreads     75
  159. ThreadsPerChild     25
  160. MaxRequestsPerChild  0
  161. </IfModule>

  162. # perchild MPM
  163. # NumServers: constant number of server processes
  164. # StartThreads: initial number of worker threads in each server process
  165. # MinSpareThreads: minimum number of worker threads which are kept spare
  166. # MaxSpareThreads: maximum number of worker threads which are kept spare
  167. # MaxThreadsPerChild: maximum number of worker threads in each server process
  168. # MaxRequestsPerChild: maximum number of connections per server process
  169. <IfModule perchild.c>
  170. NumServers           5
  171. StartThreads         5
  172. MinSpareThreads      5
  173. MaxSpareThreads     10
  174. MaxThreadsPerChild  20
  175. MaxRequestsPerChild  0
  176. </IfModule>
复制代码
回复 支持 反对

使用道具 举报

发表于 2005-2-23 13:04:39 | 显示全部楼层
Post by Master
在gentoo下安装好apache后,
/etc/init.d/apache2 start
* Starting apache2...
(2)No such file or directory: apache2: could not open error log file /usr/lib/apache2/logs/error_log.
Unable to open logs   
而我却找不到error_log这个文件,logs只是一个连接文件
ls -l
total 2
drwxr-xr-x  2 root root  400 Feb 21 23:04 build
lrwxrwxrwx  1 root root   17 Feb 21 23:04 conf -> /etc/apache2/conf
lrwxrwxrwx  1 root root   29 Feb 21 23:04 extramodules -> /usr/lib/apache2-extramodules
lrwxrwxrwx  1 root root    8 Feb 21 23:04 lib -> /usr/lib
lrwxrwxrwx  1 root root   16 Feb 21 23:04 logs -> /var/log/apache2
drwxr-xr-x  2 root root 1752 Feb 21 23:04 modules
是哪里出错了?



需要手工建立一個error_log文件的,ls -l看下/usr/lib/apache2/logs/error_log這個文件的link,然後根據它?斫⒕秃昧 ;)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-23 17:38:02 | 显示全部楼层
问题已解决!谢谢Jwing
在/var/log/下建目录apache2,再在此目录下建error_log就可以了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-5-11 23:03:10 | 显示全部楼层
[Wed May 11 22:56:24 2005] [crit] (38)Function not implemented: mod_rewrite: could not create rewrite_log_lock
Configuration Failed

不知道什么原因,apache升级了一下之后,就无法启动了。而日志里有这样一条,本人不大明白,谁能解释一下吗?应该怎么去解决?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表