Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
b09d597c
Commit
b09d597c
authored
Apr 05, 2016
by
neil
Browse files
fix compatible: apache before 2.4 and after 2.4
parent
615cb360
Changes
1
Hide whitespace changes
Inline
Side-by-side
le.sh
View file @
b09d597c
...
...
@@ -783,13 +783,31 @@ _setApache() {
_info
"The backup file will be deleted on sucess, just forget it."
#add alias
echo
"
apacheVer
=
"
$(
apachectl
-V
|
grep
"Server version:"
|
cut
-d
:
-f
2 |
cut
-d
" "
-f
2 |
cut
-d
'/'
-f
2
)
"
_debug
"apacheVer"
"
$apacheVer
"
apacheMajer
=
"
$(
echo
"
$apacheVer
"
|
cut
-d
.
-f
1
)
"
apacheMinor
=
"
$(
echo
"
$apacheVer
"
|
cut
-d
.
-f
2
)
"
if
[[
"
$apacheVer
"
]]
&&
[[
"
$apacheMajer
"
-ge
"2"
]]
&&
[[
"
$apacheMinor
"
-ge
"4"
]]
;
then
echo
"
Alias /.well-known/acme-challenge
$ACME_DIR
<Directory
$ACME_DIR
>
Require all granted
</Directory>
"
>>
$httpdconf
else
echo
"
Alias /.well-known/acme-challenge
$ACME_DIR
<Directory
$ACME_DIR
>
Order allow,deny
Allow from all
</Directory>
"
>>
$httpdconf
fi
if
!
apachectl
-t
;
then
_err
"Sorry, apache config error, please contact me."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment