什么是目录结构应该是多个域的单一用户下? (阿帕奇) [英] What's the directory structure should be for multiple domains under a single user? (apache)

查看:158
本文介绍了什么是目录结构应该是多个域的单一用户下? (阿帕奇)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些VPS(与的cPanel朋友的Apache服务器)上的帐户,并在那里我有一个public_html目录。
我们在那里有大约5-6网站:

I have an account on some VPS(friend's apache server with cPanel) and there I have one public_html directory. We have in there about 5-6 websites:

/home/myusername/public_html/domain-1.name/index.php
/home/myusername/public_html/domain-2.name/index.php

但我不喜欢这样,我想orginise的更好,能够为每个网站单独和孤立一些东西。
那么,如果我创造这样的:

but I don't like this way, I'd like to orginise it better and be able to separate and isolate some stuff for each website. So what if I create like that:

/home/myusername/websites/domain-1.name/public_html/index.php

/home/myusername/websites/domain-2.name/public_html/index.php and so on

难道是structurising网页目录的正确方法吗?
并会像阿帕奇的工作?
或许有出有其他约定或共同解决方法?

Would it be a correct way of structurising web directories? And would apache work like that? Perhaps there are out there some other conventions or common workarounds?

感谢

推荐答案

这是完全正常的。其实我强烈建议不要使用的域文件夹的作为文档根目录作为典型的Web应用程序也将包含不公开accessable数据(例如配置文件,管理脚本,版本控制文件等。 )

This is perfectly fine. In fact I'd highly recommend against using the domain folder as the document root as typical web application will also contain data that is not publically accessable (e.g. configuration files, management scripts, version control files, etc.)

我个人preFER名称的htdocs ,我把我的网站在 / SRV / HTTP

Personally I prefer the name htdocs and I keep my sites under /srv/http

例如:

/srv/http/user1/domain1/htdocs/
/srv/http/user1/domain2/htdocs/
/srv/http/user1/domain3/htdocs/
/srv/http/user2/domain4/htdocs/
/srv/http/user3/domain5/htdocs/

这样,你可以设置的DocumentRoot 的htdocs 目录,并把那并不意味着是其他的东西由Web服务器在域目录的一个不同的子目录递送

That way you can set the DocumentRoot to the htdocs directory and put other stuff that is not meant to be delivered by the web server in a different sub directory of the domain directory.

这篇关于什么是目录结构应该是多个域的单一用户下? (阿帕奇)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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