今天配置好Apache+PHP+MySQL
但是apache默认DocumentRoot是/var/www
想把它改到我Windows下进行测试的k:/wwwroot
把 apache2.conf 翻了好几遍,连DocumentRoot都搜不到
然后再仔细的看apache2.conf
终于发现有这么一句:
Include /etc/apache2/sites-enabled/
然后打开这个目录,看到一个 000-default
打开一看,全明白了。
改吧:
DocumentRoot /media/sda3/wwwroot

重启Apache2服务即可。

sudo /etc/init.d/apache2 restart

http://www.cnblogs.com/xxcainiao/archive/2008/07/21/1247802.html

Ubuntu中Apache修改DocumentRoot(修改网站根目录)的更多相关文章

  1. 【转载】ASP.NET中Server.MapPath方法获取网站根目录总结

    在ASP.NET网站应用程序中,可以通过Server.MapPath方法来获取跟服务器有关的目录信息,如获取网站的根目录.获取当前代码文件所在的目录路径.获取当前代码所在路径的上级路径等.Server ...

  2. 修改Tomcat的网站根目录

    想把Tomcat的默认网站根目录修改成自己指定的目录,比如:F:/MyWeb.这样以后把自己写的index.jsp放到该目录下,就能通过http://localhost:8080/index.jsp来 ...

  3. phpstudy修改端口及网站根目录和访问 localhost 显示目录文件夹

    一.其它选项菜单=>phpStudy设置=>端口常规设置(勾选允许目录列表): 二. Apache http端口:80 网站目录:D:\phpStudy\PHPTutorial\WWW 默 ...

  4. ubuntu中apache的ssl证书配置及url重写

    一.https原理 借用网上的图(图片来源: https://www.cnblogs.com/xiohao/p/9054355.html ),用到了对称加密和非对称加密.    二.ubuntu的ap ...

  5. linux -- ubuntu 安装apache后,修改默认路径

    默认由apt方式安装的Apache,指定网页主目录位于:/var/www 而系统/var所分到的空间太少,所以要换路径 1.修改默认网站目录 ubuntu8.10下修改apache2的默认文档目录 默 ...

  6. Ubuntu中由root用户修改为普通用户的办法

    比如你的普通用户名是test 目前是root用户 键入命令 su - test 就可以了

  7. Ubuntu中APache+mod_pyhon

    安装apache 1.sudo apt-get install Apache2 Apxs(Apache extension tool既apache扩展模块的工具)的安装: 1.sudo apt-get ...

  8. Ubuntu 中 apache 开启 rewrite 模块

    ubuntu14.04中安装好apache2.4之后默认rewrite模块是不开启的,项目public目录下的.htaccess文件就用不了,在浏览器中访问网页总是报500错误,原因就是这个. 执行下 ...

  9. Ubuntu基于Apache为自己的网站开启HTTPS

    暂时放这里链接,之后整理 https://www.deanhan.cn/ubuntu-apache-https.html

随机推荐

  1. uva146 ID码

    /*极水的题...*/ #include"iostream"#include"stdio.h"#include"stdlib.h"#incl ...

  2. react-native 学习

    官网 https://facebook.github.io/react-native/docs/getting-started.html#content 下载 npm install -g react ...

  3. Lucene搜索方法总结

    转自:summerbell http://www.iteye.com/topic/569358 1.多字段搜索 使用 multifieldqueryparser 可以指定多个搜索字段. query q ...

  4. C#中将ListView中数据导出到Excel

    首先 你需要添加引用Microsoft Excel 11.0 Object Library 添加方法:选择项目->引用->右击“添加引用”->选择COM 找到上面组件—>点击“ ...

  5. aggregate运用

    测试环境:192.168.1.55 mongo 192.168.1.55:30001show dbsuse gwgps 测试目标,求出两个班的总数,人数,平均分数等. 1. 数据准备db.person ...

  6. DS实验题 Dijkstra算法

    参考:Dijkstra算法 数据结构来到了图论这一章节,网络中的路由算法基本都和图论相关.于是在拿到DS的实验题的时候,决定看下久负盛名的Dijkstra算法. Dijkstra的经典应用是开放最短路 ...

  7. eclipse编译异常修正:the project cannot be built until its prerequisite...

    close错误的project,重新open , 再 clean下 .

  8. Yii源码阅读笔记(十三)

    Model类,集中整个应用的数据和业务逻辑: namespace yii\base; use Yii; use ArrayAccess; use ArrayObject; use ArrayItera ...

  9. hardware control language

    Computer Systems A Programmer's Perspective Second Edition We then provide some background on digita ...

  10. linux 查看系统状态方法

    Linux下如何查看系统启动时间和运行时间 1.uptime命令输出:16:11:40 up 59 days, 4:21, 2 users, load average: 0.00, 0.01, 0.0 ...