最新消息:XAMPP默认安装之后是很不安全的,我们只需要点击左方菜单的 "安全"选项,按照向导操作即可完成安全设置。

xampp资源分享:httpd-vhosts.conf源代码下载

XAMPP下载 admin 64浏览 0评论
 1.98 KB
  1. #虚拟主机
  2. #如果您要​​在自己的服务器上维护多个域/主机名
  3. #机器,您可以为其设置VirtualHost容器。大多数配置
  4. #仅使用基于名称的虚拟主机,因此服务器无需担心
  5. #个IP地址。这由以下指令中的星号表示。
  6. #请参阅以下文档
  7. #<URL:http://httpd.apache.org/docs/2.2/vhosts/>
  8. #了解更多详细信息,然后再尝试设置虚拟主机。
  9. #您可以使用命令行选项“ -S”来验证您的虚拟主机
  10. #配置。
  11. #使用基于名称的虚拟主机。
  12. NameVirtualHost *:80
  13. #VirtualHost示例:
  14. #几乎所有Apache指令都可以放入VirtualHost容器中。
  15. #第一个VirtualHost部分用于所有未请求的请求
  16. #在任何<VirtualHost>块中匹配ServerName或ServerAlias。
  17. ## <VirtualHost *:80>
  18.     ## ServerAdmin postmaster@dummy-host.localhost
  19.     ## DocumentRoot“ C:C:/xampp/htdocs/dummy-host.localhost”
  20.     ## ServerName dummy-host.localhost
  21.     ## ServerAlias www.dummy-host.localhost
  22.     ## ErrorLog“ logs / dummy-host.localhost-error.log”
  23.     ## CustomLog“ logs / dummy-host.localhost-access.log”组合
  24. ## </ VirtualHost>
  25. 名称VirtualHost *
  26. < VirtualHost *>
  27.     DocumentRoot “ C:\ x ampp \ h tdocs”
  28.     ServerName本地主机
  29. </ VirtualHost >
  30. < VirtualHost *>
  31.     DocumentRoot “ C:\ U sers \ u ser_name \ D文件\ p roject_one”
  32.     ServerName project_one.localhost
  33.     启用SSLEngine
  34.     SSLCertificateFile “ conf / ssl.crt / server.crt”
  35.     SSLCertificateKeyFile “ conf / ssl.key / server.key”
  36.     <目录 “ C:\ U sers \ u ser_name \ D occments \ p roject_one” >
  37.         允许 全部覆盖
  38.         订购 允许拒绝
  39.         允许所有
  40.     </目录>
  41. </ VirtualHost >
  42. < VirtualHost *>
  43.     DocumentRoot “ C:\ U sers \ u ser_name \ D文件\ p roject_two”
  44.     ServerName project_two.localhost
  45.     <目录 “ C:\ U sers \ u ser_name \ D occments \ p roject_two” >
  46.         允许 全部覆盖
  47.         订购 允许拒绝
  48.         允许所有
  49.     </目录>
  50. </ VirtualHost >
RAW粘贴数据

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn’t need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option ‘-S’ to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##ServerAdmin postmaster@dummy-host.localhost
##DocumentRoot “C:C:/xampp/htdocs/dummy-host.localhost”
##ServerName dummy-host.localhost
##ServerAlias www.dummy-host.localhost
##ErrorLog “logs/dummy-host.localhost-error.log”
##CustomLog “logs/dummy-host.localhost-access.log” combined
##</VirtualHost>
NameVirtualHost *
<VirtualHost *>
DocumentRoot “C:\xampp\htdocs”
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot “C:\Users\user_name\Documents\project_one”
ServerName project_one.localhost
SSLEngine on
SSLCertificateFile “conf/ssl.crt/server.crt”
SSLCertificateKeyFile “conf/ssl.key/server.key”
<Directory “C:\Users\user_name\Documents\project_one”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot “C:\Users\user_name\Documents\project_two”
ServerName project_two.localhost
<Directory “C:\Users\user_name\Documents\project_two”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

转载请注明:XAMPP中文组官网 » xampp资源分享:httpd-vhosts.conf源代码下载