Options FollowSymLinks AllowOverride None Apache 服务器 可以针对目录进行文档的访问控制,然而访问控制可以通过两 种方式来实现,一个是在设置文件 httpd.conf(或access.conf)中针对每个目 录进行设置,另一个方法是在每个目录下设置访问控制文件,通
Options FollowSymLinksAllowOverride None
Apache服务器可以针对目录进行文档的访问控制,然而访问控制可以通过两
种方式来实现,一个是在设置文件 httpd.conf(或access.conf)中针对每个目
录进行设置,另一个方法是在每个目录下设置访问控制文件,通常访问控制文件
名字为.htaccess。虽然使用这两个方式都能用于控制浏览器的访问,然而使用配置文件的方法要求每次改动后重新启动httpd守护进程,比较不灵活,因此主要用于配置服务器系统的整体安全控制策略,而使用每个目录下的.htaccess文件设置具体目录的访问控制更为灵活方便。
Directory语句就是用来定义目录的访问限制的,这里可以看出它的标准语法,为一个目录定义访问限制。上例的这个设置是针对系统的根目录进行的,设置了允许符号连接的选项FollowSymLinks ,以及使用AllowOverride None表示不允许这个目录下的访问控制文件来改变这里进行的配置,这也意味着不用查看这个目录下的相应访问控制文件。
由于Apache对一个目录的访问控制设置是能够被下一级目录继承的,因此对
根目录的设置将影响到它的下级目录。注意由于AllowOverride None的设置,使
得Apache服务器不需要查看根目录下的访问控制文件,也不需要查看以下各级目
录下的访问控制文件,直至httpd.conf(或access.conf )中为某个目录指定了
允许Alloworride,即允许查看访问控制文件。由于Apache对目录访问控制是采用的继承方式,如果从根目录就允许查看访问控制文件,那么Apache就必须一级一级的查看访问控制文件,对系统性能会造成影响。而缺省关闭了根目录的这个特性,就使得Apache从httpd.conf中具体指定的目录向下搜寻,减少了搜寻的级数,增加了系统性能。因此对于系统根目录设置AllowOverride None不但对于系统安全有帮助,也有益于系统性能。
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
这里定义的是系统对外发布文档的目录的访问设置,设置不同的 AllowOverride选项,以定义配置文件中的目录设置和用户目录下的安全控制文件的关系,而Options选项用于定义该目录的特性。
配置文件和每个目录下的访问控制文件都可以设置访问限制,设置文件是由
管理员设置的,而每个目录下的访问控制文件是由目录的属主设置的,因此管理
员可以规定目录的属主是否能覆盖系统在设置文件中的设置,这就需要使用 啊AllowOverride参数进行设置,通常可以设置的值为:
AllowOverride的设置 对每个目录访问控制文件作用的影响
All 缺省值,使访问控制文件可以覆盖系统配置
None 服务器忽略访问控制文件的设置
Options 允许访问控制文件中可以使用Options参数定义目录的选项
FileInfo 允许访问控制文件中可以使用AddType等参数设置
AuthConfig 允许访问控制文件使用AuthName,AuthType等针对每个用户的认证机制,这使目录属主能用口令和用户名来保护目录 Limit 允许对访问目录的客户机的IP地址和名字进行限制
每个目录具备一定属性,可以使用Options来控制这个目录下的一些访问特性设置,以下为常用的特性选项:
Options设置 服务器特性设置
All 所有的目录特性都有效,这是缺省状态
None 所有的目录特性都无效
FollowSymLinks 允许使用符号连接,这将使浏览器有可能访问文档根目录 (DocumentRoot)之外的文档 SymLinksIfOwnerMatch 只有符号连接的目的与符号连接本身为同一用户所拥有时,才允许访问,这个设置将增加一些安全性
ExecCGI 允许这个目录下可以执行CGI程序 Indexes 允许浏览器可以生成这个目录下所有文件的索引,使得在这个目录下没有index.html(或其他索引文件)时,能向浏览器发送这个目录下的文件列表
此外,上例中还使用了Order、Allow、Deny等参数,这是Limit语句中用来根据浏览器的域名和 IP地址来控制访问的一种方式。其中Order定义处理Allow和Deny的顺序,而Allow、Deny则针对名字或IP进行访问控制设置,上例使用allowfrom all,表示允许所有的客户机访问这个目录,而不进行任何限制。
UserDir public_html
当在一台Linux上运行Apache服务器时,这台计算机上的所有用户都可以有自己的网页路径,形如 http://example.org.cn/~user,使用波浪符号加上用户名就可以映射到用户自己的网页目录上。映射目录为用户个人主目录下的一个子目录,其名字就用UseDir这个参数进行定义,缺省为public_html。如果不想为正式的用户提供网页服务,使用DISABLED作UserDir的参数即可。
#
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#
# Order allow,deny
# Allow from all
#
#
# Order deny,allow
# Deny from all
#
#
这里可以看到Directory的另一个用法,即可以通过简单的模式匹配方法,针对分布在不同目录下的子目录定义访问控制权限。这样设置就需要Apache服务器对每个路径进行额外的处理,因此就会降低服务器的性能,所以缺省情况并没有打开这种访问限制。

