地方发展,阿帕奇VS开发 - 文件权限 [英] Local Development, Apache vs Developer - file permissions

查看:103
本文介绍了地方发展,阿帕奇VS开发 - 文件权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感兴趣的是使用LAMP组合设置本地PHP测试/开发环境。结果
我想用Eclipse的插件的PHP(我通常用java工作,我非常熟悉Eclipse)。

I am interested in setting up a local php testing / development environment using the lamp stack.
I would like to use the php plugin for eclipse (I typically work with java and am very familiar with eclipse).


  • 首先,是正确的做法是在Apache的/ var / www目录内局部直接开发我的网站?

  • 如果这是确定,有人可以介绍如何正确设置WWW目录的权限,使日食(未以root身份运行)可以访问该目录中读取/修改PHP文件?

这是严格的地方发展,所以我认为安全性不高的问题。

This is strictly for local development so I assume security isn't as high of an issue.

推荐答案

如果您preFER把它在其他地方,比如你的Eclipse工作空间目录,你可以改变的Apache的DocumentRoot(或用不同的DocumentRoot创建一个虚拟主机) 。编辑Apache的httpd.conf文件,并在最后补充一点:

If you prefer to put it somewhere else, like your Eclipse workspace directory, you can change Apache's DocumentRoot (or create a VirtualHost with a different DocumentRoot). Edit Apache's httpd.conf file, and add this at the end:

NameVirtualHost *:80
<VirtualHost *:80>
  ServerName mytestserver.localhost
  DocumentRoot /path/to/project/dir
</VirtualHost>

中的* s时,可以保持原样;这意味着不管你的IP地址,他们将工作。

The *s can be left as-is; that means they will work regardless of your IP address.

该服务器名称可以是任何你想要的,只要你在你的/ etc中添加相应的条目/ hosts文件,例如:

The ServerName can be anything you want, as long as you add a corresponding entry in your /etc/hosts file, e.g.:

127.0.0.1 mytestserver.localhost

我经常让我的所有本地服务器中的.localhost结尾,就像一个约定。

I often make all my local servers end in ".localhost", just as a convention.

最后,重新启动Apache。然后你就可以在访问 HTTP服务器://mytestserver.localhost 。根据需要重复使用多个虚拟主机,每个指向一个不同的项目。

Finally, restart Apache. Then you can access the server at http://mytestserver.localhost. Repeat as necessary to use multiple virtual hosts, each pointing to a different project.

只要文件可以由每个人,这通常是默认读取,您应该罚款。

As long as the files can be read by everyone, which is usually the default, you should be fine.

这篇关于地方发展,阿帕奇VS开发 - 文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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