LinuxSir.cn,穿越时空的Linuxsir!

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

LAMP本地测试一切正常 但局域网内其他机器无法通过其IP访问

[复制链接]
发表于 2006-10-2 18:13:17 | 显示全部楼层 |阅读模式
在本机使用localhost,127.0.0.1,192.168.10.18都能访问,为什么局域网内机器无法访问它?

apache2.conf如下

  1. # Based upon the NCSA server configuration files originally by Rob McCool.
  2. # Changed extensively for the Debian package by Daniel Stone <daniel@sfarc.net>
  3. # and also by Thom May <thom@debian.org>.

  4. # ServerRoot: The top of the directory tree under which the server's
  5. # configuration, error, and log files are kept.
  6. #
  7. ServerName forumedia
  8. # NOTE!  If you intend to place this on an NFS (or otherwise network)
  9. # mounted filesystem then please read the LockFile documentation
  10. # (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
  11. # you will save yourself a lot of trouble.

  12. ServerRoot "/etc/apache2"

  13. # The LockFile directive sets the path to the lockfile used when Apache
  14. # is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
  15. # USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
  16. # its default value. The main reason for changing it is if the logs
  17. # directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
  18. # DISK. The PID of the main server process is automatically appended to
  19. # the filename.

  20. LockFile /var/lock/apache2/accept.lock

  21. # PidFile: The file in which the server should record its process
  22. # identification number when it starts.

  23. PidFile /var/run/apache2.pid

  24. # Timeout: The number of seconds before receives and sends time out.

  25. Timeout 300

  26. # KeepAlive: Whether or not to allow persistent connections (more than
  27. # one request per connection). Set to "Off" to deactivate.

  28. KeepAlive On

  29. # MaxKeepAliveRequests: The maximum number of requests to allow
  30. # during a persistent connection. Set to 0 to allow an unlimited amount.
  31. # We recommend you leave this number high, for maximum performance.

  32. MaxKeepAliveRequests 100

  33. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  34. # same client on the same connection.

  35. KeepAliveTimeout 15

  36. ##
  37. ## Server-Pool Size Regulation (MPM specific)
  38. ##

  39. # prefork MPM
  40. # StartServers ......... number of server processes to start
  41. # MinSpareServers ...... minimum number of server processes which are kept spare
  42. # MaxSpareServers ...... maximum number of server processes which are kept spare
  43. # MaxClients ........... maximum number of server processes allowed to start
  44. # MaxRequestsPerChild .. maximum number of requests a server process serves
  45. <IfModule prefork.c>
  46. StartServers         5
  47. MinSpareServers      5
  48. MaxSpareServers     10
  49. MaxClients          20
  50. MaxRequestsPerChild  0
  51. </IfModule>

  52. # pthread MPM
  53. # StartServers ......... initial  number of server processes to start
  54. # MaxClients ........... maximum  number of server processes allowed to start
  55. # MinSpareThreads ...... minimum  number of worker threads which are kept spare
  56. # MaxSpareThreads ...... maximum  number of worker threads which are kept spare
  57. # ThreadsPerChild ...... constant number of worker threads in each server process
  58. # MaxRequestsPerChild .. maximum  number of requests a server process serves
  59. <IfModule worker.c>
  60. StartServers         2
  61. MaxClients         150
  62. MinSpareThreads     25
  63. MaxSpareThreads     75
  64. ThreadsPerChild     25
  65. MaxRequestsPerChild  0
  66. </IfModule>

  67. # perchild MPM
  68. # NumServers ........... constant number of server processes
  69. # StartThreads ......... initial  number of worker threads in each server process
  70. # MinSpareThreads ...... minimum  number of worker threads which are kept spare
  71. # MaxSpareThreads ...... maximum  number of worker threads which are kept spare
  72. # MaxThreadsPerChild ... maximum  number of worker threads in each server process
  73. # MaxRequestsPerChild .. maximum  number of connections per server process (then it dies)
  74. <IfModule perchild.c>
  75. NumServers           5
  76. StartThreads         5
  77. MinSpareThreads      5
  78. MaxSpareThreads     10
  79. MaxThreadsPerChild  20
  80. MaxRequestsPerChild  0
  81. AcceptMutex fcntl
  82. </IfModule>

  83. User www-data
  84. Group www-data

  85. # The following directives define some format nicknames for use with
  86. # a CustomLog directive (see below).
  87. LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
  88. LogFormat "%h %l %u %t "%r" %>s %b" common
  89. LogFormat "%{Referer}i -> %U" referer
  90. LogFormat "%{User-agent}i" agent


  91. # Global error log.
  92. ErrorLog /var/log/apache2/error.log

  93. # Include module configuration:
  94. Include /etc/apache2/mods-enabled/*.load
  95. Include /etc/apache2/mods-enabled/*.conf

  96. # Include all the user configurations:
  97. Include /etc/apache2/httpd.conf

  98. # Include ports listing
  99. Include /etc/apache2/ports.conf

  100. # Include generic snippets of statements
  101. Include /etc/apache2/conf.d/[^.#]*

  102. #Let's have some Icons, shall we?
  103. Alias /icons/ "/usr/share/apache2/icons/"
  104. <Directory "/usr/share/apache2/icons">
  105.     Options Indexes MultiViews
  106.     AllowOverride None
  107.     Order allow,deny
  108.     Allow from all
  109. </Directory>

  110. # Set up the default error docs.
  111. #
  112. # Customizable error responses come in three flavors:
  113. # 1) plain text 2) local redirects 3) external redirects
  114. #
  115. # Some examples:
  116. #ErrorDocument 500 "The server made a boo boo."
  117. #ErrorDocument 404 /missing.html
  118. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  119. #ErrorDocument 402 [url]http://www.example.com/subscription_info.html[/url]
  120. #

  121. #
  122. # Putting this all together, we can Internationalize error responses.
  123. #
  124. # We use Alias to redirect any /error/HTTP_<error>.html.var response to
  125. # our collection of by-error message multi-language collections.  We use
  126. # includes to substitute the appropriate text.
  127. #
  128. # You can modify the messages' appearance without changing any of the
  129. # default HTTP_<error>.html.var files by adding the line;
  130. #
  131. #   Alias /error/include/ "/your/include/path/"
  132. #
  133. # which allows you to create your own set of files by starting with the
  134. # /usr/local/apache2/error/include/ files and
  135. # copying them to /your/include/path/, even on a per-VirtualHost basis.
  136. #

  137. <IfModule mod_negotiation.c>
  138. <IfModule mod_include.c>
  139.     Alias /error/ "/usr/share/apache2/error/"

  140.     <Directory "/usr/share/apache2/error">
  141.         AllowOverride None
  142.         Options IncludesNoExec
  143.         AddOutputFilter Includes html
  144.         AddHandler type-map var
  145.         Order allow,deny
  146.         Allow from all
  147.         LanguagePriority en es de fr
  148.         ForceLanguagePriority Prefer Fallback
  149.     </Directory>

  150.     ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
  151.     ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
  152.     ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
  153.     ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
  154.     ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
  155.     ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
  156.     ErrorDocument 410 /error/HTTP_GONE.html.var
  157.     ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
  158.     ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
  159.     ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
  160.     ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
  161.     ErrorDocument 415 /error/HTTP_SERVICE_UNAVAILABLE.html.var
  162.     ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
  163.     ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
  164.     ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
  165.     ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
  166.     ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var

  167. </IfModule>
  168. </IfModule>

  169. DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

  170. # UserDir is now a module
  171. #UserDir public_html
  172. #UserDir disabled root

  173. #<Directory /home/*/public_html>
  174. #        AllowOverride FileInfo AuthConfig Limit
  175. #        Options Indexes SymLinksIfOwnerMatch IncludesNoExec
  176. #</Directory>

  177. AccessFileName .htaccess

  178. <Files ~ "^\.ht">
  179.     Order allow,deny
  180.     Deny from all
  181. </Files>

  182. UseCanonicalName Off

  183. TypesConfig /etc/mime.types
  184. DefaultType text/plain

  185. HostnameLookups Off

  186. IndexOptions FancyIndexing VersionSort

  187. AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

  188. AddIconByType (TXT,/icons/text.gif) text/*
  189. AddIconByType (IMG,/icons/image2.gif) image/*
  190. AddIconByType (SND,/icons/sound2.gif) audio/*
  191. AddIconByType (VID,/icons/movie.gif) video/*

  192. # This really should be .jpg.

  193. AddIcon /icons/binary.gif .bin .exe
  194. AddIcon /icons/binhex.gif .hqx
  195. AddIcon /icons/tar.gif .tar
  196. AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
  197. AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
  198. AddIcon /icons/a.gif .ps .ai .eps
  199. AddIcon /icons/layout.gif .html .shtml .htm .pdf
  200. AddIcon /icons/text.gif .txt
  201. AddIcon /icons/c.gif .c
  202. AddIcon /icons/p.gif .pl .py
  203. AddIcon /icons/f.gif .for
  204. AddIcon /icons/dvi.gif .dvi
  205. AddIcon /icons/uuencoded.gif .uu
  206. AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
  207. AddIcon /icons/tex.gif .tex
  208. AddIcon /icons/bomb.gif core

  209. AddIcon /icons/back.gif ..
  210. AddIcon /icons/hand.right.gif README
  211. AddIcon /icons/folder.gif ^^DIRECTORY^^
  212. AddIcon /icons/blank.gif ^^BLANKICON^^


  213. # This is from Matty J's patch. Anyone want to make the icons?
  214. #AddIcon /icons/dirsymlink.jpg ^^SYMDIR^^
  215. #AddIcon /icons/symlink.jpg ^^SYMLINK^^

  216. DefaultIcon /icons/unknown.gif

  217. ReadmeName README.html
  218. HeaderName HEADER.html

  219. IndexIgnore .??* *~ *# HEADER* RCS CVS *,t

  220. AddEncoding x-compress Z
  221. AddEncoding x-gzip gz tgz

  222. AddLanguage da .dk
  223. AddLanguage nl .nl
  224. AddLanguage en .en
  225. AddLanguage et .et
  226. AddLanguage fr .fr
  227. AddLanguage de .de
  228. AddLanguage el .el
  229. AddLanguage it .it
  230. AddLanguage ja .ja
  231. AddLanguage pl .po
  232. AddLanguage ko .ko
  233. AddLanguage pt .pt
  234. AddLanguage no .no
  235. AddLanguage pt-br .pt-br
  236. AddLanguage ltz .ltz
  237. AddLanguage ca .ca
  238. AddLanguage es .es
  239. AddLanguage sv .se
  240. AddLanguage cz .cz
  241. AddLanguage ru .ru
  242. AddLanguage tw .tw
  243. AddLanguage zh-tw .tw

  244. LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw


  245. #AddDefaultCharset        ISO-8859-1

  246. AddCharset ISO-8859-1  .iso8859-1  .latin1
  247. AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
  248. AddCharset ISO-8859-3  .iso8859-3  .latin3
  249. AddCharset ISO-8859-4  .iso8859-4  .latin4
  250. AddCharset ISO-8859-5  .iso8859-5  .latin5 .cyr .iso-ru
  251. AddCharset ISO-8859-6  .iso8859-6  .latin6 .arb
  252. AddCharset ISO-8859-7  .iso8859-7  .latin7 .grk
  253. AddCharset ISO-8859-8  .iso8859-8  .latin8 .heb       
  254. AddCharset ISO-8859-9  .iso8859-9  .latin9 .trk
  255. AddCharset ISO-2022-JP .iso2022-jp .jis
  256. AddCharset ISO-2022-KR .iso2022-kr .kis
  257. AddCharset ISO-2022-CN .iso2022-cn .cis
  258. AddCharset Big5        .Big5       .big5
  259. # For russian, more than one charset is used (depends on client, mostly):
  260. AddCharset WINDOWS-1251 .cp-1251   .win-1251
  261. AddCharset CP866       .cp866
  262. AddCharset KOI8-r      .koi8-r .koi8-ru
  263. AddCharset KOI8-ru     .koi8-uk .ua
  264. AddCharset ISO-10646-UCS-2 .ucs2
  265. AddCharset ISO-10646-UCS-4 .ucs4
  266. AddCharset UTF-8       .utf8

  267. AddCharset GB2312      .gb2312 .gb
  268. AddCharset utf-7       .utf7
  269. AddCharset utf-8       .utf8
  270. AddCharset big5               .big5 .b5
  271. AddCharset EUC-TW      .euc-tw       
  272. AddCharset EUC-JP      .euc-jp
  273. AddCharset EUC-KR      .euc-kr
  274. AddCharset shift_jis   .sjis

  275. #AddType application/x-httpd-php .php
  276. #AddType application/x-httpd-php-source .phps

  277. AddType application/x-tar .tgz

  278. # To use CGI scripts outside /cgi-bin/:
  279. #
  280. AddHandler cgi-script .cgi

  281. # To use server-parsed HTML files
  282. #
  283. <FilesMatch "\.shtml(\..+)?$">
  284.     SetOutputFilter INCLUDES
  285. </FilesMatch>

  286. # If you wish to use server-parsed imagemap files, use
  287. #
  288. #AddHandler imap-file map

  289. BrowserMatch "Mozilla/2" nokeepalive
  290. BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
  291. BrowserMatch "RealPlayer 4\.0" force-response-1.0
  292. BrowserMatch "Java/1\.0" force-response-1.0
  293. BrowserMatch "JDK/1\.0" force-response-1.0

  294. #
  295. # The following directive disables redirects on non-GET requests for
  296. # a directory that does not include the trailing slash.  This fixes a
  297. # problem with Microsoft WebFolders which does not appropriately handle
  298. # redirects for folders with DAV methods.
  299. #

  300. BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
  301. BrowserMatch "^WebDrive" redirect-carefully
  302. BrowserMatch "^gnome-vfs" redirect-carefully
  303. BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully

  304. # Allow server status reports, with the URL of [url]http://servername/server-status[/url]
  305. # Change the ".your_domain.com" to match your domain to enable.
  306. #
  307. #<Location /server-status>
  308. #    SetHandler server-status
  309. #    Order deny,allow
  310. #    Deny from all
  311. #    Allow from .your_domain.com
  312. #</Location>

  313. # Allow remote server configuration reports, with the URL of
  314. #  [url]http://servername/server-info[/url] (requires that mod_info.c be loaded).
  315. # Change the ".your_domain.com" to match your domain to enable.
  316. #
  317. #<Location /server-info>
  318. #    SetHandler server-info
  319. #    Order deny,allow
  320. #    Deny from all
  321. #    Allow from .your_domain.com
  322. #</Location>

  323. # Include the virtual host configurations:
  324. Include /etc/apache2/sites-enabled/[^.#]*

复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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