Skip to content

Commit df68b44

Browse files
committed
Fix apache logs dir for centos
1 parent 387d61d commit df68b44

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

certbot-apache/certbot_apache/configurator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def add_parser_arguments(cls, add):
9898
help="Apache server root directory.")
9999
add("vhost-root", default=constants.os_constant("vhost_root"),
100100
help="Apache server VirtualHost configuration root")
101+
add("logs-root", default=constants.os_constant("logs_root"),
102+
help="Apache server logs directory")
101103
add("challenge-location",
102104
default=constants.os_constant("challenge_location"),
103105
help="Directory path for challenge configuration.")
@@ -1425,13 +1427,14 @@ def _get_redirect_config_str(self, ssl_vhost):
14251427
"RewriteEngine On\n"
14261428
"RewriteRule %s\n"
14271429
"\n"
1428-
"ErrorLog /var/log/apache2/redirect.error.log\n"
1430+
"ErrorLog %s/redirect.error.log\n"
14291431
"LogLevel warn\n"
14301432
"</VirtualHost>\n"
14311433
% (" ".join(str(addr) for
14321434
addr in self._get_proposed_addrs(ssl_vhost)),
14331435
servername, serveralias,
1434-
" ".join(rewrite_rule_args)))
1436+
" ".join(rewrite_rule_args),
1437+
self.conf("logs-root") ))
14351438

14361439
def _write_out_redirect(self, ssl_vhost, text):
14371440
# This is the default name

certbot-apache/certbot_apache/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
server_root="/etc/apache2",
77
vhost_root="/etc/apache2/sites-available",
88
vhost_files="*",
9+
logs_root="/var/log/apache2",
910
version_cmd=['apache2ctl', '-v'],
1011
define_cmd=['apache2ctl', '-t', '-D', 'DUMP_RUN_CFG'],
1112
restart_cmd=['apache2ctl', 'graceful'],
@@ -23,6 +24,7 @@
2324
server_root="/etc/apache2",
2425
vhost_root="/etc/apache2/sites-available",
2526
vhost_files="*",
27+
logs_root="/var/log/apache2",
2628
version_cmd=['apache2ctl', '-v'],
2729
define_cmd=['apache2ctl', '-t', '-D', 'DUMP_RUN_CFG'],
2830
restart_cmd=['apache2ctl', 'graceful'],
@@ -40,6 +42,7 @@
4042
server_root="/etc/httpd",
4143
vhost_root="/etc/httpd/conf.d",
4244
vhost_files="*.conf",
45+
logs_root="/var/log/httpd",
4346
version_cmd=['apachectl', '-v'],
4447
define_cmd=['apachectl', '-t', '-D', 'DUMP_RUN_CFG'],
4548
restart_cmd=['apachectl', 'graceful'],
@@ -57,6 +60,7 @@
5760
server_root="/etc/apache2",
5861
vhost_root="/etc/apache2/vhosts.d",
5962
vhost_files="*.conf",
63+
logs_root="/var/log/apache2",
6064
version_cmd=['/usr/sbin/apache2', '-v'],
6165
define_cmd=['apache2ctl', 'virtualhosts'],
6266
restart_cmd=['apache2ctl', 'graceful'],
@@ -74,6 +78,7 @@
7478
server_root="/etc/apache2",
7579
vhost_root="/etc/apache2/other",
7680
vhost_files="*.conf",
81+
logs_root="/var/log/apache2",
7782
version_cmd=['/usr/sbin/httpd', '-v'],
7883
define_cmd=['/usr/sbin/httpd', '-t', '-D', 'DUMP_RUN_CFG'],
7984
restart_cmd=['apachectl', 'graceful'],
@@ -91,6 +96,7 @@
9196
server_root="/etc/apache2",
9297
vhost_root="/etc/apache2/vhosts.d",
9398
vhost_files="*.conf",
99+
logs_root="/var/log/apache2",
94100
version_cmd=['apache2ctl', '-v'],
95101
define_cmd=['apache2ctl', '-t', '-D', 'DUMP_RUN_CFG'],
96102
restart_cmd=['apache2ctl', 'graceful'],

0 commit comments

Comments
 (0)