Apache 配置多端口网站

时间:2022-09-11 11:28:01

跳过安装步骤。

1. apache安装目录/conf/httpd.conf,如果你是采用wamp集成环境,那么在 wamp/bin/apache下。

2.  在httpd.conf中,找到
#LoadModule vhost_alias_module
#Include conf/extra/httpd-vhosts.conf
去掉前面的#号,这一步是为了加载扩展配置 3. 找到apache安装目录/conf/extra/httpd-vhosts.conf。
打开文件找到 NameVirtualHost *:80,
比如我们要添加81的端口,在下面增加一行
Listen 81 4. 然后找到<VirtualHost *:80> ... </VirtualHost> ,复制一段修改为
<VirtualHost *:81>
DocumentRoot "D:/php"
ServerName localhost
ServerAlias localhost
</VirtualHost> 5. 配置目录权限
打开/conf/httpd.conf,找到Directory节点。
可以修改默认目录权限,也可以单独指定目录权限,分别是:
修改默认目录权限,即修改Directory节点
<Directory />
Options FollowSymLinks
     AllowOverride None
     Order deny,allow
       #Deny from all
    Allow from all
       #允许所有访问
     Satisfy all
    </Directory> 或者增加如下一段
<Directory "D:/php">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks #
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all #
# Controls who can get stuff from this server.
# # onlineoffline tag - don't remove
Order Allow,Deny
Allow from all </Directory>
6. 重启apache服务,查看localhost:81/index.php 已经可以正常运行了

Apache 配置多端口网站的更多相关文章

  1. Apache 配置多端口

    Apache 配置多端口,主要是以下步骤 1. 如果电脑是64位的,官网上下载WampServe,装的过程中如果出现msvcp110.dll丢失的话,解决办法如下: 1.1 首先是打开浏览器,在浏览器 ...

  2. XAMPP Apache 配置多端口和多域名方法

    我们在工作中经常遇到同时调试多个网站的情况,那么如何配置呢?就像平时访问网站一样,网站 a.com 与网站 b.com 截然不同.这都是常见现象,如果在局域网中要访问另外一台电脑上的多个网站,就需要使 ...

  3. Apache配置多个网站的方法

    Apache的虚拟主机是一种允许在同一台机器上,运行超过一个网站的解决方案.虚拟主机有两种,一种叫基于IP的(IP-based),另一种叫基于名字的(name-based).虚拟主机的存在,对用户来说 ...

  4. Apache配置多端口多站点

    配置httpd.conf 监听多个端口 复制代码 代码如下:# Listen: Allows you to bind Apache to specific IP addresses and/or # ...

  5. Apache配置基于端口号的虚拟主机 Apache virtual host configuration is based on the port

    有可能只有一个ip出口,但却有多个项目,那么就需要基于端口号架设虚拟主机. Step 1: 检查是否开启 httpd-vhosts.conf apache/conf/httpd.conf文件 # Vi ...

  6. apache配置多端口对应多个虚拟目录

    经常需要在本地调试网站,却又不喜欢在http://localhost/网站的文件夹名 且几个比较重要的项目我想直接用端口号以示区分,想达到的效果如下: http://localhost/ 默认80端口 ...

  7. Apache配置多个网站

    你可以全用本地私有ip地址创建多个站点 127.0.0.x,这个网段的所有ip都是指向本机的,并且可以区分,这是计算机的私有ip地址,供测试用的,配置方法如下 一.打开httpd.conf 1.从Se ...

  8. Apache 配置多端口 多虚拟主机 局域网访问

    \wamp\bin\apache\Apache2.4.4\conf\extra\httpd-vhosts.conf 修改如下 NameVirtualHost *:80          Documen ...

  9. apache virtualhost配置 apache配置多个网站

    第一步 apache下httpd.conf文件 启用模块LoadModule vhost_alias_module modules/mod_vhost_alias.so 第二步 apache下http ...

随机推荐

  1. Android:Activity生命周期

    Android是使用任务(Task)来管理活动的,一个任务就是一组存放在栈里的活动的集合,这个栈也被称作返回栈(Back Stack). 栈是一种后进先出的数据结构,在默认情况下,每当我们启动了一个新 ...

  2. Github 的一些基本操作

    1.创建一个新的repository: 先在github上创建并写好相关名字,描述.例如这样一个地址: https://github.com/test/test2.git 回到本地目录如hellowo ...

  3. sql常识-BETWEEN 操作符

    BETWEEN 操作符 操作符 BETWEEN ... AND 会选取介于两个值之间的数据范围.这些值可以是数值.文本或者日期. SQL BETWEEN 语法 SELECT column_name(s ...

  4. Welcome Docker to SUSE Linux Enterprise Server【水平有限,中英对比,求纠错】

      原文:Welcome Docker to SUSE Linux Enterprise Server Lightweight virtualization is a hot topic these ...

  5. SQL Queries and Multi-Org Architecture in Release 12

    In this Document   Abstract   History   Details   Previous Releases   Release 12   Multi-Org Session ...

  6. Centos 6&period;5使用vsftpd配置FTP服务器教程

    Centos 6.5使用vsftpd配置FTP服务器教程什么是vsftpd vsftpd是一款在Linux发行版中最受推崇的FTP服务器程序.特点是小巧轻快,安全易用.vsftpd 的名字代表”ver ...

  7. Network POJ - 3694 (连通图标求桥)

    有上述两个数组定义可知:对于某点root,其有一儿子v,则有: 1.     如果dfn[root]<=low[v]此点是割点(对于dfs树的根,即最初节点需要两个儿子才是割点) 2.      ...

  8. &lbrack;Tensorflow&rsqb; RNN - 02&period; Movie Review Sentiment Prediction with LSTM

    From: Predicting Movie Review Sentiment with TensorFlow and TensorBoard Ref: http://www.cnblogs.com/ ...

  9. topcoder srm 400 div1

    problem1 link 枚举指数,然后判断是不是素数即可. problem2 link 令$f[len][a][b][r]$(r=0或者1)表示子串$init[a,a+len-1]$匹配$goal ...

  10. String为什么不可变

    转载:http://www.importnew.com/7440.html https://www.cnblogs.com/leskang/p/6110631.html 什么是不可变对象? 众所周知, ...