php linux中的htdocs路径

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1582851/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 03:10:30  来源:igfitidea点击:

htdocs path in linux

phphtmllighttpd

提问by Shishant

I am working on linux server through ssh and want to know where to put html and php files (the htdocs folder) but its seems to me the servers is running lighttpd

我正在通过 ssh 在 linux 服务器上工作,想知道将 html 和 php 文件(htdocs 文件夹)放在哪里,但在我看来服务器正在运行 lighttpd

My directory structure looks something like this.

我的目录结构看起来像这样。

alt text

替代文字

回答by Horst Gutmann

That totally depends on your server configuration so your only reliable source of information should be lighttpd's configuration file which (if installed globally) should normally be within the /etc folder (e.g. /etc/lighttpd/lighttpd.conf).

这完全取决于您的服务器配置,因此您唯一可靠的信息来源应该是 lighttpd 的配置文件,它(如果全局安装)通常应该在 /etc 文件夹中(例如 /etc/lighttpd/lighttpd.conf)。

Popular locations for the htdocs folder are /var/www or somewhere within /srv.

htdocs 文件夹的常用位置是 /var/www 或 /srv 中的某个位置。

回答by Pascal MARTIN

I would say it kind of depends on the configuration of your server.

我会说这取决于您的服务器的配置。

Still, maybe something like /var/wwwwould do, if it exists : this is the default, with many Linux distributions, for the HTTP root folder.

尽管如此,/var/www如果存在的话,也许会做类似的事情:这是 HTTP 根文件夹的默认设置,对于许多 Linux 发行版。

If it's not there, you should try to find the configuration file for Lighttpd (something like lighttpd.conf, probably somewhere under /etc) ; in that file, there should be the path for the server.document-root.
For more informations : Lighttpd - TutorialConfiguration

如果它不存在,您应该尝试找到 Lighttpd 的配置文件(类似于lighttpd.conf,可能在 下/etc);在那个文件中,应该有server.document-root.
有关更多信息:Lighttpd - 教程配置

回答by user7025106

when xampp is installed - /opt/lampp/htdocs

安装 xampp 时 - /opt/lampp/htdocs

回答by xintron

Actually, I believe that Arch Linux uses /srv/http as default in the apache-config (not sure about lighttpd though). However, it's easy to change.

实际上,我相信 Arch Linux 在 apache-config 中使用 /srv/http 作为默认值(但不确定 lighttpd)。然而,改变很容易。

Other than that, just look in the lighttpd-configuration file and you'll find your answer :)

除此之外,只需查看 lighttpd 配置文件,您就会找到答案:)

回答by xintron

Just looked it up. Arch Linux sets the documentroot to /src/http for both apache and lighttpd fyi.

刚查了一下。Arch Linux 将 apache 和 lighttpd 的 documentroot 设置为 /src/http 仅供参考。

回答by NawaMan

'/var/www' is where you should look. Most distros (actually, I don't know any that is not) put it there.

' /var/www' 是你应该看的地方。大多数发行版(实际上,我不知道哪个不是)把它放在那里。