关于APACHE的配置文件httpd.conf[转](二)

 更新时间:2016年11月25日 15:17  点击:2266
#ExtendedStatus On <br>
  Apache服务器可以通过特殊的HTTP请求,来报告自身的运行状态,打开这个 <br>
ExtendedStatus 参数可以让服务器报告更全面的运行状态信息。
 <br>
主服务器设置 <br>
  Apache服务器需要各种设置,以定义自己使用各种参数以提供Web服务。对于使用虚拟主机的情况,除了在虚拟主机的定义项中覆盖的设置之外(有的设置必须重新定义),这里的设置也是虚拟主机的缺省设置。
 <br>
  Port 80 <br>
  Port定义了Standalone模式下httpd守护进程使用的端口,标准端口是80。这个选项只对于以独立方式启动的服务器才有效,对于以inetd方式启动的服务器则在inetd.conf中定义使用哪个端口。
 <br>
  在Unix下使用80端口需要root权限,一些管理员为了安全的原因,认为 httpd 服务器不可能没有安全漏洞,因而更愿意使用普通用户的权限来启动服务器,这样就不能使用80端口及其他小于1024的端口,而必须使用大于 1024的端口来启动httpd,一般情况下8000或8080也是常用的端口。而Apache httpd服务器本身可以在以root权限打开80端口后再改变为普通用户身份进行运行,这样就减少了危险性,因而就不需要考虑这个安全问题。但是如果普通用户也想安装配置自己的WWW服务器,那么就不得不使用大于1024的端口。
 <br>
  User nobody <br>
  Group nogroup <br>
  User和Group配置是Apache的安全保证,Apache在打开端口之后,就将其本身设置为这两个选项设置的用户和组权限进行运行,这样就降低了服务器的危险性。这个选项也只用于 Standalone模式,inetd模式在inetd.conf中指定运行Apache的用户。由于服务器必须执行改变身份的setuid()操作,因此初始进程应该具备root权限,如果是使用非root用户来启动Aapche,这个配置就不会发挥作用。
 <br>
  缺省设置为nobody和nogroup,这个用户和组在系统中不拥有文件,保证了服务器本身和由它启动的CGI 进程没有权限更改文件系统。在某些情况下,例如为了运行CGI与Unix交互,也需要让服务器来访问服务器上的文件,如果仍然使用nobody和nogroup,那么系统中将会出现属于nobody的文件,这对于系统安全是不利的,因为其他程序也会以nobody和nogroup的权限执行某些操作,就有可能访问这些nobody拥有的文件,造成安全问题。一般情况下要为Web服务设定一个特定的用户和组,同时在这里更改用户和组设置。
IIS服务器完全配置实现asp,cgi,perl和php+mysql
IIS服务器完全配置 现在我们要使IIS实现ASP,CGI,PERL和PHP+MYSQL
所需软件(都要是For Windows的):
ActivePerl、PHP、MYSQL
一.ASP支持:
不用说了吧,什么都不用做,本身就支持ASP运行。
二.CGI,PERL支持:
1.安装ActivePerl
运行下载的ActivePerl一步一步安装(注意:安装路径请选择到根目录的/usr/下(默认是perl),这样对以后调试程序省很多事)
2.配置IIS
打开"Internet 信息服务"(在'管理工具'里),点开默认站点的属性,如图:
选择 "主目录" 选项卡,然后点 "配置(G)...",弹出如图对话框
然后 "添加(D)" 如下图:
推荐"c:usrinperl.exe" 记得一定要在后面加上" %s %s ",不然没法执行cgi的,确定后。用同样的方法添加扩展名.pl,如图:
完成后如图:
现在你的IIS已经支持cgi,perl了!
三.PHP、MYSQL支持:
1.安装PHP和MYSQL
运行下载的PHP和MYSQL一步一步安装就行了(装到哪里都行,一般现在网上流行的都是安装过的PHP,没有安装程序,你只需要把下载的压缩包解压缩出来就行了,放到如:c:php下)
2.PHP支持:
2.1 拷贝php目录下dlls文件夹里所有文件到c:windowssystem32下
2.2配置IIS:和刚才配置cgi一样,添加.php 如下图:
完成后如下图:
最后,把如图:
这里的 "执行权限" 该成:"脚本和可执行文件" 然后确定ok! 现在你的IIS已经完全支持PHP+MYSQL了!
一、下载MySQL数据库(ODBC)驱动程序和MySQL数据库系统程序
1.MySQL数据库(ODBC)驱动程序下载地址为: http://mysql.com/Downloads/MyODBC/myodbc-2.50.36-nt.zip 、 http://download.sourceforge.net/pub/mirrors/mysql/Downloads/MyODBC/myodbc-2.50.36-nt.zip 或者 http://www.fykx.net/download/php/myodbc-2.50.36-nt.zip(1457KB)
2.MySQL数据库系统程序下载地址为: http://www.mysql.com/Downloads/MySQL-3.23/mysql-3.23.30-gamma-win.zip (9632KB)或者是 http://www.fykx.net/download/php/mysql-3.23.30-gamma-win.zip
二、程序安装
1.安装MySQL数据库(ODBC)驱动程序(Windows系统下必须安装)
2.安装MySQL数据库系统程序,一般安装在系统默认位置“C:MySQL”,但要考虑你的服务器是否作为网络数据库服务器,如果要在此服务器上建立上百个数据库用户,就应该安装在空间比较大硬盘分驱上,以免今后不必要的麻烦和繁琐的设置。
Satisfy directive
Syntax: Satisfy 'any' or 'all'
Default: Satisfy all
Context: directory, .htaccess
Status: core
Compatibility: Satisfy is only available in Apache 1.2 and later
Access policy if both allow and require used. The parameter can be either 'all' or 'any'. This directive is only useful if access to a particular area is being restricted by both username/password and client host address. In this case the default behavior ("all") is to require that the client passes the address access restriction and enters a valid username and password. With the "any" option the client will be granted access if they either pass the host restriction or enter a valid username and password. This can be used to password restrict an area, but to let clients from particular addresses in without prompting for a password.
See also require and mod_access.
--------------------------------------------------------------------------------
ScoreBoardFile directive
Syntax: ScoreBoardFile filename
Default: ScoreBoardFile logs/apache_status
Context: server config
Status: core
The ScoreBoardFile directive is required on some architectures to place a file that the server will use to communicate between its children and the parent. The easiest way to find out if your architecture requires a scoreboard file is to run Apache and see if it creates the file named by the directive. If your architecture requires it then you must ensure that this file is not used at the same time by more than one invocation of Apache.
If you have to use a ScoreBoardFile then you may see improved speed by placing it on a RAM disk. But be careful that you heed the same warnings about log file placement and security.
Apache 1.2 and above:
Linux 1.x users might be able to add -DHAVE_SHMGET -DUSE_SHMGET_SCOREBOARD to the EXTRA_CFLAGS in your Configuration. This might work with some 1.x installations, but won't work with all of them. (Prior to 1.3b4, HAVE_SHMGET would have sufficed.)
<FilesMatch>
Syntax: <FilesMatch regex> ... </FilesMatch>
Context: server config, virtual host, .htaccess
Status: core
Compatibility: only available in Apache 1.3 and above.
The <FilesMatch> directive provides for access control by filename, just as the <Files> directive does. However, it accepts a regular expression. For example:
     <FilesMatch ".(gif|jpe?g|png)$">
