apache入门指南

《apache入门指南》要点:
本文介绍了apache入门指南,希望对您有用。如果有疑问,可以联系我们。

英文原文网址:http://httpd.apache.org/docs/2.4/getting-started.html

翻译办法:google translate翻译后,本人重新校对.感触是,不得不说google翻译准得惊人,准确率超过95%,我的改动不超过一百字.但是确实没有达到完全代替人工的程度.

apache入门指南

If you're completely new to the Apache HTTP Server,or even to running a website at all,you might not know where to start,or what questions to ask. This document walks you through the basics.

如果您完全是Apache HTTP Server的新手,或者从未运行过一个网站,您可能不知道从哪里开始,或者不知道要问什么问题.本文将引导您了解根基知识.

Clients,Servers,and URLs

Addresses on the Web are expressed with URLs - Uniform Resource Locators - which specify a protocol (e.g. http),a servername (e.g. www.apache.org),a URL-path (e.g./docs/current/getting-started.html),and possibly a query string (e.g. ?arg=value) used to pass additional arguments to the server.

A client (e.g.,a web browser) connects to a server (e.g.,your Apache HTTP Server),with the specified protocol,and makes a request for a resource using the URL-path.

The URL-path may represent any number of things on the server. It may be a file (like getting-started.html) a handler (like server-status) or some kind of program file (like index.php). We'll discuss this more below in the Web Site Content section.

The server will send a response consisting of a status code and,optionally,a response body. The status code indicates whether the request was successful,and,if not,what kind of error condition there was. This tells the client what it should do with the response. You can read about the possible response codes in HTTP Server wiki.

Details of the transaction,and any error conditions,are written to log files. This is discussed in greater detail below in the Logs Files and Troubleshooting section.

客户端,服务器和URL

Web上的地址是以URL(统一资源定位符)的形式给出的.URL指定了协议(例如http),服务器名称(例如www.apache.org),URL路径(例如/docs/current/getting-started.html),也可能是一个查询字符串(例如?arg=value),用于将额外的参数传递给服务器.

客户端(例如,Web浏览器)使用指定的协议连接到服务器(例如,您的Apache HTTP Server),并使用URL路径哀求资源.

URL路径可以表现服务器上的任何数量的东西.它可能是一个文件(如getting-started.html)一个处理程序(如服务器状态)或某种程序文件(如index.php).我们将在“ 网站内容”部分中详细讨论.

服务器将发送由状态码和可选的响应主体组成的响应.状态代码指示哀求是否成功,如果没有成功,则会指示出现了什么样的错误状况.这告诉客户端接下来该做什么.您可以阅读HTTP Server wiki中可能的响应代码.

事务的详细信息和任何错误条件都将写入日志文件.这将在日志文件和故障排除部门中详细讨论.

Hostnames and DNS

In order to connect to a server,the client will first have to resolve the servername to an IP address - the location on the Internet where the server resides. Thus,in order for your web server to be reachable,it is necessary that the servername be in DNS.

If you don't know how to do this,you'll need to contact your network administrator,or Internet service provider,to perform this step for you.

More than one hostname may point to the same IP address,and more than one IP address can be attached to the same physical server. Thus,you can run more than one web site on the same physical server,using a feature called virtual hosts.

If you are testing a server that is not Internet-accessible,you can put host names in your hosts file in order to do local resolution. For example,you might want to put a record in your hosts file to map a request for www.example.com to your local system,for testing purposes. This entry would look like:

127.0.0.1 www.example.com

A hosts file will probably be located at /etc/hosts or C:\Windows\system32\drivers\etc\hosts.

You can read more about the hosts file at Wikipedia.org/wiki/Hosts_(file),and more about DNS at Wikipedia.org/wiki/Domain_Name_System.

主机名和DNS

为了连接到服务器,客户端首先必须将servername解析为IP地址 - 服务器在Internet上的位置.因此,为了使您的Web服务器可拜访,服务器名称必须位于DNS中.

如果您不知道如何执行此操作,则必要联系您的网络管理员或Internet服务提供商,为您执行此步骤.

多个主机名可能指向相同的IP地址,而且可以将多个IP地址附加到同一物理服务器.因此,您可以使用称为虚拟主机的功能在同一物理服务器上运行多个网站.

如果您正在测试Internet访问不了的服务器,则可以在主机文件中放置主机名,以便进行本地解析.例如,您可能希望在主机文件中添加一个记录,将对www.example.com的哀求映射到本地系统,以进行测试.这个记录可能写成这样:

127.0.0.1 www.example.com

主机文件可能位于/etc/hosts或C:\Windows\system32\drivers\etc\hosts.

您可以在Wikipedia.org/wiki/Hosts_(file)上了解有关hosts文件的更多信息,以及有关Wikipedia.org/wiki/Domain_Name_System的 DNS的更多信息.

Configuration Files and Directives

The Apache HTTP Server is configured via simple text files. These files may be located any of a variety of places,depending on how exactly you installed the server. Common locations for these files may be found in the httpd wiki. If you installed httpd from source,the default location of the configuration files is /usr/local/apache2/conf. The default configuration file is usually called httpd.conf. This,too,can vary in third-party distributions of the server.

The configuration is frequently broken into multiple smaller files,for ease of management. These files are loaded via the Include directive. The names or locations of these sub-files are not magical,and may vary greatly from one installation to another. Arrange and subdivide these files as makes the most sense to you. If the file arrangement you have by default doesn't make sense to you,feel free to rearrange it.

The server is configured by placing configuration directives in these configuration files. A directive is a keyword followed by one or more arguments that set its value.

The question of "Where should I put that directive?" is generally answered by considering where you want a directive to be effective. If it is a global setting,it should appear in the configuration file,outside of any <Directory>,<Location>,<VirtualHost>,or other section. If it is to apply only to a particular directory,then it should go inside a <Directory>section referring to that directory,and so on. See the Configuration Sections document for further discussion of these sections.

In addition to the main configuration files,certain directives may go in .htaccess files located in the content directories. .htaccess files are primarily for people who do not have access to the main server configuration file(s). You can read more about .htaccess files in the .htaccess howto.

配置文件和指令

Apache HTTP Server通过简单的文本文件进行配置.这些文件可能处于分歧的位置,具体取决于您如何安装服务器.这些文件的常见位置可以在httpd维基中找到.如果从源安装了httpd,则配置文件的默认位置为/usr/local/apache2/conf.默认配置文件通常称为httpd.conf.当然,这也可能因服务器的发行版分歧而存在区别.(译者注:apache2 通过apt-get 安装 配置文件在/etc/apache2里.另外总体配置在apache2.conf中.)

配置经常被分成多个较小的文件,便于管理.这些文件通过Include指令加载.这些子文件的名称或位置不是固定的,并且可能由于安装的不同有很大差异.支配和细分这些文件对来说是最有意义的.如果你认为默认的文件支配有什么不妥,请随意重新排列组合.

我们通过在这些配置文件中放置配置指令来配置服务器.指令是一个症结字,后跟一个或多个设置其值的参数.

一般来说,“ 我应该在哪里提出这个指令? ”这个问题的答案是:这要取决于你想要这个指令有怎样的作用域.如果是全局设置,它应该出现在总体配置文件中,而不该在<Directory>,<VirtualHost>或其他部分.而如果只应用于特定的目录,那么它应该进入一个引用该目录的<Directory>部分,依此类推.有关这些部分的进一步讨论,请参阅配置部分文档.

除了主配置文件之外,某些指令也可能位于内容目录中的.htaccess文件中..htaccess文件主要适用于无法拜访主服务器配置文件的用户.您可以在.htaccess howto中阅读更多关于.htaccess文件的信息.

Web Site Content

Web site content can take many different forms,but may be broadly divided into static and dynamic content.

Static content is things like HTML files,image files,CSS files,and other files that reside in the filesystem. The DocumentRoot directive specifies where in your filesystem you should place these files. This directive is either set globally,or per virtual host. Look in your configuration file(s) to determine how this is set for your server.

Typically,a document called index.html will be served when a directory is requested without a file name being specified. For example,if DocumentRoot is set to /var/www/htmland a request is made for http://www.example.com/work/,the file /var/www/html/work/index.html will be served to the client.

Dynamic content is anything that is generated at request time,and may change from one request to another. There are numerous ways that dynamic content may be generated. Various handlers are available to generate content. CGI programs may be written to generate content for your site.

Third-party modules like mod_php may be used to write code that does a variety of things. Many third-party applications,written using a variety of languages and tools,are available for download and installation on your Apache HTTP Server. Support of these third-party things is beyond the scope of this documentation,and you should find their documentation or other support forums to answer your questions about them.

网站内容

网站内容可以采取许多分歧的形式,但可以大致分为静态和动态内容.

静态内容是HTML文件,图像文件,CSS文件以及文件系统中的其他文件. DocumentRoot指令指定文件系统中应该放置这些文件的地位.该指令是全局设置的,也可以是每个虚拟主机.查看您的配置文件以确定如何为您的服务器设置.

通常,当哀求没有指定文件名的目录时,服务器将默认回应一个名为index.html的文档.例如,如果DocumentRoot设置为/var/www/html,并且哀求是针对http://www.example.com/work/,则文件/var/www/html/work/index.html将被提供给客户端.

动态内容是在哀求时生成的任何内容,不同的哀求又不同的回应.有多种方式可以生成动态内容.各种处理程序可用于生成内容.你可能会编写CGI程序来为您的网站生成内容.

