Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 谁给配置一下 httpd.conf 文件?

[复制链接]
论坛的新主人 发表于 2007-2-13 19:50:22 | 显示全部楼层 |阅读模式
配置成如:    abc.net 可以从互联网可以访问的,谢谢了

  1. NameVirtualHost *:80

  2. <VirtualHost *>
  3.     DocumentRoot /null
  4. </VirtualHost>

  5. <VirtualHost 127.0.0.1>
  6. ### 主机名 ###
  7. ServerName localhost
  8. ServerAlias 192.168.0.1

  9. ### 重写规则 ###
  10. <IfModule mod_rewrite.c>
  11.    RewriteEngine On
  12.    RewriteRule ^(.*)/htm/(.*)$ $1.php?$2
  13.    RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2
  14. </IfModule>
  15. ### 文档路径 ###
  16. DocumentRoot /usr/www

  17. ### PHP 读写限制 ###
  18. php_admin_value open_basedir /usr/www

  19. ### 文档路径权限定义 ###
  20. <Directory "/usr/www">
  21.     Options Indexes FollowSymLinks MultiViews
  22.     AllowOverride All
  23.     Order allow,deny
  24.     Allow from all
  25. </Directory>

  26. </VirtualHost>
复制代码
 楼主| 论坛的新主人 发表于 2007-2-13 19:51:22 | 显示全部楼层
来帮兄弟一把
回复

使用道具 举报

索克 发表于 2007-2-13 20:07:57 | 显示全部楼层
看一下这篇,我就是照着做的

http://www.uplinux.com/download/ ... sts/name-based.html
回复

使用道具 举报

 楼主| 论坛的新主人 发表于 2007-2-13 20:11:12 | 显示全部楼层
多谢,学学去
回复

使用道具 举报

 楼主| 论坛的新主人 发表于 2007-2-13 20:13:27 | 显示全部楼层
也就是说,将上面的内容替换成:

NameVirtualHost *

<VirtualHost *>

ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain

</VirtualHost>

<VirtualHost *>

ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain

</VirtualHost>
回复

使用道具 举报

 楼主| 论坛的新主人 发表于 2007-2-13 20:17:35 | 显示全部楼层