would match most common Internet graphics formats.
See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received
--------------------------------------------------------------------------------
Group directive
Syntax: Group unix-group
Default: Group #-1
Context: server config, virtual host
Status: core
The Group directive sets the group under which the server will answer requests. In order to use this directive, the stand-alone server must be run initially as root. Unix-group is one of:
A group name
Refers to the given group by name.
# followed by a group number.
Refers to a group by its number.
It is recommended that you set up a new group specifically for running the server. Some admins use user nobody, but this is not always possible or desirable.
Note: if you start the server as a non-root user, it will fail to change to the specified group, and will instead continue to run as the group of the original user.
Special note: Use of this directive in <VirtualHost> requires a properly configured suEXEC wrapper. When used inside a <VirtualHost> in this manner, only the group that CGIs are run as is affected. Non-CGI requests are still processed as the group specified in the main Group directive.
SECURITY: See User for a discussion of the security considerations.
--------------------------------------------------------------------------------
MaxRequestsPerChild directive
Syntax: MaxRequestsPerChild number
Default: MaxRequestsPerChild 0
Context: server config
Status: core
The MaxRequestsPerChild directive sets the limit on the number of requests that an individual child server process will handle. After MaxRequestsPerChild requests, the child process will die. If MaxRequestsPerChild is 0, then the process will never expire.
Setting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
it limits the amount of memory that process can consume by (accidental) memory leakage;
by giving processes a finite lifetime, it helps reduce the number of processes when the server load reduces.
This directive has no effect on Win32.
NOTE: For KeepAlive requests, only the first request is counted towards this limit. In effect, it changes the behavior to limit the number of connections per child.
--------------------------------------------------------------------------------
MaxSpareServers directive
Syntax: MaxSpareServers number
Default: MaxSpareServers 10
Context: server config
Status: core
The MaxSpareServers directive sets the desired maximum number of idle child server processes. An idle process is one which is not handling a request. If there are more than MaxSpareServers idle, then the parent process will kill off the excess processes.
Tuning of this parameter should only be necessary on very busy sites. Setting this parameter to a large number is almost always a bad idea.
This directive has no effect when used with the Apache Web server on a Microsoft Windows platform.
See also MinSpareServers and StartServers.
--------------------------------------------------------------------------------
MinSpareServers directive
Syntax: MinSpareServers number
Default: MinSpareServers 5
Context: server config
Status: core
The MinSpareServers directive sets the desired minimum number of idle child server processes. An idle process is one which is not handling a request. If there are fewer than MinSpareServers idle, then the parent process creates new children at a maximum rate of 1 per second.
[!--infotagslink--]

