Messed up apache trying to change letsencrypt domain

Hello everyone
I was trying to change domain name registered with letsencrypt. Messed it up and tried to delete everything related to letsencrypt.
In the process, I probably deleted something important related to apache.
Get following message now when I run

systemctl status apache2.service

apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
Active: failed (Result: exit-code) since Tue 2017-08-29 09:52:46 CEST; 4min 8s ago
Docs: man:systemd-sysv-generator(8)
Process: 3542 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Aug 29 09:52:46 apache2[3542]: *
Aug 29 09:52:46 apache2[3542]: * The apache2 configtest failed.
Aug 29 09:52:46 apache2[3542]: Output of config test was:
Aug 29 09:52:46 apache2[3542]: apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on
Aug 29 09:52:46 apache2[3542]: Action ‘configtest’ failed.
Aug 29 09:52:46 apache2[3542]: The Apache error log may have more information.
Aug 29 09:52:46 systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 29 09:52:46 systemd[1]: Failed to start LSB: Apache2 web server.
Aug 29 09:52:46 systemd[1]: apache2.service: Unit entered failed state.
Aug 29 09:52:46 systemd[1]: apache2.service: Failed with result ‘exit-code’.

I do not want to start all over as everything was working perfectly before this. Is there a way to reinstall apache and keep everything as is?
I will really appreciate all the help I can get

Wouldn’t mind knowing this as well. How to change the domain so no errors with letsencrypt.

What is on this line in that file specified from the error?

IncludeOptional sites-enabled/*.conf

Alright, what are the contents of /etc/apache2/sites-enabled/default-ssl.conf

It probably wrote the sed command to include the domains certificate at the expressed location, however, the certificate didn’t actually build. If that’s the case, we can reset the default-ssl.conf file to the default for the certificate files at line #40-41; followed by a restart of apache.

Thanks for the reply. I did as per your suggestion but still have the exact same error.

I could PM you and we can discuss server details, I’ll take a look directly.

Thanks. pmed the details.

So what do you do if you need to change the domain? I mean from say the quickbox dns to a different one with a purchased domain? What would you do about that? I have domains for my servers and have the domain pointed to the new dns but not sure where to begin with changing things over.

You should be able to generate the certificates for the new domain name if the IP is pointed at the new domain. Then go through and edit the ssl fields in the /etc/apache2/sites-enabled/default-ssl.conf file to point at your new certificate. Restart apache afterwards as is needed.

i pretty much did the exact same thing trying to update my LE cert. i did it this way because i didnt want a url for my dashboard, and somehow apache got messed up and wanted to use a url for it. my issue might not be exactly the same here.

i removed /etc/quickbox
reinstalled quickbox
box upgrade
redid plex cdn with new url, since i cant get that shit to update for the life of me.
now everything is working great until i have to renew again XD

so you run box install letsencrypt to get the new certificate and what exactly to you edit in the default-ssl.conf? Reading through that I don’t see what I should edit. I did what you said at least I thought I did now I get an apache2 error.

Job for apache2.service failed because the control process exited with error code. See “systemctl status apache2.service” and “journalctl -xe” for details.

I’m probably missing something. Is there another location that needs to be edited?

the error code will tell you where the error is, after running LE it should tell you where your SSL files are stored, then you would edit the apache2 config to reflect those locations.

Any chance anyone can lend a hand with this as I am a little lost. I’m certain the ssl cert was installed and just not sure what to edit and make it work right. Everything I’ve tried I get the same error so I put it back the way it was. If someone can help awesome and then just explain what to do and I can fix my other servers.

Hey @taterzero, can you check out this post I just made and see if it addresses your issue?

If not, shoot me a PM and I’ll take a look. I have a meeting here in the next couple of hours, but I should be back at my computer within the next 4 hours (from the time of this posting)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.