How to effectively monitor MySQL performance? Use tools such as mysqladmin, SHOWGLOBALSTATUS, PerconaMonitoring and Management (PMM), and MySQL EnterpriseMonitor. 1. Use mysqladmin to view the number of connections. 2. Use SHOWGLOBALSTATUS to view the query number. 3.PMM provides detailed performance data and graphical interface. 4.MySQLEnterpriseMonitor provides rich monitoring functions and alarm mechanisms.

The difference between MySQL and SQLServer is: 1) MySQL is open source and suitable for web and embedded systems, 2) SQLServer is a commercial product of Microsoft and is suitable for enterprise-level applications. There are significant differences between the two in storage engine, performance optimization and application scenarios. When choosing, you need to consider project size and future scalability.

In enterprise-level application scenarios that require high availability, advanced security and good integration, SQLServer should be chosen instead of MySQL. 1) SQLServer provides enterprise-level features such as high availability and advanced security. 2) It is closely integrated with Microsoft ecosystems such as VisualStudio and PowerBI. 3) SQLServer performs excellent in performance optimization and supports memory-optimized tables and column storage indexes.

MySQLmanagescharactersetsandcollationsbyusingUTF-8asthedefault,allowingconfigurationatdatabase,table,andcolumnlevels,andrequiringcarefulalignmenttoavoidmismatches.1)Setdefaultcharactersetandcollationforadatabase.2)Configurecharactersetandcollationfor

A MySQL trigger is an automatically executed stored procedure associated with a table that is used to perform a series of operations when a specific data operation is performed. 1) Trigger definition and function: used for data verification, logging, etc. 2) Working principle: It is divided into BEFORE and AFTER, and supports row-level triggering. 3) Example of use: Can be used to record salary changes or update inventory. 4) Debugging skills: Use SHOWTRIGGERS and SHOWCREATETRIGGER commands. 5) Performance optimization: Avoid complex operations, use indexes, and manage transactions.

The steps to create and manage user accounts in MySQL are as follows: 1. Create a user: Use CREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password'; 2. Assign permissions: Use GRANTSELECT, INSERT, UPDATEONmydatabase.TO'newuser'@'localhost'; 3. Fix permission error: Use REVOKEALLPRIVILEGESONmydatabase.FROM'newuser'@'localhost'; then reassign permissions; 4. Optimization permissions: Use SHOWGRA

MySQL is suitable for rapid development and small and medium-sized applications, while Oracle is suitable for large enterprises and high availability needs. 1) MySQL is open source and easy to use, suitable for web applications and small and medium-sized enterprises. 2) Oracle is powerful and suitable for large enterprises and government agencies. 3) MySQL supports a variety of storage engines, and Oracle provides rich enterprise-level functions.

The disadvantages of MySQL compared to other relational databases include: 1. Performance issues: You may encounter bottlenecks when processing large-scale data, and PostgreSQL performs better in complex queries and big data processing. 2. Scalability: The horizontal scaling ability is not as good as Google Spanner and Amazon Aurora. 3. Functional limitations: Not as good as PostgreSQL and Oracle in advanced functions, some functions require more custom code and maintenance.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function