也可以使用第三方模块,如mod_php来编写执行各种操作的代码.许多使用各种语言和工具编写的第三方应用程序可以在您的Apache HTTP服务器上进行下载和安装.介绍这些第三方模块已经超越了本文档应该涵盖的范围,您可以找到相关文档或到其他支持论坛来解答您的疑问.

Log Files and Troubleshooting

As an Apache HTTP Server administrator,your most valuable assets are the log files,in particular,the error log. Troubleshooting any problem without the error log is like driving with your eyes closed.

The location of the error log is defined by the ErrorLog directive,which may be set globally,or per virtual host. Entries in the error log tell you what went wrong,and when. They often also tell you how to fix it. Each error log message contains an error code,which you can search for online for even more detailed descriptions of how to address the problem. You can also configure your error log to contain a log ID which you can then correlate to an access log entry,so that you can determine what request caused the error condition.

You can read more about logging in the logs documentation.

日志文件和故障排除

作为Apache HTTP Server管理员,您最名贵的资产是日志文件,特别是错误日志.排除任何没有错误日志的问题,就像开车闭眼.

错误日志的位置由可以全局设置或每个虚拟主机设置的ErrorLog指令定义.错误日志中的条目告诉您出了什么问题,何时出现.他们经常也会告诉你如何解决它.每个错误日志消息包含一个错误代码,您可以在线搜索更详细的描述如何解决问题.您还可以将错误日志配置为包含一个日志ID,然后可以将其与访问日志条目相关联,以便您可以确定导致错误条件的哀求.

您可以浏览有关登录日志文档的更多信息.

编程之家PHP培训学院每天发布《apache入门指南》等实战技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培养人才。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


