apache虚拟机配置(xampp)
一、xampp(网站集成环境)
1、xampp官网地址:https://www.apachefriends.org/index.html
2、xampp下载地址(官方):https://www.apachefriends.org/download.html
3、xampp下载地址(其他-下载速度很快):https://xampp-windows.en.softonic.com/
二、apache虚拟机配置(install_folder/xampp/8012/apache/conf/extra/httpd-vhosts.conf)
# httpd-vhosts.conf
# Virtual Hosts
#
# Required modules: mod_log_config
# 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.4/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 webmaster@dummy-host.example.com
##DocumentRoot "D:/tools/website/xampp/8012/htdocs/dummy-host.example.com"
##ServerName dummy-host.example.com
##ServerAlias www.dummy-host.example.com
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common
##</VirtualHost>
##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
##DocumentRoot "D:/tools/website/xampp/8012/htdocs/dummy-host2.example.com"
##ServerName dummy-host2.example.com
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>
# 2021-11-17 by me
#
# httpd-vhosts.conf (' D:/tools/website/xampp/8012/apache/conf/extra/httpd-vhosts.conf ')
#
# virtualhost are based name with apache, you must turn on items 'NameVirtualHost *:80'
#
# 1. NameVirtualHost *:80
#
# 2. configure file: hosts (' C:/Windows/System32/drivers/etc/hosts' )
#
# test for databases website 2021-10-19
# 10.10.10.12 lidawei.com
# 10.10.10.12 test.com
# 10.10.10.12 laohu.com
# 10.10.10.12 cn8.com
# NameVirtualHost *:80
# <VirtualHost 10.10.10.12:80>
# # DocumentRoot "G:/phpWorkspaces/php_storm/projects/cn8"
# DocumentRoot "G:/phpWorkspaces/php_storm/projects/cn8"
# ServerName cn8.com
# <Directory "G:/phpWorkspaces/php_storm/projects/cn8">
# AllowOverride All
# Require all granted
# </Directory>
# </VirtualHost>
# NameVirtualHost *:80
# <VirtualHost 10.10.10.12:80>
# # DocumentRoot "G:/phpWorkspaces/php_storm/projects/cn8"
# DocumentRoot "G:/webWorkspaces/var/www/html/backup/php_mysql_example"
# ServerName laohu.com
# <Directory "G:/webWorkspaces/var/www/html/backup/php_mysql_example">
# AllowOverride All
# Require all granted
# </Directory>
# </VirtualHost>
<VirtualHost 10.10.10.12:80>
DocumentRoot "G:/webWorkspaces/dlt"
ServerName test.com
<Directory "G:/webWorkspaces/dlt">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
本文由 lnlidawei 原创、整理、转载,本文来自于【博客园】; 整理和转载的文章的版权归属于【原创作者】; 转载或引用时请【保留文章的来源信息】:https://www.cnblogs.com/lnlidawei/p/16047611.html