当前位置:网站首页>25 interview questions about Apache
25 interview questions about Apache
2022-06-29 23:23:00 【Brother Xing plays with the clouds】
We are very grateful to all our readers for our new Linux The interview section gives us a reply . Now we have started to ask questions about the interview , And with today's focus on the basic to intermediate Apache The chapter of interview questions , This will help you prepare yourself for the interview .
Apache Job interview questions
This section covers 25 An interesting Apache Questions that will be asked in job interviews , With their answers , So you can easily understand that maybe you have never seen something about Apache New things .
Before you start reading this article , We strongly advise you not to learn by rote , First of all, try to understand everything in the actual scene .
1. What is? Apache web The server ?
answer : Apache web The server HTTP It's a very popular 、 Powerful and open source , Used to manage web Site and provide... To the network web File service . It's based on HTTP Hypertext transfer protocol runs , This protocol provides the server and client web Standards for browser communication . It supports SSL, CGI file , Virtual hosts have many other features .
2. If you check Apache And its version ?
answer : First , Use rpm Order to check Apache Has it been installed? . If it's already installed , Use it httpd -v Command to ginger tea its version .
[[email protected] ~]# rpm -qa | grep httpd
httpd-devel-2.2.15-29.el6.CentOS.i686
httpd-2.2.15-29.el6.centos.i686
httpd-tools-2.2.15-29.el6.centos.i686[[email protected] ~]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: Aug 13 2013 17:27:113. Apache Run with that user ? Where is the location of the main configuration file ?.
answer : Apache With “nobody” Users and httpd The daemons run . Apache The main configuration files are : /etc/httpd/conf/httpd.conf (CentOS/RHEL/Fedora) also /etc/apache2.conf (Ubuntu/Debian).
4. Apache Listen http and https request ?
answer : Apache Default in 80 Port listening http, stay 443 Port listening https( need SSL Integers ). You can also use netstat command To check the port .
[[email protected] ~]# netstat -antp | grep http
tcp 0 0 :::80 :::* LISTEN 1076/httpd
tcp 0 0 :::443 :::* LISTEN 1076/httpd5. How in your Linux Machine mounted Apache The server ?
answer : It's simple , You can use anything like (RHEL/CentOS/Fedora) Upper yum as well as (Debian/Ubuntu) Upper apt-get Come in your Linux Installation on Apache The server .
[[email protected] ~]# yum install httpd[[email protected] ~]# apt-get install apache26. Where can you find Apache Web All configuration paths of the server ?
answer : Apache The default configuration path is : (RHEL/CentOS/Fedora) It's in /etc/httpd/ on and (Debian/Ubuntu) Is in /etc/apache2 Next .
[[email protected] ~]# cd /etc/httpd/
[[email protected] httpd]# ls -l
total 8
drwxr-xr-x. 2 root root 4096 Dec 24 21:44 conf
drwxr-xr-x. 2 root root 4096 Dec 25 02:09 conf.d
lrwxrwxrwx 1 root root 19 Oct 13 19:06 logs -> ../../var/log/httpd
lrwxrwxrwx 1 root root 27 Oct 13 19:06 modules -> ../../usr/lib/httpd/modules
lrwxrwxrwx 1 root root 19 Oct 13 19:06 run -> ../../var/run/httpd[[email protected] ~]# cd /etc/apache2
[[email protected] apache2]# ls -l
total 84
-rw-r--r-- 1 root root 7113 Jul 24 16:15 apache2.conf
drwxr-xr-x 2 root root 4096 Dec 16 11:48 conf-available
drwxr-xr-x 2 root root 4096 Dec 16 11:45 conf.d
drwxr-xr-x 2 root root 4096 Dec 16 11:48 conf-enabled
-rw-r--r-- 1 root root 1782 Jul 21 02:14 envvars
-rw-r--r-- 1 root root 31063 Jul 21 02:14 magic
drwxr-xr-x 2 root root 12288 Dec 16 11:48 mods-available
drwxr-xr-x 2 root root 4096 Dec 16 11:48 mods-enabled
-rw-r--r-- 1 root root 315 Jul 21 02:14 ports.conf
drwxr-xr-x 2 root root 4096 Dec 16 11:48 sites-available
drwxr-xr-x 2 root root 4096 Dec 6 00:04 sites-enabled7. Apache Can be TCP Is the wrapper fixed ?
answer : Can not be , It cannot be TCP The packer is fixed , Because it doesn't support Linux Of libwrap.a library .
8. How to be in Apache Change the default port in , And how to listen for instructions to work ?
answer : stay httpd.conf There is an instruction in the file “Listen” Let's change the default Apache port . stay Listen With the help of the command, we can do it on different ports and different interfaces Apache Listen .
Suppose you have multiple IP Registered to your Linux machine , And want to Apache Receive on a special Ethernet port or interface HTTP request , Even this requirement can be used Listen Command to do .
To change Apache Default port for , Please use to open your Apache Master profile httpd.conf perhaps apache2.conf .
[[email protected] ~]# vi /etc/httpd/conf/httpd.conf
[[email protected] ~]# vi /etc/apache2/apache2.conflookup ”Listen” The word , Comment on the original line and write your own instructions below that line .
# Listen 80
Listen 8080
OR
Listen 172.16.16.1:8080Save the file and restart web The server .
[[email protected] ~]# service httpd restart
[[email protected] ~]# service apache2 restart9. We can put two on one machine Apache Web Server ?
answer : Sure , We're in one Linux Two different... Are running on the machine at the same time Apache The server , But the condition is that they should listen on different ports , And we can use Apache Of Listen Command to change the port .
10. You know, Apache Of DocumentRoot What do you mean ?
answer : DocumentRoot Of Apache On the server web Where files are stored , default DocumentRoot yes /var/www/html perhaps /var/www. This can be modified , Just modify the virtual host configuration in the host “DocumentRoot” That's it .
11. How to manage files under different folders , What else is it Alias Instructions ?
answer : Yes , This can be done with the help of the Lord Apache In the configuration file Alias Command to do . Alias Directives can map resources in the file system , It uses a URL route , And replace it by redirecting to a file or directory on the system .
Use Alias Instructions , It is Apache Of mod_alias Part of the module . Alias The default syntax of the instruction is :
Alias /images /var/data/images/In the example above , Put it in /var/data/images Before the prefix /images url Client requests “http://www.example.com/images/sample-image.png” Will make Apache From... On the server /var/data/images/sample-image.png take “sample-image.png” file . It's also called URL mapping .
12. about “DirectoryIndex” How do you understand ?
answer : DirectoryIndex When there is a request from the host Apache First, I will look for the file . for example : The client sends the request www.example.com, Apache For this, you will find the file root directory of the site index file ( The first document to show ).
DirectoryIndex The default setting for is .htmlindex.htmlindex.php, If it's not the name , You need to httpd.conf perhaps apache2.conf Medium DirectoryIndex Value is modified , To display it on your client browser .
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var index.cgi .exe13. When index How to invalidate the directory list when a file is lost ?
answer : If the master in the root directory of the site index Invalid file , that Apache All files with similar contents will be listed in the browser , To replace the site home page .
To shut down Apache Directory listing , You can set the global settings in the main configuration file , Or in .htaccess Some of the settings in the file are as follows .
<Directory /var/www/html>
Options -Indexes
</Directory>14. Apache Web What are the different log files on the server ?
answer : Apache Web The default log file for the server is the access log “/var/log/httpd/access_log” And error logs :/var/log/httpd/error_log”.
15. How do you understand the error log “connection reset by peer” Of ?
answer : The end user disconnects while the server is servicing the request , We will see in the error log “connection reset by peer“.
16. What is? Apache The virtual master of ���?
answer : The information contained in the virtual host section includes the site name , Document root path , indexes , Server administrator mailbox , Error log file path, etc .
You can add any instructions you want to your domain , But to run a site , At least one parameter must be configured Server name and Document root . stay Linux On the machine , Usually we httpd.conf At the end of the file to set the relevant configuration of our virtual host part .
Virtual host example
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>- ServerAdmin : It usually refers to the email address of the site owner , Errors and notifications can be sent inside .
- DocumentRoot : web Where files are stored on the server ( You have to configure ).
- ServerName : The domain name when accessing the site through the browser ( You have to configure ).
- ErrorLog : Location of log files , It records all logs related to the site .
17. <Location> and <Directory> What's the difference between ?
answer :
- <Location> Is used to set and URL/ web Server address bar related elements .
- <Directory> It refers to the location of an object on the server in the file system
18. What is? Apache Virtual hosting ?
answer : Apache Virtual hosting means , In a single web Multiple servers are hosted on the server web Site .Apache Two types of virtual hosts can be set : Name based virtual hosting and be based on IP Virtual host hosting for .
More information , see also How to be in Apache Based on Name/IP Virtual host of .
19. How do you understand Apache Of MPM?
answer : MPM intend Multi Processing Modules, In fact, it means Apache Some of the mechanisms followed , Used to accept and complete web Server requests .
20. Worker and Prefork MPM What's the difference ?
answer : They are all MPM, Worker and prefork There are each of them Apache The operating mechanism on . They all depend on which mode you want to start your Apache.
- Worker and MPM The basic difference In the process that they produce child processes . stay Prefork MPM in , A master httpd To be started , The main process manages all other child processes to serve client requests . And in the worker MPM In a httpd The process is activated , Different threads are used to service client requests .
- Prefork MPM Use multiple subprocesses , Each process has a thread and worker MPM Use multiple subprocesses , Each process has multiple threads .
- Prefork MPM Connection handling in , Each process processes one connection at a time, while Worker mpm Each thread in the process one connection at a time .
- Memory footprint Prefork MPM It takes up a lot of memory , and Worker Take up less memory .
21. “LimitRequestBody” What is the application of , And how to add restrictions to your uploads ?
answer : LimitRequestBody The instruction is used to limit the upload size .
for example : I want to /var/www/html/tecmin/uploads Add 100000 Byte limit . Then you need to be in Apache Add the following instructions to the configuration file .
<Directory "/var/www/html/tecmint/uploads">
LimitRequestBody 100000
</Directory>22. mod_perl and mod _php What is it? ?
answer :
- mod_perl Is a companion Apache Compiled together Apache modular , Used to do Perl Simple integration of scripts and improved performance .
- mod_php Used to do web The server PHP Simple integration of scripts , It's in Apache Embedded in the process PHP Interpreter . It forces Apache Child processes use more memory , And only in Apache Upper use , But it is still very popular .
23. Mod_evasive What is it? ?
answer : It is a protection for you web The server is not affected by DDOS And so on. web Third party modules to attack , Because it only performs one task at a time , All performed very well .
More confidence , Please read this article , It will guide you How to be in Apache Install and configure mod_evasive.
24. httpd.conf In the document Loglevel What is debugging ?
answer : stay Loglevel Debug With the help of options , We can get or record more information in the error log , To help us debug the problem .
25. mod_ssl What's the use and SSL stay Apache How to work in ?
answer : Mod_ssl It's a Apache modular , It makes Apache You can establish connections and transmit data in a secure encrypted environment . Use SSL certificate , All login information and other important confidential information will be encrypted in Internet Transmission on , This will prevent our data from being stolen or IP cheating .
How to be in Apache Use in SSL
whenever https Request arrival ,Apache Will perform the following three steps :
- Apache Generate its private key and convert it to .CSR file ( Certificate issue request ).
- then Apache send out .csr Document to CA ( Certificate Management Center ).
- CA received .csr file And converted to .crt ( certificate ) And then send it back to Apache To complete https Connection request .
This is the most popular question asked by the interviewer 25 The problem of , Please share your recent interview questions in the comments section below to help other interviewers .
边栏推荐
- CE second operation
- 正则表达式:字符(2)
- Solr基础操作1
- Hematemesis finishing: a rare map of architects!
- High performance and high availability computing architecture of "Weibo comments"
- Mysql database: the difference between drop, truncate and delete
- Profit distribution and taxation of funds
- Open source the Ernie tiny lightweight technology of "Wenxin big model", which is accurate and fast, with full effect
- matplotlib matplotlib中plt.hist()参数解释
- Vs cannot locate program input point to DLL
猜你喜欢

80-Redis详解

Procurement intelligence is about to break out, and the "3+2" system of Alipay helps enterprises build core competitive advantages

Vs cannot locate program input point to DLL

Intranet penetration (NC)

语音信号处理(二): 发声生理、听觉生理与听觉心理

触摸按键与按键控制对应的LED状态翻转

记一次排查线上MySQL死锁过程,不能只会curd,还要知道加锁原理

Open source the Ernie tiny lightweight technology of "Wenxin big model", which is accurate and fast, with full effect

constexpr 函数

微博系统中”微博评论“的高性能高可用计算架构
随机推荐
什么是IGMP?IGMP与ICMP有啥区别?
Hematemesis finishing: a rare map of architects!
Collection! Have you ever used these tools to improve programmer productivity?
为什么 JSX 语法这么香?
Software testing interface testing JMeter 5.5 installation tutorial
Under the epidemic, I left my job for a year, and my income increased 10 times
Evolution from stand-alone to distributed database storage system
Go zero micro Service Practice Series (VII. How to optimize such a high demand)
Vs cannot locate program input point to DLL
Qt中使用QDomDocument和QDomnode来读取xml
疫情下我离职一年,收入增长了10倍
Qdomdocument and qdomnode are used in QT to read XML
Solr基础操作5
论文阅读《Large-Scale Direct SLAM with Stereo Cameras》
M1笔记本居家办公的痛点及解决方案 | 社区征文
Pain points and solutions of M1 notebook home office | community essay solicitation
自己收藏的一些网址
Mysql database: use the show profile command to analyze performance
动态代理的实现原理
Gnawing down the big bone - sorting (I)