Apache配置虚拟主机后让其他电脑访问
2024-08-24 13:01:56
关于Apache配置虚拟主机后在局域网中让其他电脑访问
#test1#
NameVirtualHost *:80
ServerName www.t1.com
DocumentRoot "/Users/me/www/test1"
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
#test2#
NameVirtualHost *:80
ServerName www.t2.com
DocumentRoot "/Users/me/www/test2"
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
#错误显示#
php_flag display_errors on
php_value error_reporting 2039
如上所示,共配置了2个虚拟主机:
www.t1.com
www.t2.com
如果我本机 的IP地址是:192.168.1.123
那么在 局域网内访问此IP看到的网站就是上面配置中第一个配置的虚拟主机,本案例中就是:www.t1.com
如果想要访问别的虚拟主机,那么只需要把对应的主机放置到最前面即可!
【备注】
Options FollowSymLinks 表示不列出目录下的文件,如果要列出文件列表,则使用 Options Indexes FollowSymLinks
C:\Windows\System32\drivers\etc 目录下 hosts文件中:最后添加一行:127.0.0.1 www.t1.com
Linux 系统下,是在 /etc/hosts 文件中。(本地路由优先!)
最新文章
- 立即执行函数: (function(){...})() 与 (function(){...}()) 有什么区别?
- 【Logcat】在Android Studio中查看android APP 日志
- 使用WinRAR创建可执行程序(例如:Java程序打包 成exe)
- javaEE基础
- c# 文件遍历
- push
- HashTable、HashSet和Dictionary的区别
- POJ3616 Milking Time 简单DP
- 通过web修改svn用户密码
- BestCoder Round 59 (HDOJ 5500) Reorder the Books
- Intellij idea插入表数据【在UI界面插入出错】
- poj 2905 双向队列(待补充)
- Easyui Datagrid 修改显示行号列宽度
- Python-爬取妹子图(单线程和多线程版本)
- Chapter 5 Blood Type——20
- 雷林鹏分享:url中加号引发的错误
- Delphi7安装
- 项目总结之Oauth2.0免登陆及相关知识点总结
- Springboot 2.0 - 集成redis
- Xcode6 itunes完美打包api 方法
热门文章
- AI逻辑实现-取舍行为树还是状态机
- There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows.问题解决
- DeDeCMS织梦的采集教程
- VR资源浏览网站
- mysql中什么是逻辑备份
- mongodb 安装(windows mongodb 安装)
- listView解决滑动时黑色背景问题
- mybatis由浅入深day01_5mybatis开发dao的方法(5.1SqlSession使用范围_5.2原始dao开发方法)
- Redis(二)-- 发布订阅、事务、安全、持久化
- Apache nutch1.5 &; Apache solr3.6