可以认为OpenFeign是Feign的增强版,不同的是OpenFeign支持Spring MVC注解。OpenFeign和Feign底层都内置了Ribbon负载均衡组件,在导入OpenFeign依赖后无需专门导入Ribbon依赖,用做客户端负载均衡,去调用注册中心服务。
为进一步规范小程序交易生态、提升用户购物体验、满足用户在有交易的小程序中便捷查看订单信息的诉求,自2022年12月31日起,对于有“选择商品/服务-下单-支付”功能的小程序,需按照平台制定的规范,在小程序内设置订单中心页。开发者可通过小程序代码提审环节,或通过「设置-基础设置-小程序订单中心path设置」模块设置订单中心页path。1、 新注册或有版本迭代需求的小程序,可在提审时通过参数配置该商家小程序的订单中心页path。2、无版本迭代需求的小程序,可在小程序订单中心path设置入口进行设置。
云原生之使用Docker部署Dashdot服务器仪表盘
本文主要描述TensorFlow之回归模型的基本原理
1.漏洞描述Apache Druid 是一个集时间序列数据库、数据仓库和全文检索系统特点于一体的分析性数据平台。Apache Druid对用户指定的HTTP InputSource没有做限制,并且Apache Druid默认管理页面是不需要认证即可访问的,可以通过将文件URL传递给HTTP InputSource来绕过。因此未经授权的远程攻击者可以通过构造恶意参数读取服务器上的任意文件,造成服务器敏感性信息泄露。2.影响版本Apache Druid &lt;= 0.21.13...
内部类(当作类中的一个普通成员变量,只不过此成员变量是class的类型):一个Java文件中可以包含多个class,但是只能有一个public class 如果一个类定义在另一个类的内部,此时可以称之为内部类使用:创建内部类的时候,跟之前的方法不一样,需要在内部类的前面添加外部类来进行修饰 OuterClass.InnerClass innerclass = new OuterClass().new InnerClass();特点:1.内部类可以方便的访问外部类的私有属性...
本文通过解读国密的相关内容与标准,呈现了当下国内技术环境中对于国密功能支持的现状。并从 API 网关 Apache APISIX 的角度,带来有关国密的探索与功能呈现。作者:罗泽轩,Apache APISIX PMC什么是国密顾名思义,国密就是国产化的密码算法。在我们日常开发过程中会接触到各种各样的密码算法,如 RSA、SHA256 等等。为了达到更高的安全等级,许多大公司和国家会制定自己的密码算法。国密就是这样一组由中国国家密码管理局制定的密码算法。在国际形势越发复杂多变的今天,密码算法的国产化
CENTOS环境Apache最新版本httpd-2.4.54编译安装
Apache HTTPD是一款HTTP服务器,它可以通过mod_php来运行PHP网页。影响版本:Apache 2.4.0~2.4.29 存在一个解析漏洞;在解析PHP时,将被按照PHP后缀进行解析,导致绕过一些服务器的安全策略。我们查看一下配置:读取配置文件,前三行的意思是把以 结尾的文件当成 文件执行。问题就在它使用的是 符号匹配的,我们都知道这个符号在正则表达式中的意思是匹配字符串的末尾,是会匹配换行符的,那么漏洞就这样产生了。 进入容器里,打开index.php,发现如果文件后缀名为 php、
apache Hop现在好像用的人很少, 我就自己写一个问题收集的帖子吧, 后面在遇到什么问题都会在该文章上同步更新
2.启动容器ps:注意端口占用,当前部署在 8080 端口上了,确保宿主机端口未被占用,不行就换其他端口ps:用户名和密码都是 admin,一会用于登录,其他随便填5.下载一个官方提供的样例数据库【可跳过】ps:此步国内无法访问,一般下载不了,能下的就下,不能下的跳过就行了,一会配置自己的数据库7.访问登录页面ps:注意端口是上面自己配置的端口,账号密码是 admin依次点击 Settings → Database Connections点击 DATABASE 就可以配置自己的数据库了
String类的常用方法1. String类的两种实例化方式1 . 直接赋值,在堆上分配空间。String str = "hello";2 . 传统方法。通过构造方法实例化String类对象String str1 = new String("Hello");2.采用String类提供的equals方法。public boolean equals(String anotherString):成员方法 str1.equals(anotherString);eg:publi
下载下载地址http://free.safedog.cn下载的setup:安装点击下面的图标开始安装:可能会提示:尝试先打开小皮面板的Apache服务:再安装安全狗:填入服务名:如果服务名乱写的话,会提示“Apache服务名在此机器上查询不到。”我干脆关闭了这个页面,直接继续安装了。安装完成后,需要进行注册一个账户,最后看到这样的界面:查看配置:...
一、问题描述一组生产者进程和一组消费者进程共享一个初始为空、大小n的缓冲区,只有缓冲区没满时,生产者才能把资源放入缓冲区,否则必须等待;只有缓冲区不为空时,消费者才能从中取出资源,否则必须等待。由于缓冲区是临界资源,它只允许一个生产者放入资源,或一个消费者从中取出资源。二、问题分析(1)、关系分析。生产者和消费者对缓冲区互斥访问是互斥关系,同时生产者和消费者又是一个相互协作的关系,只有生产者生产之后,消费者只能才能消费,它们还是同步关系。(2)、整理思路。只有生产生产者和消费者进程,正好是这两个进程
依赖注入的英文名是Dependency Injection,简称DI。事实上这并不是什么新兴的名词,而是软件工程学当中比较古老的概念了。如果要说对于依赖注入最知名的应用,大概就是Java中的Spring框架了。Spring在刚开始其实就是一个用于处理依赖注入的框架,后来才慢慢变成了一个功能更加广泛的综合型框架。我在学生时代学习Spring时产生了和绝大多数开发者一样的疑惑,就是为什么我们要使用依赖注入呢?现在的我或许可以给出更好的答案了,一言以蔽之:解耦。耦合度过高可能会是你的项目中一个比较
<dependency><groupId>org.apache.velocity</groupId><artifactId>velocity-engine-core</artifactId><version>使用人数最多的版本</version></dependency>importorg.apache.velocity.Template;importorg.apache.velo
Java Swing皮肤包前言:一.皮肤包分享二.皮肤包的使用1.先新建一个项目。2.导入皮肤包1.先导入我们刚刚下载的jar文件,右键项目demo即可2.如果右键没有这个选项,记得调为下图模式3.点击下图蓝色圆圈处4.找到刚刚下载的jar文件,点击打开即可5.我们看一下效果,是不是比原生的好看前言:因为Java Swing自身皮肤包不是很好看,甚至有点丑,怎么让你的界面更加好看,这里就需要用到皮肤包,我发现了一个还不错的皮肤包,让你的界面美观了几个等级。废话不多说。一.皮肤包分享百度网盘分享链接:
一、前言在做Java项目开发过程中,涉及到一些数据库服务连接配置、缓存服务器连接配置等,通常情况下我们会将这些不太变动的配置信息存储在以 .properties 结尾的配置文件中。当对应的服务器地址或者账号密码信息有所变动时,我们只需要修改一下配置文件中的信息即可。同时为了让Java程序可以读取 .properties配置文件中的值,Java的JDK中提供了java.util.Properties类可以实现读取配置文件。二、Properties类Properties 类位于 java.util.Pro
Mybatis环境JDK1.8Mysql5.7maven 3.6.1IDEA回顾JDBCMysqlJava基础MavenJunitSSM框架:配置文件的最好的方式:看官网文档Mybatis1、Mybatis简介1.1 什么是Mybatis如何获得Mybatismaven仓库:中文文档:https://mybatis.org/mybatis-3/zh/index.htmlGithub:1.2 持久化数据持久化持久化就是将程序的数据在持久状态和瞬时状态转