我怎么一点Apache的文档根目录在Ubuntu特定文件夹? [英] How do I point Apache document root to a specific folder in Ubuntu?

查看:112
本文介绍了我怎么一点Apache的文档根目录在Ubuntu特定文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,根点到/ var / WWW
我已经在/ var / WWW建立了两个文件夹

I have a site that the root points to /var/www I have set up two folders under /var/www


  1. /无功/网络/旧

  2. /无功/网络/新

对于旧的文件夹,我使用了下列拒绝任何访问:

for the old folder, I have used the following to deny any access:

touch /var/www/old/.htaccess && echo deny from all >> /var/www/old/.htaccess

我现在希望服务器指向根到/ var / WWW /新,因此,当人们访问 http://mysite.com的在/ var / WWW内容/新将服务,我该怎么办?

I now want the server to point the root to /var/www/new so that when people visit http://mysite.com the content in /var/www/new will serve, what should I do?

推荐答案

在Ubuntu的Apache配置位于的/ etc / Apache2的。应该有两个文件夹,站点可用 启用的站点 - 。启用了内部网站,是符号链接到配置文件的站点可用的。

In Ubuntu the Apache configuration is located at /etc/apache2. There should be two folders, sites-available and sites-enabled. Inside sites-enabled are symlinks to config files in sites-available.

您只需要更改文档根目录中的启动配置。那大概的/ etc / apache2的/启用站点-/ 000-默认

You simply have to change the document root in your activated configuration. Thats probably /etc/apache2/sites-enabled/000-default

看一看对于的DocumentRoot 并将其更改为 /无功/网络/新,然后重装你的apache。

Have a look for DocumentRoot and change it to /var/www/new, then reload your apache.

这篇关于我怎么一点Apache的文档根目录在Ubuntu特定文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