0

I recently inherited a LAMP server (Ubuntu 16.04) from a client with a bunch of domains and subdomains configured (no control panel). I was able to find all the configuration files but one. Let's call that one xxx.domain.com.

That domain uses an ssl I am trying to find where its SSL virtual host configuration block is because I cannot find it with the others.

I looked in the usual places ( /etc/apach2/... and /etc/ssl,... ) using grep -ri . . . without much luck.

How would you proceed? PS: Server management is not my strongest suit, just one of those a dev's gotta do

2 Answers 2

2

A LAMP stack with Apache 2.2 on Ubuntu 16.04 should have apache2ctl. Finding the configuration is easy with apache2ctl -S, giving you both the file and the line where it starts. E.g.

sudo /usr/sbin/apache2ctl -S | grep "443 namevhost xxx.example.com"
2
  • This is the closest to finding the file, but still can't find it.
    – codiiv
    May 1, 2018 at 11:23
  • @codiiv If still can't find the domain configuration you need to make sure that this domain is really served by this particular Apache instance. Make a request to some random uniq URL on this domain (eg. domain.com/123456) and then grep -f 123456 /var/log/apache/*-access.log or grep for your IP in the same access logs.
    – AlexD
    May 1, 2018 at 12:52
1

You can search for SSLCertificateFile directive in your /etc/apache with grep -fri SSLCertificateFile /etc/apache and then check each certificate file for CN with openssl x509 -noout -subject -in server.pem

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .