Apache本地配置多个虚拟主机实例教程

apache 使用心得(启动多实例,单实例监听多端口,单实例监听多域名) 很久之前就手动配置过apache了,今天遇到一个需要在阿里云服务器上配置apache路由多个域名到不同的服务器根目录这样的问题,研究了一段时间,得出了下面的心得,分享给大家~ *以windows系统为例子    下面要会说到的内容: 1 开启多个apache实例,监听多个端口(作用就是方便读取不同的配置文件) 2 单个apache实例监听多个端口 3 单个apache实例监听 阅读详情
使用 Apache 在本地配置出多个虚拟主机?而且使用不同的“域名”来访问本地不同的站点。

一般情况下,都使用 localhost 来访问本机上的服务器,在我们的 C:/WINDOWS/system32/drivers/etc/hosts 文件中默认有一个:
127.0.0.1       localhost
当在浏览器地址栏键入:
http://localhost
的时候,会显示出服务器根目录中的许多文件夹(若你的根目录不是只有一个站点的话),就像:
Index of /
     * BAK/
    * B_Discuz/
    * B_Supesite/
    * B_UCenter/
    * B_Uchome/
    * B_Uchome_Bak/
    * B_XSpace/
    * DiscuZ_X1/
    * Javascript/
    * NewUch/
    * PHP/
    * UchUtf8/
    * Zend Framework_1.10.8/
    * Zendphpweb20/
    * mycms/
    * phpMyAdmin/
    * userAdminManager/
现在想通过一个自定义的“域名”来访问我的根目录中的站点,譬如:

1,根目录中有一个 phpMyAdmin/ 的文件夹(倒数第二个),它是一个网页版的数据库管理系统(肯定不会陌生的吧!),我想通过访问一个简单的:
http://dbmanager
来进入这个系统(而不用输入 localhost,再点击 phpMyAdmin/ 才进入);


2,根目录中有一个 Zendphpweb20/ 的文件夹(倒数第三个),它只是一个本地应用站点,我想通过访问:
http://phpweb20
来进入这个本地站点;

现在要干些什么呢?跟我来吧!看下面:

1> 修改系统的 hosts 文件:
打开之前说过的系统的 hosts 文件,来给我们的电脑添加两个“假的”DNS 项,加入代码:
127.0.0.2       dbmanager
127.0.0.3       phpweb20
这样,我们的浏览器就会将 dbmanager 主机名解析为 127.0.0.2,将 phpweb20 主机名解析为 127.0.0.3。

2> 修改 Apache 配置文件:
在我的本机内 Apache 的主配置文件在:
D:/usr/local/apache2/conf/httpd.conf
说是修改 Apache 的配置文件,其实只是添加了一些内容,因为不想修改 Apache 的主配置文件,所以我们最好在各个站点写好自己的虚拟主机配置子文件,然后使用 Include 指令将其包含到 Apache 的主配置文件里。 apache基于域名的虚拟主机配置实例

其实在 Apache 的主配置文件的最下方有虚拟主机的配置示例,只不过都被注释掉了:

# 基于名称的虚拟主机示例:
#<VirtualHost 127.0.0.2:80>
 #   ServerAdmin admin@system
 #   DocumentRoot D:\usr\webroot\webhosting1
 #   ServerName 127.0.0.2
 #   ErrorLog logs/dummy-host.example.com-error_log
 #  CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

#<VirtualHost 127.0.0.3:80>
 #   ServerAdmin admin@system
 #   DocumentRoot D:\usr\webroot\webhosting2

 #   ServerName 127.0.0.3

# www.jbxue.com

 #   ErrorLog logs/dummy-host.example.com-error_log
 #  CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

#<VirtualHost 127.0.0.4:80>
 #   ServerAdmin admin@system
 #   DocumentRoot D:\usr\webroot\webhosting3
 #   ServerName 127.0.0.4
 #   ErrorLog logs/dummy-host.example.com-error_log
 #  CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
在配置文件的最下方添加代码:
# 包含 dbmanager 虚拟主机配置文件
Include D:/usr/webroot/phpMyAdmin/httpd.conf

# 包含 phpweb20 虚拟主机配置文件 
Include D:/usr/webroot/Zendphpweb20/httpd.conf
(我的 localhost 的根目录为 D:/usr/webroot/)

