Answer for KodeKloud Question - Apache Troubleshooting

 xFusionCorp Industries utilizes monitoring tools to check the status of every service, application, etc. running on the systems. The monitoring system identified that Apache service is not running on some of the Nautilus Application Servers in Stratos Datacenter.


1. Identify the faulty Nautilus Application Servers and fix the issue. Also, make sure Apache service is up and running on all Nautilus Application Servers. Do not try to stop any kind of firewall that is already running.
2. Apache is running on 3002 port on all Nautilus Application Servers and its document root must be /var/www/html on all app servers.
3. Finally you can test from jump host using curl command to access Apache on all app servers and it should work fine. E.g. curl http://172.16.238.10:3002/


Answer:

#First read each question section carefully 

#login to server 
    ssh <user>@<server>
# swithc to root user
    sudo su 

# check apache service running  in all 3 app servers 
    systemctl status httpd

#check the httpd.conf in (/etc/httpd/conf/httpd.conf)
    as you can see below #ServerName www.example.com:80 need to be edited as per the details 

#Edit httpd.conf file 

    ServerName 172.16.238.10:3002





# Save the file and restart the httpd service
 
    systemctl restart httpd 

# here is the important point, once you started the httpd service sometimes it got failed you need to check the reason for its failure by issuing the status command 

    systemctl status httpd

#There can be many errors/reasons but below 3 errors can be possible as per this question 
    Invalid server root directory httpd.conf file 
    Invalid document root error in httpd.conf file
    Listen to port entry error in httpd conf file 

check above three section in the httpd.conf file and correct it 

# start the apache service again
    systemctl restart httpd

# test using below curl command from jump host to each app server
    curl http://172.16.238.10:3002/ 
    curl http://172.16.238.11:3002/
    curl http://172.16.238.12:3002/


Note: Commands are correct but based on your question the server and user name might differ so please do check.


No comments:

Post a Comment

Featured Post

Answer for Kodekloud DEVOPS Questions - Init container in Kubernetes

Question: 1. Create a Deployment named as ic-deploy-devops. 2. Configure spec as replicas should be 1 , labels app should be ic-devops , ...