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

linux下配置虚拟域名的更多相关文章

  1. Linux下Apache虚拟主机配置

    Linux下Apache虚拟主机的三种配置.这样可以实现一台主机架构多个独立域名网站.其中基于域名的最为常见.性价比也最高.下面PHP程序员雷雪松详细的讲解下Linux下Apache虚拟主机配置的具体 ...

  2. Linux下配置多个tomcat多个域名

    Linux下配置多个tomcat多个域名复制tomcat:mkdir /home/server/testcp -rf /home/server/shichuan/* /home/server/test ...

  3. Linux 下 FTP虚拟用户的使用配置

    Linux下FTP虚拟用户的使用配置 Linux的FTP服务支持3种用户: 1.匿名帐户 2.本地帐户 3.虚拟用户 为什么要使用虚拟用户: 匿名帐户可以很好的保证FTP服务器的安全性,但是,对匿名用 ...

  4. 细说Linux下的虚拟主机那些事儿

    细说Linux下的虚拟主机那些事儿 我们知道Linux操作系统是目前在服务器上应用广泛的操作系统.在Linux操作系统下的虚拟主机是不是就是我们常说的Linux虚拟主机呢?其实从专业方面说并不是,它是 ...

  5. Linux下配置PHP开发环境

    转载于: http://www.uxtribe.com/php/405.html 该站下有系列PHP文章. 在Linux下搭建PHP环境比Windows下要复杂得多.除了安装Apache,PHP等软件 ...

  6. 一步一步教你如何在linux下配置apache+tomcat(转)

    一步一步教你如何在linux下配置apache+tomcat   一.安装前准备. 1.   所有组件都安装到/usr/local/e789目录下 2.   解压缩命令:tar —vxzf 文件名(. ...

  7. Linux下配置Tomcat服务器

    Linux下配置Tomcat服务器和Windows下其实差不多,可以去官网下载安装包释放或者在线下载,只是当时下载的windows.zip文件,现在下载.tar.gz格式的即可,下面使用命令行的方式安 ...

  8. Linux 下配置 SoftEther Client

    我经常使用的代理有 SSH, GoAgent, FreeGate, VPN, HttpProxy 等等,不过 SoftEther 应该是我用过的最快.最稳定的 VPN 协议. Windows 下配置 ...

  9. The requested URL / was not found on this server——Apache配置虚拟域名后无法访问localhost

    今天为了做项目,在Apache中配置了项目域名,成功访问.但是忽然发现要访问localhost突然出现The requested URL / was not found on this server. ...

随机推荐

  1. 「Canvas」玩转

    作者: 糖少 简介 Canvas是 HTML5 新增的,一个可以使用脚本(通常为JavaScript)在其中绘制图像的 HTML 元素.它可以用来制作照片集或者制作简单(也不是那么简单)的动画,甚至可 ...

  2. 基于Apache Thrift的公路涵洞数据交互实现原理

    基于Apache Thrift的公路涵洞数据交互实现原理 Apache Thrift简介 Apache Thrift(以下简称为“Thrift”) 是 Facebook 实现的一种高效的.支持多种编程 ...

  3. jQuery hooks源码学习

    段落不够清晰,待整理 看jQuery源码的时候,经常见到含有hooks标志的对象,如cssHooks, attrHooks, propHooks, valHooks. 下面对其中的一段进行解读. jQ ...

  4. os.clock()导致的bug

    os.clock () 功能:返回一个程序使用CPU时间的一个近似值 最近做了一个功能,这个功能需要统计时间间隔,例如每隔0.5秒做一次调用. 我用了os.clock()去统计时间,结果在pc机上都没 ...

  5. href 与 src

    href:常用有两个标签<a>和<link> 1.<a href="http://www.w3school.com.cn">W3School&l ...

  6. Educational Codeforces Round 35

    Nearest Minimums 相同的数里最小的数里的最小距离 Solution Two Cakes Solution Three Garlands 瞎比试 Solution Inversion C ...

  7. WordPress浏览次数统计插件:WP-Postviews使用

    WP-Postviews使用 1.要让你的博客在页面上显示浏览次数,你需要修改你博客当前使用的主题,在主循环中插入以下代码: 1 <?php if(function_exists('the_vi ...

  8. fabric.js 翻转,复制粘贴,隐藏, 删除,历史记录,撤销, 剪切, 图层,组合打散,锁定等功能

    用vue写的 显示,隐藏 hide(){ this.canvas.getActiveObject().set('opacity', 0).setCoords(); this.canvas.reques ...

  9. https://coderwall.com/p/7smjkq/multiple-ssh-keys-for-different-accounts-on-github-or-gitlab

    Multiple SSH keys for different accounts on Github or Gitlab SSH GIT GITLAB GITHUB Sometimes you nee ...

  10. OpenCV中GPU模块使用

    CUDA IT168的文章系列: Cuda的初始化:http://tech.it168.com/a2011/0715/1218/000001218458.shtml OpenCV: OpenCV中GP ...