20170825l08-05 old boy Linux actual operation training-lamp series-apache Service Production practical application Guide 02

Source: Internet
Author: User

This section says Apache's installation directory file

Specifically describes the configuration of some important files


Tree-l 1/usr/local/apache


[Email protected] extra]# tree-l 1/usr/local/apache

/usr/local/apache

├──apache-/usr/local/apache

├──bin

├──build

├──cgi-bin

├──conf

├──error

├──htdocs

├──icons

├──include

├──lib

├──logs

├──man

├──manual

└──modules


Bin directory Apache Some important commands are put here

APACHECTL command is Apache boot, restart, and Stop command


Htdocs Home Directory File location

[Email protected] apache]# tree Htdocs

Htdocs

└──index.html


There are some configuration files in the Conf file

[Email protected] apache]# tree-l 1 conf

Conf

├──extra

├──httpd.conf

├──magic

├──mime.types

└──original

The most important document, of course, is httpd.conf.


Log directory file storage address

.

├──access_log

├──error_log

└──httpd.pid

Access is a log

Error log

Httpd.pid has Apache runtime process ID number


Modules a directory of modules, such as compiling Php,memcache


Explain the httpd.conf file

ServerRoot file #后面接的是apache主安装文件位置

Listen #用来设定访问端口的也可以指定IP

Listen 12.88.99.12:80

You can also specify multiple ports such as

Listen 80

Listen 88

......


Set up user groups and users to access services

User Daemon

Group Daemon


ServerAdmin [email protected] #服务器出问题后通知管理员的邮箱设置

ServerName #给服务器设置一个名字


The default page of the Web site Directory

DocumentRoot "/usr/local/apache2/htdocs"


Control of directory Permissions

The following is the root directory permission

<directory/>

allowoverride None #禁重载

Require all denied #禁示所有限止的访问

</Directory>


<directory "/usr/local/apache2/htdocs" >

#

# Possible values for the Options directive is "None", "all",

# or any combination of:

# Indexes includes followsymlinks symlinksifownermatch execcgi multiviews

#

# Note that "MultiViews" must is named *explicitly*---"Options all"

# doesn ' t give it to you.

#

# The Options directive is both complicated and important. Please see

# http://httpd.apache.org/docs/2.4/mod/core.html#options

# for more information.

#

Options Indexes followsymlinks #允许浏览目录, for Security to disable this permission


#

# AllowOverride Controls What directives is placed in. htaccess files.

# It can be ' all ', ' None ', or any combination of the keywords:

# allowoverride FileInfo authconfig Limit

#

allowoverride None #htaccess可以网站开发人员来参与权限管理, default is not open


#

# Controls who can get stuff from the this server.

#

Require all granted

</Directory>


Look at the set-row statistics used by httpd.conf

Egrep-v "^.*#|^$" httpd.conf|nl


Extra is an Apache extension profile directory

[Email protected] extra]# tree

.

├──httpd-autoindex.conf

├──httpd-dav.conf

├──httpd-default.conf

├──httpd-info.conf

├──httpd-languages.conf

├──httpd-manual.conf

├──httpd-mpm.conf

├──httpd-multilang-errordoc.conf

├──httpd-ssl.conf

├──httpd-userdir.conf

├──httpd-vhosts.conf

└──proxy-html.conf


Which is mainly about httpd-vhosts.conf this configuration file

This is the configuration file for the virtual host



20170825l08-05 old boy Linux practical Operation training-lamp Series-apache Service Production practical Application Guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.