相关文章

  • php读取zip文件(删除文件,提取文件,增加文件)实例

    下面小编来给大家演示几个php操作zip文件的实例,我们可以读取zip包中指定文件与删除zip包中指定文件,下面来给大这介绍一下。 从zip压缩文件中提取文件 代...2016-11-25
  • Jupyter Notebook读取csv文件出现的问题及解决

    这篇文章主要介绍了JupyterNotebook读取csv文件出现的问题及解决,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教...2023-01-06
  • Photoshop打开PSD文件空白怎么解决

    有时我们接受或下载到的PSD文件打开是空白的,那么我们要如何来解决这个 问题了,下面一聚教程小伙伴就为各位介绍Photoshop打开PSD文件空白解决办法。 1、如我们打开...2016-09-14
  • 解决python 使用openpyxl读写大文件的坑

    这篇文章主要介绍了解决python 使用openpyxl读写大文件的坑,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2021-03-13
  • C#实现HTTP下载文件的方法

    这篇文章主要介绍了C#实现HTTP下载文件的方法,包括了HTTP通信的创建、本地文件的写入等,非常具有实用价值,需要的朋友可以参考下...2020-06-25
  • SpringBoot实现excel文件生成和下载

    这篇文章主要为大家详细介绍了SpringBoot实现excel文件生成和下载,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-02-09
  • C#操作本地文件及保存文件到数据库的基本方法总结

    C#使用System.IO中的文件操作方法在Windows系统中处理本地文件相当顺手,这里我们还总结了在Oracle中保存文件的方法,嗯,接下来就来看看整理的C#操作本地文件及保存文件到数据库的基本方法总结...2020-06-25
  • php无刷新利用iframe实现页面无刷新上传文件(1/2)

    利用form表单的target属性和iframe 一、上传文件的一个php教程方法。 该方法接受一个$file参数,该参数为从客户端获取的$_files变量,返回重新命名后的文件名,如果上传失...2016-11-25
  • php批量替换内容或指定目录下所有文件内容

    要替换字符串中的内容我们只要利用php相关函数,如strstr,str_replace,正则表达式了,那么我们要替换目录所有文件的内容就需要先遍历目录再打开文件再利用上面讲的函数替...2016-11-25
  • PHP文件上传一些小收获

    又码了一个周末的代码,这次在做一些关于文件上传的东西。(PHP UPLOAD)小有收获项目是一个BT种子列表,用户有权限上传自己的种子,然后配合BT TRACK服务器把种子的信息写出来...2016-11-25
  • AI源文件转photoshop图像变模糊问题解决教程

    今天小编在这里就来给photoshop的这一款软件的使用者们来说下AI源文件转photoshop图像变模糊问题的解决教程,各位想知道具体解决方法的使用者们,那么下面就快来跟着小编...2016-09-14
  • Zend studio文件注释模板设置方法

    步骤:Window -> PHP -> Editor -> Templates,这里可以设置(增、删、改、导入等)管理你的模板。新建文件注释、函数注释、代码块等模板的实例新建模板,分别输入Name、Description、Patterna)文件注释Name: 3cfileDescriptio...2013-10-04
  • C++万能库头文件在vs中的安装步骤(图文)

    这篇文章主要介绍了C++万能库头文件在vs中的安装步骤(图文),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2021-02-23
  • php文件上传你必须知道的几点

    本篇文章主要说明的是与php文件上传的相关配置的知识点。PHP文件上传功能配置主要涉及php.ini配置文件中的upload_tmp_dir、upload_max_filesize、post_max_size等选项,下面一一说明。打开php.ini配置文件找到File Upl...2015-10-21
  • ant design中upload组件上传大文件,显示进度条进度的实例

    这篇文章主要介绍了ant design中upload组件上传大文件,显示进度条进度的实例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-10-29
  • C#使用StreamWriter写入文件的方法

    这篇文章主要介绍了C#使用StreamWriter写入文件的方法,涉及C#中StreamWriter类操作文件的相关技巧,需要的朋友可以参考下...2020-06-25
  • php实现文件下载实例分享

    举一个案例:复制代码 代码如下:<?phpclass Downfile { function downserver($file_name){$file_path = "./img/".$file_name;//转码,文件名转为gb2312解决中文乱码$file_name = iconv("utf-8","gb2312",$file_name...2014-06-07
  • C#路径,文件,目录及IO常见操作汇总

    这篇文章主要介绍了C#路径,文件,目录及IO常见操作,较为详细的分析并汇总了C#关于路径,文件,目录及IO常见操作,具有一定参考借鉴价值,需要的朋友可以参考下...2020-06-25
  • 查找php配置文件php.ini所在路径的二种方法

    通常php.ini的位置在:复制代码 代码如下:/etc目录下或/usr/local/lib目录下。如果你还是找不到php.ini或者找到了php.ini修改后不生效(其实是没找对),请使用如下办法:1.新建php文件,写入如下代码复制代码 代码如下:<?phpe...2014-05-31
  • PHP判断上传文件类型的解决办法

    分享给大家php判断上传文件类型的方法,大家一起学习学习。/** * 读取文件前几个字节 判断文件类型 * @return String */ function checkTitle($filename){ $file=fopen($filename, "rb"); $bin=fread($file, 2); /...2015-10-21