Can't find port 80

Hey all! Thanks in advance for all the help :slight_smile:

My domain is: roninkaratedojos.com

I ran this command: sudo certbot --apache -v

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): roninkaratedojos.com
Requesting a certificate for roninkaratedojos.com
Performing the following challenges:
http-01 challenge for roninkaratedojos.com
Cleaning up challenges
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version):
Apache/2.4.53
OpenSSL/3.0.7

The operating system my web server runs on is (include version):
CentOS Stream 9

My hosting provider, if applicable, is:
Myself

I can login to a root shell on my machine (yes or no, or I don't know):
Yes, have root access to the machine

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
No control panel

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
certbot 2.1.0

I can't for the life of me figure out what's happening here... Website is live, all working as it should on :80, but whenever I try to add a config file to /etc/httpd/conf.d/ - it crashes. Will not restart until I remove the conf file.

The conf file I've been trying to add (roninkaratedojos.com.conf):

<VirtualHost *:80>
        ServerName roninkaratedojos.com
        DocumentRoot /var/www/html/RoninKarateDojos.com
        ServerAlias www.roninkaratedojos.com
        ErrorLog /var/www/error.log
        CustomLog /var/www/requests.log combined
</VirtualHost>

I can't figure out how to tell certbot that I own roninkaratedojos.com... Help, please?

What does apachectl configtest say, when the problematic conf file is there?

(On CentOS Stream the command might be httpd -t, I can't remember right now).

3 Likes

Thanks for replying _az!
Without file:

# apachectl configtest
Syntax OK
# httpd -t
Syntax OK

With file:

# apachectl configtest
Syntax OK
# httpd -t
Syntax OK

but attempting to start service with the file:

# systemctl start httpd
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xeu httpd.service" for details.

It is worth noting that I did have to change the line DocumentRoot to `
``
/var/www/html/roninkaratedojos.com

to reflect the actual path

Weird.

The logs from systemd might be illuminating:

journalctl -u httpd -f
3 Likes
Feb 09 06:08:06 roninkaratedojos.com systemd[1]: Starting The Apache HTTP Server...
Feb 09 06:08:06 roninkaratedojos.com systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 09 06:08:06 roninkaratedojos.com systemd[1]: httpd.service: Failed with result 'exit-code'.
Feb 09 06:08:06 roninkaratedojos.com systemd[1]: Failed to start The Apache HTTP Server.
Feb 09 06:10:50 roninkaratedojos.com systemd[1]: Starting The Apache HTTP Server...
Feb 09 06:10:50 roninkaratedojos.com systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 09 06:10:50 roninkaratedojos.com systemd[1]: httpd.service: Failed with result 'exit-code'.
Feb 09 06:10:50 roninkaratedojos.com systemd[1]: Failed to start The Apache HTTP Server.

As requested :slight_smile:

Third time lucky perhaps: what's the latest contents of /var/log/httpd/error_log? (Or whatever the closest file to that is).

5 Likes

I think we're onto something with the /var/log/httpd/error_log, I was getting:

(13)Permission denied: AH00091: httpd: could not open error log file /var/www/error.log.
AH00015: Unable to open logs

I tried chown apache:apache on both the log files to no avail, but commenting out the two lines in the config that pointed to logging locations seems to have worked.

I have now run certbot and everything has suceeded!! Thank you so much, I realise that this was possibly outside of typical support realms

3 Likes

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