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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] apache有没有办法只让绑定的域名访问.没绑定的就不能访问呢

[复制链接]
233053888 发表于 2011-11-13 17:23:25 | 显示全部楼层 |阅读模式
apache有没有办法只让绑定的域名访问.没绑定的就不能访问呢
zzhijcy 发表于 2011-11-13 23:21:13 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| 233053888 发表于 2011-11-14 21:41:33 | 显示全部楼层
本帖最后由 233053888 于 2011-11-14 21:42 编辑
  1. #
  2. # This is the main Apache HTTP server configuration file. It contains the
  3. # configuration directives that give the server its instructions.
  4. # See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
  5. # In particular, see
  6. # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
  7. # for a discussion of each configuration directive.
  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. # Configuration and logfile names: If the filenames you specify for many
  14. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  15. # server will use that explicit path. If the filenames do *not* begin
  16. # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
  17. # with ServerRoot set to "D:/Apache2.2" will be interpreted by the
  18. # server as "D:/Apache2.2/logs/foo.log".
  19. #
  20. # NOTE: Where filenames are specified, you must use forward slashes
  21. # instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
  22. # If a drive letter is omitted, the drive on which httpd.exe is located
  23. # will be used by default. It is recommended that you always supply
  24. # an explicit drive letter in absolute paths to avoid confusion.

  25. #
  26. # ServerRoot: The top of the directory tree under which the server's
  27. # configuration, error, and log files are kept.
  28. #
  29. # Do not add a slash at the end of the directory path. If you point
  30. # ServerRoot at a non-local disk, be sure to point the LockFile directive
  31. # at a local disk. If you wish to share the same ServerRoot for multiple
  32. # httpd daemons, you will need to change at least LockFile and PidFile.
  33. #
  34. ServerRoot "D:/Apache2.2"

  35. #
  36. # Listen: Allows you to bind Apache to specific IP addresses and/or
  37. # ports, instead of the default. See also the <VirtualHost>
  38. # directive.
  39. #
  40. # Change this to Listen on specific IP addresses as shown below to
  41. # prevent Apache from glomming onto all bound IP addresses.
  42. #
  43. #Listen 98.126.197.111:80
  44. Listen 80

  45. #
  46. # Dynamic Shared Object (DSO) Support
  47. #
  48. # To be able to use the functionality of a module which was built as a DSO you
  49. # have to place corresponding `LoadModule' lines at this location so the
  50. # directives contained in it are actually available _before_ they are used.
  51. # Statically compiled modules (those listed by `httpd -l') do not need
  52. # to be loaded here.
  53. #
  54. # Example:
  55. # LoadModule foo_module modules/mod_foo.so
  56. #
  57. LoadModule actions_module modules/mod_actions.so
  58. LoadModule alias_module modules/mod_alias.so
  59. LoadModule asis_module modules/mod_asis.so
  60. LoadModule auth_basic_module modules/mod_auth_basic.so
  61. #LoadModule auth_digest_module modules/mod_auth_digest.so
  62. #LoadModule authn_alias_module modules/mod_authn_alias.so
  63. #LoadModule authn_anon_module modules/mod_authn_anon.so
  64. #LoadModule authn_dbd_module modules/mod_authn_dbd.so
  65. #LoadModule authn_dbm_module modules/mod_authn_dbm.so
  66. LoadModule authn_default_module modules/mod_authn_default.so
  67. LoadModule authn_file_module modules/mod_authn_file.so
  68. #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  69. #LoadModule authz_dbm_module modules/mod_authz_dbm.so
  70. LoadModule authz_default_module modules/mod_authz_default.so
  71. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  72. LoadModule authz_host_module modules/mod_authz_host.so
  73. #LoadModule authz_owner_module modules/mod_authz_owner.so
  74. LoadModule authz_user_module modules/mod_authz_user.so
  75. LoadModule autoindex_module modules/mod_autoindex.so
  76. #LoadModule cache_module modules/mod_cache.so
  77. #LoadModule cern_meta_module modules/mod_cern_meta.so
  78. LoadModule cgi_module modules/mod_cgi.so
  79. #LoadModule charset_lite_module modules/mod_charset_lite.so
  80. #LoadModule dav_module modules/mod_dav.so
  81. #LoadModule dav_fs_module modules/mod_dav_fs.so
  82. #LoadModule dav_lock_module modules/mod_dav_lock.so
  83. #LoadModule dbd_module modules/mod_dbd.so
  84. #LoadModule deflate_module modules/mod_deflate.so
  85. LoadModule dir_module modules/mod_dir.so
  86. #LoadModule disk_cache_module modules/mod_disk_cache.so
  87. #LoadModule dumpio_module modules/mod_dumpio.so
  88. LoadModule env_module modules/mod_env.so
  89. #LoadModule expires_module modules/mod_expires.so
  90. #LoadModule ext_filter_module modules/mod_ext_filter.so
  91. #LoadModule file_cache_module modules/mod_file_cache.so
  92. #LoadModule filter_module modules/mod_filter.so
  93. #LoadModule headers_module modules/mod_headers.so
  94. #LoadModule ident_module modules/mod_ident.so
  95. #LoadModule imagemap_module modules/mod_imagemap.so
  96. LoadModule include_module modules/mod_include.so
  97. #LoadModule info_module modules/mod_info.so
  98. LoadModule isapi_module modules/mod_isapi.so
  99. #LoadModule ldap_module modules/mod_ldap.so
  100. #LoadModule logio_module modules/mod_logio.so
  101. LoadModule log_config_module modules/mod_log_config.so
  102. #LoadModule log_forensic_module modules/mod_log_forensic.so
  103. #LoadModule mem_cache_module modules/mod_mem_cache.so
  104. LoadModule mime_module modules/mod_mime.so
  105. #LoadModule mime_magic_module modules/mod_mime_magic.so
  106. LoadModule negotiation_module modules/mod_negotiation.so
  107. #LoadModule proxy_module modules/mod_proxy.so
  108. #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  109. #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  110. #LoadModule proxy_connect_module modules/mod_proxy_connect.so
  111. #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  112. #LoadModule proxy_http_module modules/mod_proxy_http.so
  113. #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
  114. #LoadModule reqtimeout_module modules/mod_reqtimeout.so
  115. #LoadModule rewrite_module modules/mod_rewrite.so
  116. LoadModule setenvif_module modules/mod_setenvif.so
  117. #LoadModule speling_module modules/mod_speling.so
  118. #LoadModule ssl_module modules/mod_ssl.so
  119. LoadModule php5_module D:/PHPweb/php5.2.5/php5apache2_2.dll
  120. PHPIniDir "D:/PHPweb/php5.2.5"
  121. #LoadModule status_module modules/mod_status.so
  122. #LoadModule substitute_module modules/mod_substitute.so
  123. #LoadModule unique_id_module modules/mod_unique_id.so
  124. #LoadModule userdir_module modules/mod_userdir.so
  125. #LoadModule usertrack_module modules/mod_usertrack.so
  126. #LoadModule version_module modules/mod_version.so
  127. #LoadModule vhost_alias_module modules/mod_vhost_alias.so

  128. <IfModule !mpm_netware_module>
  129. <IfModule !mpm_winnt_module>
  130. #
  131. # If you wish httpd to run as a different user or group, you must run
  132. # httpd as root initially and it will switch.
  133. #
  134. # User/Group: The name (or #number) of the user/group to run httpd as.
  135. # It is usually good practice to create a dedicated user and group for
  136. # running httpd, as with most system services.
  137. #
  138. User daemon
  139. Group daemon

  140. </IfModule>
  141. </IfModule>

  142. # 'Main' server configuration
  143. #
  144. # The directives in this section set up the values used by the 'main'
  145. # server, which responds to any requests that aren't handled by a
  146. # <VirtualHost> definition. These values also provide defaults for
  147. # any <VirtualHost> containers you may define later in the file.
  148. #
  149. # All of these directives may appear inside <VirtualHost> containers,
  150. # in which case these default settings will be overridden for the
  151. # virtual host being defined.
  152. #

  153. #
  154. # ServerAdmin: Your address, where problems with the server should be
  155. # e-mailed. This address appears on some server-generated pages, such
  156. # as error documents. e.g. admin@your-domain.com
  157. #
  158. ServerAdmin 233053888@qq.com

  159. #
  160. # ServerName gives the name and port that the server uses to identify itself.
  161. # This can often be determined automatically, but we recommend you specify
  162. # it explicitly to prevent problems during startup.
  163. #
  164. # If your host doesn't have a registered DNS name, enter its IP address here.
  165. #
  166. #ServerName www.h983.com:80

  167. #
  168. # DocumentRoot: The directory out of which you will serve your
  169. # documents. By default, all requests are taken from this directory, but
  170. # symbolic links and aliases may be used to point to other locations.
  171. #
  172. DocumentRoot "D:/Apache2.2/htdocs"

  173. #
  174. # Each directory to which Apache has access can be configured with respect
  175. # to which services and features are allowed and/or disabled in that
  176. # directory (and its subdirectories).
  177. #
  178. # First, we configure the "default" to be a very restrictive set of
  179. # features.
  180. #
  181. <Directory />
  182. Options FollowSymLinks
  183. AllowOverride None
  184. Order deny,allow
  185. Deny from all
  186. </Directory>

  187. #
  188. # Note that from this point forward you must specifically allow
  189. # particular features to be enabled - so if something's not working as
  190. # you might expect, make sure that you have specifically enabled it
  191. # below.
  192. #

  193. #
  194. # This should be changed to whatever you set DocumentRoot to.
  195. #
  196. <Directory "D:/Apache2.2/htdocs">
  197. #
  198. # Possible values for the Options directive are "None", "All",
  199. # or any combination of:
  200. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  201. #
  202. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  203. # doesn't give it to you.
  204. #
  205. # The Options directive is both complicated and important. Please see
  206. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  207. # for more information.
  208. #
  209. Options Indexes FollowSymLinks

  210. #
  211. # AllowOverride controls what directives may be placed in .htaccess files.
  212. # It can be "All", "None", or any combination of the keywords:
  213. # Options FileInfo AuthConfig Limit
  214. #
  215. AllowOverride None

  216. #
  217. # Controls who can get stuff from this server.
  218. #
  219. Order allow,deny
  220. Allow from all

  221. </Directory>

  222. #
  223. # DirectoryIndex: sets the file that Apache will serve if a directory
  224. # is requested.
  225. #
  226. <IfModule dir_module>
  227. DirectoryIndex index.html
  228. </IfModule>

  229. #
  230. # The following lines prevent .htaccess and .htpasswd files from being
  231. # viewed by Web clients.
  232. #
  233. <FilesMatch "^\.ht">
  234. Order allow,deny
  235. Deny from all
  236. Satisfy All
  237. </FilesMatch>

  238. #
  239. # ErrorLog: The location of the error log file.
  240. # If you do not specify an ErrorLog directive within a <VirtualHost>
  241. # container, error messages relating to that virtual host will be
  242. # logged here. If you *do* define an error logfile for a <VirtualHost>
  243. # container, that host's errors will be logged there and not here.
  244. #
  245. ErrorLog "logs/error.log"

  246. #
  247. # LogLevel: Control the number of messages logged to the error_log.
  248. # Possible values include: debug, info, notice, warn, error, crit,
  249. # alert, emerg.
  250. #
  251. LogLevel warn

  252. <IfModule log_config_module>
  253. #
  254. # The following directives define some format nicknames for use with
  255. # a CustomLog directive (see below).
  256. #
  257. LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
  258. LogFormat "%h %l %u %t "%r" %>s %b" common

  259. <IfModule logio_module>
  260. # You need to enable mod_logio.c to use %I and %O
  261. LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
  262. </IfModule>

  263. #
  264. # The location and format of the access logfile (Common Logfile Format).
  265. # If you do not define any access logfiles within a <VirtualHost>
  266. # container, they will be logged here. Contrariwise, if you *do*
  267. # define per-<VirtualHost> access logfiles, transactions will be
  268. # logged therein and *not* in this file.
  269. #
  270. CustomLog "logs/access.log" common

  271. #
  272. # If you prefer a logfile with access, agent, and referer information
  273. # (Combined Logfile Format) you can use the following directive.
  274. #
  275. #CustomLog "logs/access.log" combined
  276. </IfModule>

  277. <IfModule alias_module>
  278. #
  279. # Redirect: Allows you to tell clients about documents that used to
  280. # exist in your server's namespace, but do not anymore. The client
  281. # will make a new request for the document at its new location.
  282. # Example:
  283. # Redirect permanent /foo http://www.h983.com/bar

  284. #
  285. # Alias: Maps web paths into filesystem paths and is used to
  286. # access content that does not live under the DocumentRoot.
  287. # Example:
  288. # Alias /webpath /full/filesystem/path
  289. #
  290. # If you include a trailing / on /webpath then the server will
  291. # require it to be present in the URL. You will also likely
  292. # need to provide a <Directory> section to allow access to
  293. # the filesystem path.

  294. #
  295. # ScriptAlias: This controls which directories contain server scripts.
  296. # ScriptAliases are essentially the same as Aliases, except that
  297. # documents in the target directory are treated as applications and
  298. # run by the server when requested rather than as documents sent to the
  299. # client. The same rules about trailing "/" apply to ScriptAlias
  300. # directives as to Alias.
  301. #
  302. ScriptAlias /cgi-bin/ "D:/Apache2.2/cgi-bin/"

  303. </IfModule>

  304. <IfModule cgid_module>
  305. #
  306. # ScriptSock: On threaded servers, designate the path to the UNIX
  307. # socket used to communicate with the CGI daemon of mod_cgid.
  308. #
  309. #Scriptsock logs/cgisock
  310. </IfModule>

  311. #
  312. # "D:/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
  313. # CGI directory exists, if you have that configured.
  314. #
  315. <Directory "D:/Apache2.2/cgi-bin">
  316. AllowOverride None
  317. Options None
  318. Order allow,deny
  319. Allow from all
  320. </Directory>

  321. #
  322. # DefaultType: the default MIME type the server will use for a document
  323. # if it cannot otherwise determine one, such as from filename extensions.
  324. # If your server contains mostly text or HTML documents, "text/plain" is
  325. # a good value. If most of your content is binary, such as applications
  326. # or images, you may want to use "application/octet-stream" instead to
  327. # keep browsers from trying to display binary files as though they are
  328. # text.
  329. #
  330. DefaultType text/plain

  331. <IfModule mime_module>
  332. #
  333. # TypesConfig points to the file containing the list of mappings from
  334. # filename extension to MIME-type.
  335. #
  336. TypesConfig conf/mime.types

  337. #
  338. # AddType allows you to add to or override the MIME configuration
  339. # file specified in TypesConfig for specific file types.
  340. #
  341. #AddType application/x-gzip .tgz
  342. #
  343. # AddEncoding allows you to have certain browsers uncompress
  344. # information on the fly. Note: Not all browsers support this.
  345. #
  346. #AddEncoding x-compress .Z
  347. #AddEncoding x-gzip .gz .tgz
  348. #
  349. # If the AddEncoding directives above are commented-out, then you
  350. # probably should define those extensions to indicate media types:
  351. #
  352. AddType application/x-compress .Z
  353. AddType application/x-gzip .gz .tgz
  354. AddType application/x-httpd-php .php
  355. AddType application/x-httpd-php .html
  356. #
  357. # AddHandler allows you to map certain file extensions to "handlers":
  358. # actions unrelated to filetype. These can be either built into the server
  359. # or added with the Action directive (see below)
  360. #
  361. # To use CGI scripts outside of ScriptAliased directories:
  362. # (You will also need to add "ExecCGI" to the "Options" directive.)
  363. #
  364. #AddHandler cgi-script .cgi

  365. # For type maps (negotiated resources):
  366. #AddHandler type-map var

  367. #
  368. # Filters allow you to process content before it is sent to the client.
  369. #
  370. # To parse .shtml files for server-side includes (SSI):
  371. # (You will also need to add "Includes" to the "Options" directive.)
  372. #
  373. #AddType text/html .shtml
  374. #AddOutputFilter INCLUDES .shtml
  375. </IfModule>

  376. #
  377. # The mod_mime_magic module allows the server to use various hints from the
  378. # contents of the file itself to determine its type. The MIMEMagicFile
  379. # directive tells the module where the hint definitions are located.
  380. #
  381. #MIMEMagicFile conf/magic

  382. #
  383. # Customizable error responses come in three flavors:
  384. # 1) plain text 2) local redirects 3) external redirects
  385. #
  386. # Some examples:
  387. #ErrorDocument 500 "The server made a boo boo."
  388. #ErrorDocument 404 /missing.html
  389. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  390. #ErrorDocument 402 http://www.h983.com/subscription_info.html
  391. #

  392. #
  393. # EnableMMAP and EnableSendfile: On systems that support it,
  394. # memory-mapping or the sendfile syscall is used to deliver
  395. # files. This usually improves server performance, but must
  396. # be turned off when serving from networked-mounted
  397. # filesystems or if support for these functions is otherwise
  398. # broken on your system.
  399. #
  400. #EnableMMAP off
  401. #EnableSendfile off

  402. # Supplemental configuration
  403. #
  404. # The configuration files in the conf/extra/ directory can be
  405. # included to add extra features or to modify the default configuration of
  406. # the server, or you may simply copy their contents here and change as
  407. # necessary.

  408. # Server-pool management (MPM specific)
  409. #Include conf/extra/httpd-mpm.conf

  410. # Multi-language error messages
  411. #Include conf/extra/httpd-multilang-errordoc.conf

  412. # Fancy directory listings
  413. #Include conf/extra/httpd-autoindex.conf

  414. # Language settings
  415. #Include conf/extra/httpd-languages.conf

  416. # User home directories
  417. #Include conf/extra/httpd-userdir.conf

  418. # Real-time info on requests and configuration
  419. #Include conf/extra/httpd-info.conf

  420. # Virtual hosts
  421. #Include conf/extra/httpd-vhosts.conf

  422. # Local access to the Apache HTTP Server Manual
  423. #Include conf/extra/httpd-manual.conf

  424. # Distributed authoring and versioning (WebDAV)
  425. #Include conf/extra/httpd-dav.conf

  426. # Various default settings
  427. #Include conf/extra/httpd-default.conf

  428. # Secure (SSL/TLS) connections
  429. #Include conf/extra/httpd-ssl.conf
  430. #
  431. # Note: The following must must be present to support
  432. # starting without SSL on platforms with no /dev/random equivalent
  433. # but a statically compiled-in mod_ssl.
  434. #
  435. <IfModule ssl_module>
  436. SSLRandomSeed startup builtin
  437. SSLRandomSeed connect builtin
  438. </IfModule>
复制代码

这是  httpd
回复

使用道具 举报

smilewx2006 发表于 2011-11-19 17:08:30 | 显示全部楼层
呵;楼上有意思 ;你把http.conf贴出来;说一下怎么配置呀;
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-23 07:20 , Processed in 0.095757 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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