Comprehensive Middleware Admin Interview Q&A (3.
4 Years Experience)
Apache HTTP Server
How do you install and configure Apache on Linux?
Use `yum install httpd` or `apt-get install apache2` depending on the OS. Configure
`httpd.conf` or `apache2.conf` to set ServerName, DocumentRoot, VirtualHost, and load
necessary modules. Start with `systemctl start httpd`. Enable at boot using `systemctl enable
httpd`.
How do you enable SSL on Apache?
Install mod_ssl, create or obtain a certificate, configure `SSLEngine on`, `SSLCertificateFile`,
and `SSLCertificateKeyFile` inside a `<VirtualHost *:443>` block in `httpd-ssl.conf`. Restart
Apache after changes.
What is the role of Virtual Hosts in Apache?
Virtual Hosts allow you to run multiple websites on the same server by defining different
domain names or ports in the configuration.
How do you troubleshoot if Apache is not starting?
Check syntax with `apachectl configtest`, look for port conflicts using `netstat`, and examine
logs in `/var/log/httpd/error_log` or `/var/log/apache2/error.log`.
Apache Tomcat
How do you configure Tomcat?
Edit `server.xml` for port configurations, connectors, and service definitions. Use
`context.xml` to define application contexts and JNDI resources.
What steps do you follow for performance tuning in Tomcat?
Adjust JVM settings (`-Xms`, `-Xmx`, GC options), use connection pooling, configure thread
settings in `server.xml`, and monitor with JConsole or VisualVM.
How do you secure a Tomcat server?
Remove default apps, disable auto-deployment, use SSL, restrict manager access, and set
proper file permissions.
Middleware Templates and Automation
What are middleware hosting templates?
Templates are pre-defined sets of configurations and scripts used to deploy middleware
consistently. They often include config files, shell scripts, and environment setup.
Have you used automation tools for deployments?
Yes, I have used shell scripts and Ansible to automate middleware installations and
configurations. These reduce manual errors and improve speed.
AWS Cloud and EC2
How do you deploy middleware on AWS EC2?
Launch an EC2 instance, configure the OS and network, install middleware software, and
open required ports in Security Groups.
What AWS services have you worked with?
Primarily EC2, S3 for storing logs, IAM for permissions, CloudWatch for monitoring, and
Route 53 for DNS.
How do you troubleshoot EC2 instance connectivity?
Check Security Groups, network ACLs, VPC settings, and use `ping`, `traceroute`, and `curl` to
verify access. Also verify key pair and instance state.
General Troubleshooting and Networking
How do you troubleshoot a slow web application hosted on Tomcat?
Check JVM memory usage, garbage collection logs, application logs, database response time,
and server load using tools like `top`, `vmstat`, and JConsole.
How do you use ping in network troubleshooting?
`ping` tests connectivity; `traceroute` finds the path; if ping fails, check firewall rules, DNS,
and routing. Also use `telnet` or `curl` to test port availability.
How do you analyze application server logs?
Look for ERROR or WARN levels in logs. In Tomcat, use `catalina.out`, `localhost.log`, and
`manager.log`. For Apache, check `error_log` and `access_log`.
Security and Best Practices
What are security best practices for Apache/Tomcat?
Keep software updated, use SSL, restrict directory listings, disable unused modules,
configure firewalls, and monitor logs regularly.
✅ Why scripting is relevant:
Middleware tasks often involve:
Automating deployments (e.g., WAR files)
Log rotation or parsing
Service monitoring and restarts
Health checks
Backup and recovery
Configuration changes at scale
Common scripting interview questions with sample answers:
1. What scripting languages are you comfortable with?
Answer:
I primarily use Bash scripting for Linux-based automation. I also have experience
with Python for log parsing and AWS automation, and Ansible for configuration
management and application deployment.
2. Can you write a Bash script to check if Apache and Tomcat services are running?
Answer:
bash
CopyEdit
#!/bin/bash
services=("apache2" "tomcat")
for service in "${services[@]}"; do
if systemctl is-active --quiet "$service"; then
echo "$service is running"
else
echo "$service is NOT running"
fidone
3. Have you used scripting in AWS?
Answer:
Yes. I’ve used Boto3 with Python to automate EC2 instance management, such as
starting/stopping servers during maintenance windows. I’ve also used shell scripts with
AWS CLI for backups, AMI creation, and log retrieval from S3.
4. How have you used Ansible in your role?
Answer:
I’ve written Ansible playbooks to deploy Tomcat, copy WAR files, configure system
parameters, and manage services across multiple servers. This helps ensure consistency
and rapid deployment, especially in pre-production and production environments.
5. Can you provide an example of a script you used in your daily tasks?
Answer:
Sure. I created a script that:
Pulled logs from Tomcat daily
Compressed them
Stored them in a timestamped folder
Uploaded them to an S3 bucket
This reduced manual work and helped the dev team with historical log analysis.
6. How do you handle errors in scripts?
Answer:
I use conditional statements and exit codes, log the output with exec &> logfile.log, and add
error handling logic like if [ $? -ne 0 ]; then .... For critical tasks, I use alerts like mailx or
integration with Slack/webhooks for notifications.
7. Have you used crontab for automation?
Answer:
Yes, I’ve used cron jobs to schedule:
Log cleanup
Daily service restarts
Health check scripts
Backup tasks