linux下配置虚拟域名

1.hosts文件位置!

/etc/hosts

2.增加一行

127.0.0.1 xxxxx

3.修改apache中的vhosts

 vi /etc/httpd/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin 192.168.1.66/admin
DocumentRoot "/usr/local/apache2/htdocs/tp5admin"
ServerName 192.168.1.66
</VirtualHost>

4.开启vhosts

Include conf/extra/httpd-vhosts.conf

5.重启apache

service httpd restart

解决The requested URL /login was not found on this server

<Directory />
AllowOverride All
Order allow,deny
Allow from all
</Directory>
DocumentRoot "/usr/local/apache2/htdocs"
<Directory "/usr/local/apache2/htdocs">
#
# 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.4/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:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All #
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>

开启重写模块

LoadModule rewrite_module modules/mod_rewrite.so

最新文章

  1. 被忽略的js细节
  2. 大一上学期的一点小疑惑,代码验证ok
  3. 安卓开发_浅谈ContextMenu(上下文菜单)
  4. [Js]基础知识
  5. 洗清UI自动化鸡肋说的不白之冤
  6. ThinkPHP整合百度Ueditor图文教程
  7. oc拨打电话
  8. StarUML---推荐一款UML工具(很好很强大)
  9. Java Socket通信以及可能出现的问题解决
  10. Qt之QDomDocument操作xml文件-模拟ini文件存储
  11. pydoc用法
  12. Pycharm下面出现No R interpreter defined
  13. Unity shader学习之高光反射光照模型
  14. 【2017-04-20】Sql字符串注入式攻击与防御,实体类,数据访问类
  15. springmvc相关
  16. 混乱之子第七季/全集Sons of Anarchy迅雷下载
  17. [转载]eclipse自动同步插件filesync的使用
  18. Web应用三种部署方式的优缺点
  19. 安装部署VMware vSphere 5.5文档 (6-3) 安装配置AD域控制器
  20. ubuntu zip解压

热门文章

  1. Service不完全解析
  2. jsp指令介绍
  3. javascript中对象两种创建方式
  4. RabbitMQ学习之ConntectionFactory与Conntection的认知
  5. Robot Framework(二)测试数据语法
  6. 面试题-mysql
  7. 获取Centos7安装Docker各种姿势(指定版本)(转载)
  8. BZOJ 1691 [Usaco2007 Dec]挑剔的美食家 multiset_排序_贪心
  9. js脚本捕获页面 GET 方式请求的参数?其实直接使用 window.location.search 获得
  10. elasticsearch的mapping