3> 创建各个虚拟主机的子配置文件( wind2003环境apache多域名配置):

创建 dbmanager 的配置文件:D:/usr/webroot/phpMyAdmin/httpd.conf
#dbmanager 虚拟主机设置
<VirtualHost 127.0.0.2:80>
    ServerName dbmanager
    DocumentRoot D:/usr/webroot/phpMyAdmin

    <Directory D:/usr/webroot/phpMyAdmin>
        AllowOverride All
        Options All
    </Directory>
</VirtualHost>
创建 phpweb20 的配置文件:D:/usr/webroot/Zendphpweb20/httpd.conf

#phpweb20 虚拟主机设置
<VirtualHost 127.0.0.3:80>
    ServerName phpweb20
    DocumentRoot D:/usr/webroot/Zendphpweb20/htdocs
    <Directory D:/usr/webroot/Zendphpweb20/htdocs>
        AllowOverride All
        Options All
    </Directory>

    #修改 PHP 配置(可选)
    php_value include_path .;D:/usr/webroot/Zendphpweb20/include;D:/usr/local/php5/PEAR
    php_value magic_quotes_gpc off
    php_value register_globals off
</VirtualHost>
各个虚拟主机的配置就看应用站点的不同需要了,DocumentRoot 为其根目录(php_value 是修改此站点的 PHP 运行参数,根据自己应用的需要来写,这样就不必修改 PHP 主配置文件)。

4> 重启 Apache 服务:

在浏览器地址栏输入分别输入:
http://dbmanager
http://phpweb20
centOS6配置Apache基于域名的多个虚拟主机 centOS6下配置Apache的虚拟主机: 1、#vim /etc/httpd/conf/httpd.conf 编辑#NameVirtualHost *:80为NameVirtualHost 192.168.0.101(即centOS服务器的IP地址) 到最下面添加如下配置信息: #此处的bookstore.com即你的网站的域名 DocumentR 阅读详情

相关推荐

apache ssi 使用例子

在技术上,SSI就是在静态HTML文件中,根据需求插入不同的内容。 例如一个article的频道,每一个article内页都生成一个静态的HTML,如此时,header某个位置需要修改,则需要重新生成所有article的静态HTML文件。 如使用了SSI,可以在HTML文件中通过注释行嵌入经常会变化的共用部分,例如登入讯息等。可以不需要重新生成所有article,服务器会根据嵌入文件自动生成网页,输出到浏览器,如要修改则只需要修改嵌入的文件即可,无需重新生成所有HTML文件,服务器包含这种方式与php的include类似。

在配置apache多个虚拟主机的时候,访问总是指向第一个虚拟主机

httpd.conf 中加入 NameVirtualHost * 解决问题。

Because its there. 1225

Apache经典实例

Apache经典实例讲解详细

Apache案例详解

Apache案例详解 建立Web服务器,并根据要求配置Web服务器

如何通过Apache在本地配置多个虚拟主机

主要介绍了如何通过Apache在本地配置多个虚拟主机,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下

linux 下搭建两个虚拟主机,但是总是显示第一个

今天在测试环境把LAMP(Linxu+Apache+Mysql+PHP/Python/Perl)架构搭建起来以后,出现了两个问题1,php链接mysql出错,结果是没有加载对应的mysql模块2,创建了两个虚拟机,访问的时候却始终只会访问其中一个默认的(我看了下是按我配置文件名排序的第一个文件创建的虚拟机)解决方法1,在php的文件 /etc/php.ini 当中有个配置参数...

weixin_34195546的博客 289

SPSS_Process—简单&平行&链式中介模型

本篇文章介绍采用SPSS的插件Process对简单中介、链式中介、平行中介模型进行检验的操作方法及结果解读。

m0_54401011的博客 4万+

httpd如何开启多个实例

1、在普通用户目录下创建如apache目录,然后创建httpd文件夹,拷贝httpd可执行文件至httpd文件夹下。 2、拷贝/etc/httpd/下几个目录至/local/apache/httpd目录下,分别是conf、conf.d、conf.modules.d、modules等。 3、修改conf下的httpd.conf: ServerRoot "/local/apache/httpd...