改一下这个文件

  1. #
  2. # Based upon the NCSA server configuration files originally by Rob McCool.
  3. #
  4. # This is the main Apache server configuration file.  It contains the
  5. # configuration directives that give the server its instructions.
  6. # See <URL:http://httpd.apache.org/docs/> for detailed information about
  7. # the directives.
  8. #
  9. # Do NOT simply read the instructions in here without understanding
  10. # what they do.  They're here only as hints or reminders.  If you are unsure
  11. # consult the online docs. You have been warned.  
  12. #
  13. # After this file is processed, the server will look for and process
  14. # /usr/local/Apache/conf/srm.conf and then /usr/local/Apache/conf/access.conf
  15. # unless you have overridden these with ResourceConfig and/or
  16. # AccessConfig directives here.
  17. #
  18. # The configuration directives are grouped into three basic sections:
  19. #  1. Directives that control the operation of the Apache server process as a
  20. #     whole (the 'global environment').
  21. #  2. Directives that define the parameters of the 'main' or 'default' server,
  22. #     which responds to requests that aren't handled by a virtual host.
  23. #     These directives also provide default values for the settings
  24. #     of all virtual hosts.
  25. #  3. Settings for virtual hosts, which allow Web requests to be sent to
  26. #     different IP addresses or hostnames and have them handled by the
  27. #     same Apache server process.
  28. #
  29. # Configuration and logfile names: If the filenames you specify for many
  30. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  31. # server will use that explicit path.  If the filenames do *not* begin
  32. # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
  33. # with ServerRoot set to "/usr/local/apache" will be interpreted by the
  34. # server as "/usr/local/apache/logs/foo.log".
  35. #
  36. # NOTE: Where filenames are specified, you must use forward slashes
  37. # instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
  38. # If a drive letter is omitted, the drive on which Apache.exe is located
  39. # will be used by default.  It is recommended that you always supply
  40. # an explicit drive letter in absolute paths, however, to avoid
  41. # confusion.
  42. #

  43. ### Section 1: Global Environment
  44. #
  45. # The directives in this section affect the overall operation of Apache,
  46. # such as the number of concurrent requests it can handle or where it
  47. # can find its configuration files.
  48. #

  49. #
  50. # ServerType is either inetd, or standalone.  Inetd mode is only supported on
  51. # Unix platforms.
  52. #
  53. ServerType standalone

  54. #
  55. # ServerRoot: The top of the directory tree under which the server's
  56. # configuration, error, and log files are kept.
  57. #
  58. ServerRoot "/usr/local/Apache"

  59. #
  60. # PidFile: The file in which the server should record its process
  61. # identification number when it starts.
  62. #
  63. PidFile logs/httpd.pid

  64. #
  65. # ScoreBoardFile: File used to store internal server process information.
  66. # Not all architectures require this.  But if yours does (you'll know because
  67. # this file will be  created when you run Apache) then you *must* ensure that
  68. # no two invocations of Apache share the same scoreboard file.
  69. #
  70. ScoreBoardFile logs/apache_runtime_status

  71. #
  72. # In the standard configuration, the server will process httpd.conf (this
  73. # file, specified by the -f command line option), srm.conf, and access.conf
  74. # in that order.  The latter two files are now distributed empty, as it is
  75. # recommended that all directives be kept in a single file for simplicity.  
  76. # The commented-out values below are the built-in defaults.  You can have the
  77. # server ignore these files altogether by using "/dev/null" (for Unix) or
  78. # "nul" (for Win32) for the arguments to the directives.
  79. #
  80. #ResourceConfig conf/srm.conf
  81. #AccessConfig conf/access.conf

  82. #
  83. # Timeout: The number of seconds before receives and sends time out.
  84. #
  85. Timeout 300

  86. #
  87. # KeepAlive: Whether or not to allow persistent connections (more than
  88. # one request per connection). Set to "Off" to deactivate.
  89. #
  90. KeepAlive Off

  91. #
  92. # MaxKeepAliveRequests: The maximum number of requests to allow
  93. # during a persistent connection. Set to 0 to allow an unlimited amount.
  94. # We recommend you leave this number high, for maximum performance.
  95. #
  96. MaxKeepAliveRequests 100

  97. #
  98. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  99. # same client on the same connection.
  100. #
  101. KeepAliveTimeout 15

  102. #
  103. # Apache on Win32 always creates one child process to handle requests.  If it
  104. # dies, another child process is created automatically.  Within the child
  105. # process multiple threads handle incoming requests.  The next two
  106. # directives control the behaviour of the threads and processes.
  107. #
  108. MaxClients         256
  109. #
  110. # MaxRequestsPerChild: the number of requests each child process is
  111. # allowed to process before the child dies.  The child will exit so
  112. # as to avoid problems after prolonged use when Apache (and maybe the
  113. # libraries it uses) leak memory or other resources.  On most systems, this
  114. # isn't really needed, but a few (such as Solaris) do have notable leaks
  115. # in the libraries.  For Win32, set this value to zero (unlimited)
  116. # unless advised otherwise.
  117. #
  118. # NOTE: This value does not include keepalive requests after the initial
  119. #       request per connection. For example, if a child process handles
  120. #       an initial request and 10 subsequent "keptalive" requests, it
  121. #       would only count as 1 request towards this limit.
  122. #
  123. MaxRequestsPerChild 0

  124. #
  125. # Number of concurrent threads (i.e., requests) the server will allow.
  126. # Set this value according to the responsiveness of the server (more
  127. # requests active at once means they're all handled more slowly) and
  128. # the amount of system resources you'll allow the server to consume.
  129. #
  130. ThreadsPerChild 50

  131. #
  132. # Listen: Allows you to bind Apache to specific IP addresses and/or
  133. # ports, instead of the default. See also the <VirtualHost>
  134. # directive.
  135. #
  136. #Listen 3000
  137. #Listen 12.34.56.78:80

  138. #
  139. # BindAddress: You can support virtual hosts with this option. This directive
  140. # is used to tell the server which IP address to listen to. It can either
  141. # contain "*", an IP address, or a fully qualified Internet domain name.
  142. # See also the <VirtualHost> and Listen directives.
  143. #
  144. #BindAddress *

  145. #
  146. # Dynamic Shared Object (DSO) Support
  147. #
  148. # To be able to use the functionality of a module which was built as a DSO you
  149. # have to place corresponding `LoadModule' lines at this location so the
  150. # directives contained in it are actually available _before_ they are used.
  151. # Please read the file README.DSO in the Apache 1.3 distribution for more
  152. # details about the DSO mechanism and run `apache -l' for the list of already
  153. # built-in (statically linked and thus always available) modules in your Apache
  154. # binary.
  155. #
  156. # Note: The order in which modules are loaded is important.  Don't change
  157. # the order below without expert advice.
  158. #
  159. # Example:
  160. # LoadModule foo_module modules/mod_foo.so
  161. #
  162. #LoadModule vhost_alias_module modules/mod_vhost_alias.so
  163. #LoadModule mime_magic_module modules/mod_mime_magic.so
  164. #LoadModule status_module modules/mod_status.so
  165. #LoadModule info_module modules/mod_info.so
  166. #LoadModule speling_module modules/mod_speling.so
  167. LoadModule rewrite_module modules/mod_rewrite.so
  168. #LoadModule anon_auth_module modules/mod_auth_anon.so
  169. #LoadModule dbm_auth_module modules/mod_auth_dbm.so
  170. #LoadModule digest_auth_module modules/mod_auth_digest.so
  171. #LoadModule digest_module modules/mod_digest.so
  172. #LoadModule proxy_module modules/mod_proxy.so
  173. #LoadModule cern_meta_module modules/mod_cern_meta.so
  174. #LoadModule expires_module modules/mod_expires.so
  175. #LoadModule headers_module modules/mod_headers.so
  176. #LoadModule usertrack_module modules/mod_usertrack.so
  177. #LoadModule unique_id_module modules/mod_unique_id.so
  178. LoadModule php4_module "/usr/local/php/sapi/php4apache.dll"

  179. #
  180. #  Reconstruction of the complete module list from all available modules
  181. #  (static and shared ones) to achieve correct module execution order.
  182. #
  183. # The modules listed below, without a corresponding LoadModule directive,
  184. # are static bound into the standard Apache binary distribution for Windows.
  185. #
  186. # Note: The order in which modules are loaded is important.  Don't change
  187. # the order below without expert advice.
  188. #
  189. # [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE, UPDATE THIS TOO!]
  190. ClearModuleList
  191. #AddModule mod_vhost_alias.c
  192. AddModule mod_env.c
  193. AddModule mod_log_config.c
  194. #AddModule mod_mime_magic.c
  195. AddModule mod_mime.c
  196. AddModule mod_negotiation.c
  197. #AddModule mod_status.c
  198. #AddModule mod_info.c
  199. AddModule mod_include.c
  200. AddModule mod_autoindex.c
  201. AddModule mod_dir.c
  202. AddModule mod_isapi.c
  203. AddModule mod_cgi.c
  204. AddModule mod_asis.c
  205. AddModule mod_imap.c
  206. AddModule mod_actions.c
  207. #AddModule mod_speling.c
  208. AddModule mod_userdir.c
  209. AddModule mod_alias.c
  210. AddModule mod_rewrite.c
  211. AddModule mod_access.c
  212. AddModule mod_auth.c
  213. #AddModule mod_auth_anon.c
  214. #AddModule mod_auth_dbm.c
  215. #AddModule mod_auth_digest.c
  216. #AddModule mod_digest.c
  217. #AddModule mod_proxy.c
  218. #AddModule mod_cern_meta.c
  219. #AddModule mod_expires.c
  220. #AddModule mod_headers.c
  221. #AddModule mod_usertrack.c
  222. #AddModule mod_unique_id.c
  223. AddModule mod_so.c
  224. AddModule mod_setenvif.c
  225. AddModule mod_php4.c

  226. #
  227. # ExtendedStatus controls whether Apache will generate "full" status
  228. # information (ExtendedStatus On) or just basic information (ExtendedStatus
  229. # Off) when the "server-status" handler is called. The default is Off.
  230. #
  231. #ExtendedStatus On

  232. ### Section 2: 'Main' server configuration
  233. #
  234. # The directives in this section set up the values used by the 'main'
  235. # server, which responds to any requests that aren't handled by a
  236. # <VirtualHost> definition.  These values also provide defaults for
  237. # any <VirtualHost> containers you may define later in the file.
  238. #
  239. # All of these directives may appear inside <VirtualHost> containers,
  240. # in which case these default settings will be overridden for the
  241. # virtual host being defined.
  242. #

  243. #
  244. # Port: The port to which the standalone server listens.  Certain firewall
  245. # products must be configured before Apache can listen to a specific port.
  246. # Other running httpd servers will also interfere with this port.  Disable
  247. # all firewall, security, and other services if you encounter problems.
  248. # To help diagnose problems use the Windows NT command NETSTAT -a
  249. #
  250. Port 80

  251. #
  252. # ServerAdmin: Your address, where problems with the server should be
  253. # e-mailed.  This address appears on some server-generated pages, such
  254. # as error documents.
  255. #
  256. ServerAdmin none@localhost

  257. #
  258. # ServerName allows you to set a host name which is sent back to clients for
  259. # your server if it's different than the one the program would get (i.e., use
  260. # "www" instead of the host's real name).
  261. #
  262. # Note: You cannot just invent host names and hope they work. The name you
  263. # define here must be a valid DNS name for your host. If you don't understand
  264. # this, ask your network administrator.
  265. # If your host doesn't have a registered DNS name, enter its IP address here.
  266. # You will have to access it by its address (e.g., http://123.45.67.89/)
  267. # anyway, and this will make redirections work in a sensible way.
  268. #
  269. # 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
  270. # machine always knows itself by this address. If you use Apache strictly for
  271. # local testing and development, you may use 127.0.0.1 as the server name.
  272. #
  273. ServerName localhost


  274. #
  275. # DocumentRoot: The directory out of which you will serve your
  276. # documents. By default, all requests are taken from this directory, but
  277. # symbolic links and aliases may be used to point to other locations.
  278. #
  279. DocumentRoot "/usr/www"

  280. #
  281. # Each directory to which Apache has access, can be configured with respect
  282. # to which services and features are allowed and/or disabled in that
  283. # directory (and its subdirectories).
  284. #
  285. # First, we configure the "default" to be a very restrictive set of
  286. # permissions.  
  287. #
  288. <Directory />
  289.     Options FollowSymLinks
  290.     AllowOverride None
  291. </Directory>

  292. #
  293. # Note that from this point forward you must specifically allow
  294. # particular features to be enabled - so if something's not working as
  295. # you might expect, make sure that you have specifically enabled it
  296. # below.
  297. #

  298. #
  299. # This should be changed to whatever you set DocumentRoot to.
  300. #
  301. <Directory "/usr/www">

  302. #
  303. # This may also be "None", "All", or any combination of "Indexes",
  304. # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
  305. #
  306. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  307. # doesn't give it to you.
  308. #
  309.     Options -Indexes FollowSymLinks MultiViews

  310. #
  311. # This controls which options the .htaccess files in directories can
  312. # override. Can also be "All", or any combination of "Options", "FileInfo",
  313. # "AuthConfig", and "Limit"
  314. #
  315.     AllowOverride None

  316. #
  317. # Controls who can get stuff from this server.
  318. #
  319.     Order allow,deny
  320.     Allow from all
  321. </Directory>

  322. #
  323. # UserDir: The name of the directory which is appended onto a user's home
  324. # directory if a ~user request is received.
  325. #
  326. # Under Win32, we do not currently try to determine the home directory of
  327. # a Windows login, so a format such as that below needs to be used.  See
  328. # the UserDir documentation for details.
  329. #
  330. <IfModule mod_userdir.c>
  331.     UserDir "/usr/www/users/"
  332. </IfModule>

  333. #
  334. # Control access to UserDir directories.  The following is an example
  335. # for a site where these directories are restricted to read-only.
  336. #
  337. #<Directory "/usr/www/users">
  338. #    AllowOverride FileInfo AuthConfig Limit
  339. #    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
  340. #    <Limit GET POST OPTIONS PROPFIND>
  341. #        Order allow,deny
  342. #        Allow from all
  343. #    </Limit>
  344. #    <LimitExcept GET POST OPTIONS PROPFIND>
  345. #        Order deny,allow
  346. #        Deny from all
  347. #    </LimitExcept>
  348. #</Directory>

  349. #
  350. # DirectoryIndex: Name of the file or files to use as a pre-written HTML
  351. # directory index.  Separate multiple entries with spaces.
  352. #
  353. <IfModule mod_dir.c>
  354.     DirectoryIndex index.html index.php
  355. </IfModule>

  356. #
  357. # AccessFileName: The name of the file to look for in each directory
  358. # for access control information.
  359. #
  360. AccessFileName .htaccess

  361. #
  362. # The following lines prevent .htaccess files from being viewed by
  363. # Web clients.  Since .htaccess files often contain authorization
  364. # information, access is disallowed for security reasons.  Comment
  365. # these lines out if you want Web visitors to see the contents of
  366. # .htaccess files.  If you change the AccessFileName directive above,
  367. # be sure to make the corresponding changes here.
  368. #
  369. # Also, folks tend to use names such as .htpasswd for password
  370. # files, so this will protect those as well.
  371. #
  372. <Files ~ "^\.ht">
  373.     Order allow,deny
  374.     Deny from all
  375.     Satisfy All
  376. </Files>

  377. #
  378. # CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
  379. # document that was negotiated on the basis of content. This asks proxy
  380. # servers not to cache the document. Uncommenting the following line disables
  381. # this behavior, and proxies will be allowed to cache the documents.
  382. #
  383. #CacheNegotiatedDocs

  384. #
  385. # UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
  386. # Apache needs to construct a self-referencing URL (a URL that refers back
  387. # to the server the response is coming from) it will use ServerName and
  388. # Port to form a "canonical" name.  With this setting off, Apache will
  389. # use the hostname:port that the client supplied, when possible.  This
  390. # also affects SERVER_NAME and SERVER_PORT in CGI scripts.
  391. #
  392. UseCanonicalName On

  393. #
  394. # TypesConfig describes where the mime.types file (or equivalent) is
  395. # to be found.
  396. #
  397. <IfModule mod_mime.c>
  398.     TypesConfig conf/mime.types
  399. </IfModule>

  400. #
  401. # DefaultType is the default MIME type the server will use for a document
  402. # if it cannot otherwise determine one, such as from filename extensions.
  403. # If your server contains mostly text or HTML documents, "text/plain" is
  404. # a good value.  If most of your content is binary, such as applications
  405. # or images, you may want to use "application/octet-stream" instead to
  406. # keep browsers from trying to display binary files as though they are
  407. # text.
  408. #
  409. DefaultType text/plain

  410. #
  411. # The mod_mime_magic module allows the server to use various hints from the
  412. # contents of the file itself to determine its type.  The MIMEMagicFile
  413. # directive tells the module where the hint definitions are located.
  414. # mod_mime_magic is not part of the default server (you have to add
  415. # it yourself with a LoadModule [see the DSO paragraph in the 'Global
  416. # Environment' section], or recompile the server and include mod_mime_magic
  417. # as part of the configuration), so it's enclosed in an <IfModule> container.
  418. # This means that the MIMEMagicFile directive will only be processed if the
  419. # module is part of the server.
  420. #
  421. <IfModule mod_mime_magic.c>
  422.     MIMEMagicFile conf/magic
  423. </IfModule>

  424. #
  425. # HostnameLookups: Log the names of clients or just their IP addresses
  426. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  427. # The default is off because it'd be overall better for the net if people
  428. # had to knowingly turn this feature on, since enabling it means that
  429. # each client request will result in AT LEAST one lookup request to the
  430. # nameserver.
  431. #
  432. HostnameLookups Off

  433. #
  434. # ErrorLog: The location of the error log file.
  435. # If you do not specify an ErrorLog directive within a <VirtualHost>
  436. # container, error messages relating to that virtual host will be
  437. # logged here.  If you *do* define an error logfile for a <VirtualHost>
  438. # container, that host's errors will be logged there and not here.
  439. #
  440. # ErrorLog logs/error.log

  441. #
  442. # LogLevel: Control the number of messages logged to the error.log.
  443. # Possible values include: debug, info, notice, warn, error, crit,
  444. # alert, emerg.
  445. #
  446. LogLevel warn

  447. #
  448. # The following directives define some format nicknames for use with
  449. # a CustomLog directive (see below).
  450. #
  451. LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
  452. LogFormat "%h %l %u %t "%r" %>s %b" common
  453. LogFormat "%{Referer}i -> %U" referer
  454. LogFormat "%{User-agent}i" agent

  455. #
  456. # The location and format of the access logfile (Common Logfile Format).
  457. # If you do not define any access logfiles within a <VirtualHost>
  458. # container, they will be logged here.  Contrariwise, if you *do*
  459. # define per-<VirtualHost> access logfiles, transactions will be
  460. # logged therein and *not* in this file.
  461. #
  462. # CustomLog logs/access.log common

  463. #
  464. # If you would like to have agent and referer logfiles, uncomment the
  465. # following directives.
  466. #
  467. #CustomLog logs/referer.log referer
  468. #CustomLog logs/agent.log agent

  469. #
  470. # If you prefer a single logfile with access, agent, and referer information
  471. # (Combined Logfile Format) you can use the following directive.
  472. #
  473. #CustomLog logs/access.log combined

  474. #
  475. # Optionally add a line containing the server version and virtual host
  476. # name to server-generated pages (error documents, FTP directory listings,
  477. # mod_status and mod_info output etc., but not CGI generated documents).
  478. # Set to "EMail" to also include a mailto: link to the ServerAdmin.
  479. # Set to one of:  On | Off | EMail
  480. #
  481. ServerSignature On

  482. #
  483. # Apache parses all CGI scripts for the shebang line by default.
  484. # This comment line, the first line of the script, consists of the symbols
  485. # pound (#) and exclamation (!) followed by the path of the program that
  486. # can execute this specific script.  For a perl script, with perl.exe in
  487. # the C:\Program Files\Perl directory, the shebang line should be:

  488.    #!c:/program files/perl/perl

  489. # Note you _must_not_ indent the actual shebang line, and it must be the
  490. # first line of the file.  Of course, CGI processing must be enabled by
  491. # the appropriate ScriptAlias or Options ExecCGI directives for the files
  492. # or directory in question.
  493. #
  494. # However, Apache on Windows allows either the Unix behavior above, or can
  495. # use the Registry to match files by extention.  The command to execute
  496. # a file of this type is retrieved from the registry by the same method as
  497. # the Windows Explorer would use to handle double-clicking on a file.
  498. # These script actions can be configured from the Windows Explorer View menu,
  499. # 'Folder Options', and reviewing the 'File Types' tab.  Clicking the Edit
  500. # button allows you to modify the Actions, of which Apache 1.3 attempts to
  501. # perform the 'Open' Action, and failing that it will try the shebang line.
  502. # This behavior is subject to change in Apache release 2.0.
  503. #
  504. # Each mechanism has it's own specific security weaknesses, from the means
  505. # to run a program you didn't intend the website owner to invoke, and the
  506. # best method is a matter of great debate.
  507. #
  508. # To enable the this Windows specific behavior (and therefore -disable- the
  509. # equivilant Unix behavior), uncomment the following directive:
  510. #
  511. #ScriptInterpreterSource registry
  512. #
  513. # The directive above can be placed in individual <Directory> blocks or the
  514. # .htaccess file, with either the 'registry' (Windows behavior) or 'script'
  515. # (Unix behavior) option, and will override this server default option.
  516. #

  517. #
  518. # Aliases: Add here as many aliases as you need (with no limit). The format is
  519. # Alias fakename realname
  520. #
  521. <IfModule mod_alias.c>

  522.     #
  523.     # Note that if you include a trailing / on fakename then the server will
  524.     # require it to be present in the URL.  So "/icons" isn't aliased in this
  525.     # example, only "/icons/".  If the fakename is slash-terminated, then the
  526.     # realname must also be slash terminated, and if the fakename omits the
  527.     # trailing slash, the realname must also omit it.
  528.     #
  529.     Alias /icons/ "/usr/local/Apache/icons/"

  530.     <Directory "/usr/local/Apache/icons">
  531.         Options Indexes MultiViews
  532.         AllowOverride None
  533.         Order allow,deny
  534.         Allow from all
  535.     </Directory>

  536.     # This Alias will project the on-line documentation tree under /manual/
  537.     # even if you change the DocumentRoot. Comment it if you don't want to
  538.     # provide access to the on-line documentation.
  539.     #
  540.     #Alias /manual/ "/usr/local/Apache/htdocs/manual/"

  541.     #<Directory "/usr/local/Apache/htdocs/manual">
  542.     #    Options Indexes FollowSymlinks MultiViews
  543.     #    AllowOverride None
  544.     #    Order allow,deny
  545.     #    Allow from all
  546.     #</Directory>

  547.     #
  548.     # ScriptAlias: This controls which directories contain server scripts.
  549.     # ScriptAliases are essentially the same as Aliases, except that
  550.     # documents in the realname directory are treated as applications and
  551.     # run by the server when requested rather than as documents sent to the client.
  552.     # The same rules about trailing "/" apply to ScriptAlias directives as to
  553.     # Alias.
  554.     #
  555.     ScriptAlias /cgi-bin/ "/usr/local/Apache/cgi-bin/"

  556.     #
  557.     # "/usr/local/Apache/cgi-bin" should be changed to whatever your ScriptAliased
  558.     # CGI directory exists, if you have that configured.
  559.     #
  560.     <Directory "/usr/local/Apache/cgi-bin">
  561.         AllowOverride None
  562.         Options None
  563.         Order allow,deny
  564.         Allow from all
  565.     </Directory>

  566. </IfModule>
  567. # End of aliases.

  568. #
  569. # Redirect allows you to tell clients about documents which used to exist in
  570. # your server's namespace, but do not anymore. This allows you to tell the
  571. # clients where to look for the relocated document.
  572. # Format: Redirect old-URI new-URL
  573. #

  574. #
  575. # Directives controlling the display of server-generated directory listings.
  576. #
  577. <IfModule mod_autoindex.c>

  578.     #
  579.     # FancyIndexing is whether you want fancy directory indexing or standard
  580.     #
  581.     # Note, add the option TrackModified to the IndexOptions default list only
  582.     # if all indexed directories reside on NTFS volumes.  The TrackModified flag
  583.     # will report the Last-Modified date to assist caches and proxies to properly
  584.     # track directory changes, but it does _not_ work on FAT volumes.
  585.     #
  586.     IndexOptions FancyIndexing

  587.     #
  588.     # AddIcon* directives tell the server which icon to show for different
  589.     # files or filename extensions.  These are only displayed for
  590.     # FancyIndexed directories.
  591.     #
  592.     AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

  593.     AddIconByType (TXT,/icons/text.gif) text/*
  594.     AddIconByType (IMG,/icons/image2.gif) image/*
  595.     AddIconByType (SND,/icons/sound2.gif) audio/*
  596.     AddIconByType (VID,/icons/movie.gif) video/*

  597.     AddIcon /icons/binary.gif .bin .exe
  598.     AddIcon /icons/binhex.gif .hqx
  599.     AddIcon /icons/tar.gif .tar
  600.     AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
  601.     AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
  602.     AddIcon /icons/a.gif .ps .ai .eps
  603.     AddIcon /icons/layout.gif .html .shtml .htm .pdf
  604.     AddIcon /icons/text.gif .txt
  605.     AddIcon /icons/c.gif .c
  606.     AddIcon /icons/p.gif .pl .py
  607.     AddIcon /icons/f.gif .for
  608.     AddIcon /icons/dvi.gif .dvi
  609.     AddIcon /icons/uuencoded.gif .uu
  610.     AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
  611.     AddIcon /icons/tex.gif .tex
  612.     AddIcon /icons/bomb.gif core

  613.     AddIcon /icons/back.gif ..
  614.     AddIcon /icons/hand.right.gif README
  615.     AddIcon /icons/folder.gif ^^DIRECTORY^^
  616.     AddIcon /icons/blank.gif ^^BLANKICON^^

  617.     #
  618.     # DefaultIcon is which icon to show for files which do not have an icon
  619.     # explicitly set.
  620.     #
  621.     DefaultIcon /icons/unknown.gif

  622.     #
  623.     # AddDescription allows you to place a short description after a file in
  624.     # server-generated indexes.  These are only displayed for FancyIndexed
  625.     # directories.
  626.     # Format: AddDescription "description" filename
  627.     #
  628.     #AddDescription "GZIP compressed document" .gz
  629.     #AddDescription "tar archive" .tar
  630.     #AddDescription "GZIP compressed tar archive" .tgz

  631.     #
  632.     # ReadmeName is the name of the README file the server will look for by
  633.     # default, and append to directory listings.
  634.     #
  635.     # HeaderName is the name of a file which should be prepended to
  636.     # directory indexes.
  637.     #
  638.     ReadmeName README.html
  639.     HeaderName HEADER.html

  640.     #
  641.     # IndexIgnore is a set of filenames which directory indexing should ignore
  642.     # and not include in the listing.  Shell-style wildcarding is permitted.
  643.     #
  644.     IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

  645. </IfModule>
  646. # End of indexing directives.

  647. #
  648. # Document types.
  649. #
  650. <IfModule mod_mime.c>

  651.     #
  652.     # AddType allows you to tweak mime.types without actually editing it, or to
  653.     # make certain files to be certain types.
  654.     #
  655.     AddType application/x-tar .tgz
  656.     AddType application/x-httpd-php .php
  657.     #
  658.     # AddEncoding allows you to have certain browsers uncompress
  659.     # information on the fly. Note: Not all browsers support this.
  660.     # Despite the name similarity, the following Add* directives have nothing
  661.     # to do with the FancyIndexing customization directives above.
  662.     #
  663.     AddEncoding x-compress .Z
  664.     AddEncoding x-gzip .gz .tgz
  665.     #
  666.     # If the AddEncoding directives above are commented-out, then you
  667.     # probably should define those extensions to indicate media types:
  668.     #
  669.     #AddType application/x-compress .Z
  670.     #AddType application/x-gzip .gz .tgz

  671.     #
  672.     # AddLanguage allows you to specify the language of a document. You can
  673.     # then use content negotiation to give a browser a file in a language
  674.     # it can understand.
  675.     #
  676.     # Note 1: The suffix does not have to be the same as the language
  677.     # keyword --- those with documents in Polish (whose net-standard
  678.     # language code is pl) may wish to use "AddLanguage pl .po" to
  679.     # avoid the ambiguity with the common suffix for perl scripts.
  680.     #
  681.     # Note 2: The example entries below illustrate that in quite
  682.     # some cases the two character 'Language' abbreviation is not
  683.     # identical to the two character 'Country' code for its country,
  684.     # E.g. 'Danmark/dk' versus 'Danish/da'.
  685.     #
  686.     # Note 3: In the case of 'ltz' we violate the RFC by using a three char
  687.     # specifier. But there is 'work in progress' to fix this and get
  688.     # the reference data for rfc1766 cleaned up.
  689.     #
  690.     # Danish (da) - Dutch (nl) - English (en) - Estonian (ee)
  691.     # French (fr) - German (de) - Greek-Modern (el)
  692.     # Italian (it) - Korean (kr) - Norwegian (no) - Norwegian Nynorsk (nn)
  693.     # Portugese (pt) - Luxembourgeois* (ltz)
  694.     # Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cs)
  695.     # Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
  696.     # Russian (ru)
  697.     #
  698.     AddLanguage da .dk
  699.     AddLanguage nl .nl
  700.     AddLanguage en .en
  701.     AddLanguage et .ee
  702.     AddLanguage fr .fr
  703.     AddLanguage de .de
  704.     AddLanguage el .el
  705.     AddLanguage he .he
  706.     AddCharset ISO-8859-8 .iso8859-8
  707.     AddLanguage it .it
  708.     AddLanguage ja .ja
  709.     AddCharset ISO-2022-JP .jis
  710.     AddLanguage kr .kr
  711.     AddCharset ISO-2022-KR .iso-kr
  712.     AddLanguage nn .nn
  713.     AddLanguage no .no
  714.     AddLanguage pl .po
  715.     AddCharset ISO-8859-2 .iso-pl
  716.     AddLanguage pt .pt
  717.     AddLanguage pt-br .pt-br
  718.     AddLanguage ltz .lu
  719.     AddLanguage ca .ca
  720.     AddLanguage es .es
  721.     AddLanguage sv .sv
  722.     AddLanguage cs .cz .cs
  723.     AddLanguage ru .ru
  724.     AddLanguage zh-TW .zh-tw
  725.     AddCharset Big5         .Big5    .big5
  726.     AddCharset WINDOWS-1251 .cp-1251
  727.     AddCharset CP866        .cp866
  728.     AddCharset ISO-8859-5   .iso-ru
  729.     AddCharset KOI8-R       .koi8-r
  730.     AddCharset UCS-2        .ucs2
  731.     AddCharset UCS-4        .ucs4
  732.     AddCharset UTF-8        .utf8

  733.     # LanguagePriority allows you to give precedence to some languages
  734.     # in case of a tie during content negotiation.
  735.     #
  736.     # Just list the languages in decreasing order of preference. We have
  737.     # more or less alphabetized them here. You probably want to change this.
  738.     #
  739.     <IfModule mod_negotiation.c>
  740.         LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
  741.     </IfModule>

  742.     #
  743.     # AddHandler allows you to map certain file extensions to "handlers",
  744.     # actions unrelated to filetype. These can be either built into the server
  745.     # or added with the Action command (see below)
  746.     #
  747.     # If you want to use server side includes, or CGI outside
  748.     # ScriptAliased directories, uncomment the following lines.
  749.     #
  750.     # To use CGI scripts:
  751.     #
  752.     #AddHandler cgi-script .cgi

  753.     #
  754.     # To use server-parsed HTML files
  755.     #
  756.     #AddType text/html .shtml
  757.     #AddHandler server-parsed .shtml

  758.     #
  759.     # Uncomment the following line to enable Apache's send-asis HTTP file
  760.     # feature
  761.     #
  762.     #AddHandler send-as-is asis

  763.     #
  764.     # If you wish to use server-parsed imagemap files, use
  765.     #
  766.     #AddHandler imap-file map

  767.     #
  768.     # To enable type maps, you might want to use
  769.     #
  770.     #AddHandler type-map var

  771. </IfModule>
  772. # End of document types.

  773. #
  774. # Action lets you define media types that will execute a script whenever
  775. # a matching file is called. This eliminates the need for repeated URL
  776. # pathnames for oft-used CGI file processors.
  777. # Format: Action media/type /cgi-script/location
  778. # Format: Action handler-name /cgi-script/location
  779. #

  780. #
  781. # MetaDir: specifies the name of the directory in which Apache can find
  782. # meta information files. These files contain additional HTTP headers
  783. # to include when sending the document
  784. #
  785. #MetaDir .web

  786. #
  787. # MetaSuffix: specifies the file name suffix for the file containing the
  788. # meta information.
  789. #
  790. #MetaSuffix .meta

  791. #
  792. # Customizable error response (Apache style)
  793. #  these come in three flavors
  794. #
  795. #    1) plain text
  796. #ErrorDocument 500 "The server made a boo boo.
  797. #  n.b.  the single leading (") marks it as text, it does not get output
  798. #
  799. #    2) local redirects
  800. #ErrorDocument 404 /missing.html
  801. #  to redirect to local URL /missing.html
  802. #ErrorDocument 404 /cgi-bin/missing_handler.pl
  803. #  N.B.: You can redirect to a script or a document using server-side-includes.
  804. #
  805. #    3) external redirects
  806. #ErrorDocument 402 http://www.example.com/subscription_info.html
  807. #  N.B.: Many of the environment variables associated with the original
  808. #  request will *not* be available to such a script.

  809. #
  810. # Customize behaviour based on the browser
  811. #
  812. <IfModule mod_setenvif.c>

  813.     #
  814.     # The following directives modify normal HTTP response behavior.
  815.     # The first directive disables keepalive for Netscape 2.x and browsers that
  816.     # spoof it. There are known problems with these browser implementations.
  817.     # The second directive is for Microsoft Internet Explorer 4.0b2
  818.     # which has a broken HTTP/1.1 implementation and does not properly
  819.     # support keepalive when it is used on 301 or 302 (redirect) responses.
  820.     #
  821.     BrowserMatch "Mozilla/2" nokeepalive
  822.     BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

  823.     #
  824.     # The following directive disables HTTP/1.1 responses to browsers which
  825.     # are in violation of the HTTP/1.0 spec by not being able to grok a
  826.     # basic 1.1 response.
  827.     #
  828.     BrowserMatch "RealPlayer 4\.0" force-response-1.0
  829.     BrowserMatch "Java/1\.0" force-response-1.0
  830.     BrowserMatch "JDK/1\.0" force-response-1.0

  831. </IfModule>
  832. # End of browser customization directives

  833. #
  834. # Allow server status reports, with the URL of http://servername/server-status
  835. # Change the "localhost" to match your domain to enable.
  836. #
  837. #<Location /server-status>
  838. #    SetHandler server-status
  839. #    Order deny,allow
  840. #    Deny from all
  841. #    Allow from localhost
  842. #</Location>

  843. #
  844. # Allow remote server configuration reports, with the URL of
  845. # http://servername/server-info (requires that mod_info.c be loaded).
  846. # Change the "localhost" to match your domain to enable.
  847. #
  848. #<Location /server-info>
  849. #    SetHandler server-info
  850. #    Order deny,allow
  851. #    Deny from all
  852. #    Allow from localhost
  853. #</Location>

  854. #
  855. # There have been reports of people trying to abuse an old bug from pre-1.1
  856. # days.  This bug involved a CGI script distributed as a part of Apache.
  857. # By uncommenting these lines you can redirect these attacks to a logging
  858. # script on phf.apache.org.  Or, you can record them yourself, using the script
  859. # support/phf_abuse_log.cgi.
  860. #
  861. #<Location /cgi-bin/phf*>
  862. #    Deny from all
  863. #    ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi
  864. #</Location>

  865. ### Section 3: Virtual Hosts
  866. #
  867. # VirtualHost: If you want to maintain multiple domains/hostnames on your
  868. # machine you can setup VirtualHost containers for them. Most configurations
  869. # use only name-based virtual hosts so the server doesn't need to worry about
  870. # IP addresses. This is indicated by the asterisks in the directives below.
  871. #
  872. # Please see the documentation at <URL:http://www.apache.org/docs/vhosts/>
  873. # for further details before you try to setup virtual hosts.
  874. #
  875. # You may use the command line option '-S' to verify your virtual host
  876. # configuration.

  877. #
  878. # Use name-based virtual hosting.
  879. #
  880. #NameVirtualHost *:80

  881. #
  882. # VirtualHost example:
  883. # Almost any Apache directive may go into a VirtualHost container.
  884. # The first VirtualHost section is used for requests without a known
  885. # server name.
  886. #
  887. #<VirtualHost *:80>
  888. #    ServerAdmin webmaster@dummy-host.example.com
  889. #    DocumentRoot /www/docs/dummy-host.example.com
  890. #    ServerName dummy-host.example.com
  891. #    ErrorLog logs/dummy-host.example.com-error_log
  892. #    CustomLog logs/dummy-host.example.com-access_log common
  893. #</VirtualHost>

  894. NameVirtualHost *:80

  895. <VirtualHost *>
  896.     DocumentRoot /null
  897. </VirtualHost>

  898. <VirtualHost *>
  899. ### 主机名 ###
  900. #ServerName localhost
  901. #ServerAlias 192.168.0.1

  902. ### 重写规则 ###
  903. <IfModule mod_rewrite.c>
  904.    RewriteEngine On
  905.    RewriteRule ^(.*)/htm/(.*)$ $1.php?$2
  906.    RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2
  907. </IfModule>
  908. ### 文档路径 ###
  909. DocumentRoot /usr/www

  910. ### PHP 读写限制 ###
  911. php_admin_value open_basedir /usr/www

  912. ### 文档路径权限定义 ###
  913. <Directory "/usr/www">
  914.     Options Indexes FollowSymLinks MultiViews
  915.     AllowOverride All
  916.     Order allow,deny
  917.     Allow from all
  918. </Directory>

  919. </VirtualHost>
复制代码
回复

使用道具 举报

索克 发表于 2007-2-13 20:20:05 | 显示全部楼层
做下试验会比较有印象,教程都放在那边了,反正改错了还可以改回来的
回复

使用道具 举报

 楼主| 论坛的新主人 发表于 2007-2-13 20:23:25 | 显示全部楼层
我试过了,不行呀
回复

使用道具 举报

 楼主| 论坛的新主人 发表于 2007-2-13 20:25:09 | 显示全部楼层
帮我改改吧,我实在是不会改呀,我动态ip 花生壳,想让几个朋友测试下5.5新论坛
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-17 09:32 , Processed in 0.029065 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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