Apache Server Interview Questions and Answers for Linux Admin:
Q:- What is location of log files for Apache server ?
/var/log/httpd
Q: - What are the types of virtual hosts ?
Q: - How to restart Apache web server ?
Q: - How to check the version of Apache server ?
Q: - What is meaning of "Listen" in httpd.conf file ?
Q: - What is DocumentRoot ?
Q: - On which port Apache server works ?
Q: - Tell me name of main configuration file of Apache server ?
Q: - On which version of apache you have worked ?
Q: - What do you mean by a valid ServerName directive?
Q: - What is the main difference between <Location> and <Directory> sections?
What is the difference between a restart and a graceful restart of a web server?
Q: - What is the use of mod_perl module?
Q: - If you have added “loglevel Debug” in httpd.conf file, than what will happen?
Q: - Can you record the MAC (hardware) address of clients that access your server.
Q: - Can you record all the cookies sent to your server by clients in Web Server logs?
Q: - Can we do automatically roll over the Apache logs at specific times without having to shut down and restart the server?
Use CustomLog and the rotatelogs programs
Q: - What we can do to find out how people are reaching your site?
Q: - If you have only one IP address, but you want to host two web sites on your server. What will you do?
In this case I will use Name Based Virtual hosting.
ServerName 10.111.203.25
NameVirtualHost *:80
<VirtualHost *:80>
ServerName web1.test.comDocumentRoot /var/www/html/web1</VirtualHost><VirtualHost *:80>ServerName web2.test2.comDocumentRoot /var/www/html/web2</VirtualHost>
Q: - Can I serve content out of a directory other than the DocumentRootdirectory?
Q: - If you have to more than one URL map to the same directory but you don't have multiple Alias directives. What you will do?
Q: - How you will put a limit on uploads on your web server?
<Directory "/var/www/html/data_uploads">
LimitRequestBody 100000</Directory>
Here I have put limit of 100000 Bytes
Q: - I want to stop people using my site by Proxy server. Is it possible?
Q: - What is mod_evasive module?
Q: - How t to enable PHP scripts on your server?
Q: - Which tool you have used for Apache benchmarking?
ab -n 1000 -c 10 http://www.test.com/test.html
Q: - Can we cache files which are viewed frequently?
Q: - Can we have two apache servers having diff versions?
Yes, you can have two different apache servers on one server, but they can't listen to the same port at the same time.Normally apache listens to port 80 which is the default HTTP port. The second apache version should listen to another port with the Listen option in httpd.conf, for example to port 81.
For testing a new apache version before moving your sites from one version to another, this might be a good option.You just type www.example.com:81 in the browser window and you will be connected to the second apache instance.
apache connection check and error log check
please follow mention step, it may resolve your problem.
date;netstat -ant | grep 80 | grep TIME_WAIT | wc -l
cat /etc/httpd/conf/httpd.conf | grep MaxClients
head /var/log/httpd/error_log
date;netstat -ant | grep 80 | grep TIME_WAIT | wc -l
cat /etc/httpd/conf/httpd.conf | grep MaxClients
head /var/log/httpd/error_log
can u add more question for apache web server question
ReplyDelete