ty_tian的博客 986

PyQt5 + HFSS:给你的仿真脚本做个专属GUI界面(零基础搭建指南)

本文详细介绍了如何使用PyQt5为HFSS仿真脚本创建专属GUI界面,适合零基础用户快速上手。通过Python二次开发,实现参数可视化调整、进度实时监控等功能,大幅提升团队协作效率。文章涵盖环境配置、界面设计、HFSS集成到打包部署的全流程,是仿真工程师提升工作效率的实用指南。

weixin_42535720的博客 185

手教你如何使用Simulink和相关工具箱模拟和实现无人机的多机接力信号中继的建模

扩大通信范围:单架无人机的通信能力有限,通过多机接力的方式可以显著扩展通信覆盖范围。提高可靠性:当某架无人机出现故障或电量不足时,其他无人机可以接管其任务,确保通信不中断。适应复杂环境:在山区、森林等复杂地形中,多机接力可以绕过障碍物,建立稳定的通信链路。使用Communications Toolbox中的模块来模拟无线通信链路。例如,可以使用模块模拟噪声信道,或者使用模块计算信号衰减。matlab深色版本。

MHD0815的博客 767

Ubuntu下的Apache2虚拟主机的配置

1、Apache2的配置文件 Ubuntu中Apache的配置文件是//etc/apache2/apache2.conf。Apache在启动时会找到这个文件并自动读取该文件中的配置信息,而其他配置文件则是通过include指令包含进来的,在apache2.conf 中可以看到这些引入行。当然,也可以将所有的配置全放在apache2.conf或者httpd.conf或者其他文件中,Apache这样

jin's blog 3943

在线考试系统源码+数据库+word+ppt(高分毕业设计)

本系统通过Spring Cloud实现微服务拆分,将授权、考试、监控等功能解耦,既保证了系统的扩展性,也便于后期维护。基于OAuth2.0的单点登录,解决多服务统一认证问题;考试与练习模式分离,满足不同场景需求;集成Druid与Hystrix,保障系统监控与稳定性。

weixin_44355158的博客 737

Apache虚拟主机配置详细教程

文章目录Apache 虚拟主机企业应用部署一个端口不同域名调试worker工作模式进行压力测试权限设置Apache 配置文件详解Apache Rewrite 规则讲解Apache配置文件权限操作总结 Apache 虚拟主机企业应用 企业真实环境中,一台WEB服务器发布单个网站会非常浪费资源,所以一台WEB服务器上会发布多个网站,少则3-5个,多则2-30。 在一台服务器上发布多哥网站,也称之为部署多个虚拟主机,WEB虚拟主机配置方法有三种: 基于 单个 IP地址 多个 Socket端口 基于

心有鸿鹄天地,不敢妄坠人间 2万+

群晖NAS安装HomeAssistant保姆级教程:从Docker部署到智能设备接入

本文提供了一份详尽的群晖NAS安装HomeAssistant保姆级教程,涵盖从Docker部署到智能设备接入的全过程。通过规划存储路径、配置容器环境变量和网络模式,确保系统稳定运行。教程还介绍了如何接入小米、苹果HomeKit等智能家居设备,并利用自动化与仪表盘打造本地化、高响应速度的智能中枢,实现数据隐私与远程控制的完美平衡。

play7的博客 694

【大模型推理】工作负载的弹性伸缩

推荐采用 并发请求数(Concurrency) 或 队列深度(Queue Size) 结合GPU监控指标(显存/算力利用率),并依托Knative KPA、Fluid缓存、优先级调度等技术实现高效弹性伸缩[citation:6][citation:7][citation:8]。QPS无法体现这种资源消耗累积效应[citation:6]。并发数的本质:是实时反映资源占用的瞬时状态量,而非速率指标,尤其适合单次请求资源消耗大、处理时间长的业务(如LLM推理)[citation:1][citation:6]。

王尚权 qq:2515162716 1185

Apache搭建基于域名的虚拟主机

Apache可以通过配置虚拟主机来实现在同一台服务器上托管多个网站,每个网站可以通过不同的域名访问。:虚拟主机允许您在同一台服务器上运行多个网站,而不需要为每个站点分配独立的服务器资源。这样可以更有效地利用硬件资源,降低网站运营成本。:要配置基于域名的虚拟主机,首先需要确保您的域名已经指向服务器的IP地址。这通常涉及到修改操作系统的hosts文件,将域名解析到服务器的IP地址上。:在Apache配置文件中,需要为每个域名创建一个虚拟主机块。每个虚拟主机块包含该网站的具体配置,如文档根目录、日志文件位置等。

wuyueyang1的博客 1688

S7-1200与ABB机器人进行SOCKET通信的具体方法示例

S7-1200与ABB机器人进行SOCKET通信的具体方法示例

Robot_PLC_HMI_Automation 3292

Apache 配置多个虚拟主机

Apache2服务器,配置虚拟主机

MouZhi 2024

CKS-CN考试之路----03

这题不需要去生成image和生成deployment所以只需要去检测对应的值即可。编辑/cks/docker/Dockerfile,修改最后第二行的值。编辑/cks/docker/deployment.yaml。

Q先生 824

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Apache 基于域名创建多个虚拟主机

实现目标:通过一台服务器发布多个网站 [root@localhost ~]# cd /usr/local/apache2/ //进入到Apache的安装目录下 [root@localhost apache2]# ls [root@localhost apache2]# cd conf/ //进入到Apache的配置文件下 [root@localhost conf]# ls [root@localhost conf]# cd extra/ //进入Apache的扩展功能文件下 [root@lo

wyyfpzy的博客 1327

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Windows系统中apache虚拟主机配置

参考文章如下: WINDOWS 下APACHE虚拟主机配置 Apache网站目录访问权限设置 首先,在Apache24文件夹中找到conf文件夹,并打开其中的extra文件夹,选择httpd-vhosts.conf文件,记事本方式打开。 大概在第33行会看到 这个就是一个标准的虚拟主机配置文件了,首先把这个文件进行复制,并在下面进行粘贴之后再修改,可以修改成例如 DocumentRoot是指路径,就是假设你在网页上搜索这个一个网站,这个网站储存在你本地的哪个文件夹里。 ServerName是指访问路径,

xpx_xqx的博客 1387

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

如何配置Apache虚拟主机【详细步骤】

第12行用于配置目录访问权限,设为Require local表示只允许本地访问,若允许所有访问,可设为Require all granted,若拒绝所有访问,可设为Require all denied。在操作系统中,hosts文件用于配置域名与IP地址之间的解析关系,当请求域名在hosts文件中存在解析记录时,可直接使用该记录,只有当不存在解析记录时,才通过DNS域名解析服务器进行解析。由于当前还没有配置虚拟主机,此时用htp:/laravel.test 访问的是Apache的默认主机。

zy1992As的博客 2492

用apache在本机配置多个基于ip的虚拟主机

用apache在本机配置多个基于ip的虚拟主机     在做网站的时候总会遇到这样一个麻烦:如果同时在做2个或两个以上的网站,但是,默认的apache的配置是只有一个网站,这样的话,切换起来很不方便。其实这个问题很好解决,就是把本机的apache配置成为虚拟服务器。但是,网上大多数教程的是教用apache如何配置基于域名的虚拟主机的,而在本机调试网站的时候

Tomstrong_369的专栏 1285

Apache中多个HTTPS虚拟主机的实现

转自http://blog.chinaunix.net/uid-20104120-id-4306742.html 要实现一个Apache服务器上提供多个SSL虚拟主机,可以: * 使用多域名SSL证书,可以实现一个IP,一个443端口上多个SSL虚拟主机; * 一个ip,为所有SSL虚拟主机配置单独的端口。比如,默认的虚拟主机使用443,其他的使用8080或8081等,且每个SSL虚  

lengxin337的专栏 1万+

基于Apache在本地配置多个虚拟主机站点

简单的说,打开httpd.conf 在最后加入如下内容:    DocumentRoot d:/AppServ/www2    ServerName 127.0.0.2:80    Options Indexes FollowSymLinks Multiviews    AllowOverride All    Order Allow,Deny    Allow from all"d:

plutohusky的专栏 1万+
上一篇: php读取sqlite数据库入门实例
下一篇: apache绑定二级域名与多个域名windows下设定方法
my_baby_2009
博客等级 码龄14年 31粉丝 38原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值