Please tell me how I can use httpd.conf on Apache CentOS


#1

I want to use /etc/httpd/conf/httpd.conf for 443 vhosts.
So I have editted “certbot/certbot-apache/certbot_apache/constants.py”

Default

CLI_DEFAULTS_CENTOS = dict(
server_root="/etc/httpd",
vhost_root="/etc/httpd/conf.d",
vhost_files="*.conf",
version_cmd=[‘apachectl’, ‘-v’],
define_cmd=[‘apachectl’, ‘-t’, ‘-D’, ‘DUMP_RUN_CFG’],
restart_cmd=[‘apachectl’, ‘graceful’],
conftest_cmd=[‘apachectl’, ‘configtest’],
enmod=None,
dismod=None,
le_vhost_ext="-le-ssl.conf",
handle_mods=False,
handle_sites=False,
challenge_location="/etc/httpd/conf.d", ““
challenge_location=”/etc/httpd”,
MOD_SSL_CONF_SRC=pkg_resources.resource_filename(
“certbot_apache”, “centos-options-ssl-apache.conf”)
)

Editted

CLI_DEFAULTS_CENTOS = dict(
server_root="/etc/httpd",
vhost_root="/etc/httpd/conf",
vhost_files=“httpd.conf”,
version_cmd=[‘apachectl’, ‘-v’],
define_cmd=[‘apachectl’, ‘-t’, ‘-D’, ‘DUMP_RUN_CFG’],
restart_cmd=[‘apachectl’, ‘graceful’],
conftest_cmd=[‘apachectl’, ‘configtest’],
enmod=None,
dismod=None,
le_vhost_ext="-le-ssl.conf",
handle_mods=False,
handle_sites=False,
challenge_location="/etc/httpd",
MOD_SSL_CONF_SRC=pkg_resources.resource_filename(
“certbot_apache”, “centos-options-ssl-apache.conf”)
)

But I got following error.
“2016-08-08 15:07:39,226:ERROR:certbot_apache.configurator:No vhost exists with servername or alias of: xxxxx.xxx. No vhost was selected. Please specify servernames in the Apache config”


#2

Uh, I’m not sure why you edited that file.

Why didn’t you simply tell certbot to use Apache, or tell certbot to only create the certificate (“certonly”) and use webroot?

I’m not sure what you were trying to do. You don’t have to edit that file to get a certificate.


#3

Hi again,

Follow this link:

Choose “Apache” for your webserver, and then choose your version of CentOS. It will provide you with the commands you need to use to get your certificates. (But I’d restore the constants.py file first!)


#4

Dear DarkSteve,

Thank you. On my server because of our controlpanel we cannot use ssl.conf.


#5

Dear DarkSteve,

I’ll check https://certbot.eff.org/.


#6

Oh, I didn’t realise you were using hosting. That complicates things. I’m not sure I’m able to help much there!

You could also try a site like:
https://letsgetssl.net/index.html

That site still uses Let’s Encrypt, but helps you navigate awkward control panels. Instead of the client doing everything for you, it breaks the steps down and allows you to manually manage your certificates.

Sorry, I’m not sure what else to suggest!


#7

On my server, when I use ssl.conf I can set certificate without any trouble.
But without using httpd.conf I can not set certificate, because of ‘cannot find vhost’.
So I edited “certbot/certbot-apache/certbot_apache/constants.py” to use httpd.conf instead of ssl.conf


#8

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