⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 security.apache.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Installed as an Apache module</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="security.cgi-bin.shell.html">Case 4: PHP parser outside of web tree</a></div> <div class="next" style="text-align: right; float: right;"><a href="security.filesystem.html">Filesystem Security</a></div> <div class="up"><a href="security.html">Security</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div>   <h1>Installed as an Apache module</h1>   <p class="simpara">    When PHP is used as an Apache module it inherits Apache&#039;s user    permissions (typically those of the &quot;nobody&quot; user). This has several    impacts on security and authorization. For example, if you are using    PHP to access a database, unless that database has built-in access    control, you will have to make the database accessible to the    &quot;nobody&quot; user. This means a malicious script could access and modify    the database, even without a username and password. It&#039;s entirely    possible that a web spider could stumble across a database    administrator&#039;s web page, and drop all of your databases. You can    protect against this with Apache authorization, or you can design    your own access model using LDAP, <var class="filename">.htaccess</var> files, etc. and include    that code as part of your PHP scripts.   </p>   <p class="simpara">    Often, once security is established to the point where the PHP user    (in this case, the apache user) has very little risk attached to it,    it is discovered that PHP is now prevented from writing any files    to user directories. Or perhaps it has been prevented from accessing    or changing databases. It has equally been secured from writing    good and bad files, or entering good and bad database transactions.   </p>   <p class="simpara">    A frequent security mistake made at this point is to allow apache    root permissions, or to escalate apache&#039;s abilities in some other    way.   </p>   <p class="simpara">    Escalating the Apache user&#039;s permissions to root is extremely    dangerous and may compromise the entire system, so sudo&#039;ing,    chroot&#039;ing, or otherwise running as root should not be considered by    those who are not security professionals.   </p>   <p class="simpara">    There are some simpler solutions. By using    <a href="features.safe-mode.html#ini.open-basedir" class="link">open_basedir</a> you can control and restrict what    directories are allowed to be used for PHP. You can also set up    apache-only areas, to restrict all web based activity to non-user,    or non-system, files.   </p>  </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="security.cgi-bin.shell.html">Case 4: PHP parser outside of web tree</a></div> <div class="next" style="text-align: right; float: right;"><a href="security.filesystem.html">Filesystem Security</a></div> <div class="up"><a href="security.html">Security</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -