Please find the code in the below link : written by Jerry yesterday for my requirement:
http://ideone.com/CBz6WG.
It's working when I use the $line variable (that is there in that script). When I replace $line contents with the following lines, regexp yields some unneeded output.
set line {
test-443670#show logging
Logging module: enabled
Aggregation time: disabled
Console logging: level debugging
Monitor logging: disabled
Buffered logging: level debugging
Syslog logging: level debugging
Facility: local7
Log Buffer (5003 bytes):
Aug 08 15:44:02 2014: %DATAPLANE-5-: Searching rname(TYPE_A) qweplost.com in dns
_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Unrecognized HTTP URL www.google-analytics.
com. Flow: 0x8707e380.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Unrecognized HTTP URL www.google-analytics.
com. Flow: 0x8707e380.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) ocsp.verisign.net i
n dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:58 2014: %DATAPLANE-5-: Searching rname(TYPE_A) www-google-analytic
s.l.google.com in dns_hash_table.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Searching rname(TYPE_AAAA) www-google-analy
tics.l.google.com in dns_hash_table.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Unrecognized HTTP URL www.babelgum.com. Flo
w: 0x8706ed80.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Unrecognized Server Cert CommonName RapidSS
L CA. Flow: 0x87073e80.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Unrecognized Server Cert CommonName GeoTrus
t Global CA. Flow: 0x87073e80.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Unrecognized Server Cert CommonName *.elite
modellook.com. Flow: 0x87073e80.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Unrecognized Server Cert CommonName RapidSS
L CA. Flow: 0x87073e80.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Unrecognized HTTP URL www.babelgum.com. Flo
w: 0x8706ed80.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Unrecognized Client Hello ServerName ?www.b
abelgum.com. Flow: 0x87073e80. len_analyzed: 183.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Unrecognized HTTP URL www.babelgum.com. Flo
w: 0x8706ed80.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Searching rname(TYPE_A) elite-862037136.eu-
west-1.elb.amazonaws.com in dns_hash_table.
Aug 08 15:43:57 2014: %DATAPLANE-5-: Searching rname(TYPE_A) elite-862037136.eu-
west-1.elb.amazonaws.com in dns_hash_table.
Aug 08 15:43:53 2014: ap622-443670 : %SYSTEM-6-CONFIG_REVISION: Configuration re
vision updated to 36 from 35
Aug 08 15:43:53 2014: ap622-443670 : %SYSTEM-6-CONFIG_REVISION: Configuration re
vision updated to 35 from 34
Aug 08 15:43:53 2014: ap622-443670 : %SYSTEM-6-CONFIG_COMMIT: Configuration comm
it by user 'admin' (mapsh) from '127.0.0.1'
Aug 08 15:43:48 2014: ap622-443670 : %SYSTEM-5-LOGIN: Successfully logged in use
r 'admin' with privilege 'superuser' from 'pts/0'
Aug 08 15:43:48 2014: %AUTH-6-INFO: login[5597]: user 'admin' on 'pts/0' logged
in
Aug 08 15:43:42 2014: %DATAPLANE-5-: Searching rname(TYPE_A) qweplost.com in dns
_hash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:28 2014: %DATAPLANE-5-: Searching rname(TYPE_A) google.com in dns_h
ash_table.
Aug 08 15:43:11 2014: %DATAPLANE-5-: Searching rname(TYPE_A) zeplost.com in dns_
hash_table.
Aug 08 15:42:50 2014: %DATAPLANE-5-: Searching rname(TYPE_A) zeplost.com in dns_
hash_table.
Aug 08 15:42:20 2014: %DATAPLANE-5-: Searching rname(TYPE_A) replost.com in dns_
hash_table.
Aug 08 15:41:59 2014: %DATAPLANE-5-: Searching rname(TYPE_A) replost.com in dns_
hash_table.
Aug 08 15:39:46 2014: ap622-443670 : %SYSTEM-6-LOGOUT: Logged out user 'admin' w
ith privilege 'superuser' from '127.0.0.1'
}
STEPS TO REPRODUCE THE ISSUE:
Run the script that is there in "http://ideone.com/CBz6WG.". You will see the clear output each with seperated by comma.
Now change the contents of $line to above given contents.
It's giving some unwanted lines.
I tried lot to fix this, but I am unable to.
Could any of you, help me on this please?
I don't think it'll be easy to adapt the regex to that situation as this is an inherent issue with the input. I suggest thus removing all newlines from the input first:
regsub -all {[\r\n]} $line "" line
foreach {whole type payload} {...}
ideone demo
Related
I have already tired with the following arguments.
0 13 */28 * ? *
and getting the following output
Wed, 01 Jun 2022 13:00:00 GMT
Wed, 29 Jun 2022 13:00:00 GMT
Fri, 01 Jul 2022 13:00:00 GMT
Fri, 29 Jul 2022 13:00:00 GMT
Mon, 01 Aug 2022 13:00:00 GMT
Mon, 29 Aug 2022 13:00:00 GMT
Thu, 01 Sep 2022 13:00:00 GMT
Thu, 29 Sep 2022 13:00:00 GMT
Sat, 01 Oct 2022 13:00:00 GMT
Sat, 29 Oct 2022 13:00:00 GMT
Expected output is to avoid Saturday and Sunday
I have tried that I can able to create one day of month.
enter image description here
I have been trying to get an SSL certificate for a site using LetsEncrypt, "a free, automated, and open certificate authority (CA), run for the public’s benefit". There is an ACME shell script that is meant to make the process of using LetsEncrypts API easier to receive an SSL certificate. One of their methods requires you to enter in your domain name, and the webroot of your application.
acme.sh --issue -d example.com -w /home/wwwroot/example.com
However, when I try to enter this command, it says that it was unable to verify the domain. I added a --debug flag to the script command, and received this, but am not sure where the problem lies.
[Mon Sep 11 05:05:01 UTC 2017] Using config home:/home/doc4design/.acme.sh
[Mon Sep 11 05:05:01 UTC 2017] DOMAIN_PATH='/home/doc4design/.acme.sh/doc4design.com'
[Mon Sep 11 05:05:01 UTC 2017] Using ACME_DIRECTORY: https://acme-v01.api.letsencrypt.org/directory
[Mon Sep 11 05:05:01 UTC 2017] _init api for server: https://acme-v01.api.letsencrypt.org/directory
[Mon Sep 11 05:05:01 UTC 2017] ACME_KEY_CHANGE='https://acme-v01.api.letsencrypt.org/acme/key-change'
[Mon Sep 11 05:05:01 UTC 2017] ACME_NEW_AUTHZ='https://acme-v01.api.letsencrypt.org/acme/new-authz'
[Mon Sep 11 05:05:01 UTC 2017] ACME_NEW_ORDER='https://acme-v01.api.letsencrypt.org/acme/new-cert'
[Mon Sep 11 05:05:01 UTC 2017] ACME_NEW_ACCOUNT='https://acme-v01.api.letsencrypt.org/acme/new-reg'
[Mon Sep 11 05:05:01 UTC 2017] ACME_REVOKE_CERT='https://acme-v01.api.letsencrypt.org/acme/revoke-cert'
[Mon Sep 11 05:05:01 UTC 2017] Le_NextRenewTime
[Mon Sep 11 05:05:01 UTC 2017] _on_before_issue
[Mon Sep 11 05:05:01 UTC 2017] Le_LocalAddress
[Mon Sep 11 05:05:01 UTC 2017] Check for domain='doc4design.com'
[Mon Sep 11 05:05:02 UTC 2017] _currentRoot='/home/doc4design/webapps/django_2016/doc4_2016'
[Mon Sep 11 05:05:02 UTC 2017] _saved_account_key_hash is not changed, skip register account.
[Mon Sep 11 05:05:02 UTC 2017] Read key length:
[Mon Sep 11 05:05:02 UTC 2017] _createcsr
[Mon Sep 11 05:05:02 UTC 2017] Single domain='doc4design.com'
[Mon Sep 11 05:05:02 UTC 2017] Getting domain auth token for each domain
[Mon Sep 11 05:05:02 UTC 2017] Getting webroot for domain='doc4design.com'
[Mon Sep 11 05:05:02 UTC 2017] _w='/home/doc4design/webapps/django_2016/doc4_2016'
[Mon Sep 11 05:05:02 UTC 2017] _currentRoot='/home/doc4design/webapps/django_2016/doc4_2016'
[Mon Sep 11 05:05:02 UTC 2017] Getting new-authz for domain='doc4design.com'
[Mon Sep 11 05:05:02 UTC 2017] _init api for server: https://acme-v01.api.letsencrypt.org/directory
[Mon Sep 11 05:05:02 UTC 2017] ACME_KEY_CHANGE='https://acme-v01.api.letsencrypt.org/acme/key-change'
[Mon Sep 11 05:05:02 UTC 2017] ACME_NEW_AUTHZ='https://acme-v01.api.letsencrypt.org/acme/new-authz'
[Mon Sep 11 05:05:02 UTC 2017] ACME_NEW_ORDER='https://acme-v01.api.letsencrypt.org/acme/new-cert'
[Mon Sep 11 05:05:02 UTC 2017] ACME_NEW_ACCOUNT='https://acme-v01.api.letsencrypt.org/acme/new-reg'
[Mon Sep 11 05:05:02 UTC 2017] ACME_REVOKE_CERT='https://acme-v01.api.letsencrypt.org/acme/revoke-cert'
[Mon Sep 11 05:05:02 UTC 2017] Try new-authz for the 0 time.
[Mon Sep 11 05:05:02 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/new-authz'
[Mon Sep 11 05:05:02 UTC 2017] payload='{"resource": "new-authz", "identifier": {"type": "dns", "value": "doc4design.com"}}'
[Mon Sep 11 05:05:02 UTC 2017] RSA key
[Mon Sep 11 05:05:02 UTC 2017] GET
[Mon Sep 11 05:05:02 UTC 2017] url='https://acme-v01.api.letsencrypt.org/directory'
[Mon Sep 11 05:05:02 UTC 2017] timeout
[Mon Sep 11 05:05:02 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:02 UTC 2017] ret='0'
[Mon Sep 11 05:05:02 UTC 2017] POST
[Mon Sep 11 05:05:02 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/new-authz'
[Mon Sep 11 05:05:02 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:03 UTC 2017] _ret='0'
[Mon Sep 11 05:05:03 UTC 2017] code='201'
[Mon Sep 11 05:05:03 UTC 2017] The new-authz request is ok.
[Mon Sep 11 05:05:03 UTC 2017] entry='"type":"http-01","status":"pending","uri":"https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012","token":"jSwY3$
[Mon Sep 11 05:05:03 UTC 2017] token='jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c'
[Mon Sep 11 05:05:03 UTC 2017] uri='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:03 UTC 2017] keyauthorization='jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM'
[Mon Sep 11 05:05:03 UTC 2017] dvlist='doc4design.com#jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM#https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i$
[Mon Sep 11 05:05:03 UTC 2017] vlist='doc4design.com#jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM#https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3$
[Mon Sep 11 05:05:03 UTC 2017] ok, let's start to verify
[Mon Sep 11 05:05:03 UTC 2017] Verifying:doc4design.com
[Mon Sep 11 05:05:03 UTC 2017] d='doc4design.com'
[Mon Sep 11 05:05:03 UTC 2017] keyauthorization='jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM'
[Mon Sep 11 05:05:03 UTC 2017] uri='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:03 UTC 2017] _currentRoot='/home/doc4design/webapps/django_2016/doc4_2016'
[Mon Sep 11 05:05:02 UTC 2017] ACME_REVOKE_CERT='https://acme-v01.api.letsencrypt.org/acme/revoke-cert'
[Mon Sep 11 05:05:02 UTC 2017] Try new-authz for the 0 time.
[Mon Sep 11 05:05:02 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/new-authz'
[Mon Sep 11 05:05:02 UTC 2017] payload='{"resource": "new-authz", "identifier": {"type": "dns", "value": "doc4design.com"}}'
[Mon Sep 11 05:05:02 UTC 2017] RSA key
[Mon Sep 11 05:05:02 UTC 2017] GET
[Mon Sep 11 05:05:02 UTC 2017] url='https://acme-v01.api.letsencrypt.org/directory'
[Mon Sep 11 05:05:02 UTC 2017] timeout
[Mon Sep 11 05:05:02 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:02 UTC 2017] ret='0'
[Mon Sep 11 05:05:02 UTC 2017] POST
[Mon Sep 11 05:05:02 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/new-authz'
[Mon Sep 11 05:05:02 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:03 UTC 2017] _ret='0'
[Mon Sep 11 05:05:03 UTC 2017] code='201'
[Mon Sep 11 05:05:03 UTC 2017] The new-authz request is ok.
[Mon Sep 11 05:05:03 UTC 2017] entry='"type":"http-01","status":"pending","uri":"https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012","token":"jSwY3$
[Mon Sep 11 05:05:03 UTC 2017] token='jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c'
[Mon Sep 11 05:05:03 UTC 2017] uri='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:03 UTC 2017] keyauthorization='jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM'
[Mon Sep 11 05:05:03 UTC 2017] dvlist='doc4design.com#jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM#https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i$
[Mon Sep 11 05:05:03 UTC 2017] vlist='doc4design.com#jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM#https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3$
[Mon Sep 11 05:05:03 UTC 2017] ok, let's start to verify
[Mon Sep 11 05:05:03 UTC 2017] Verifying:doc4design.com
[Mon Sep 11 05:05:03 UTC 2017] d='doc4design.com'
[Mon Sep 11 05:05:03 UTC 2017] keyauthorization='jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM'
[Mon Sep 11 05:05:03 UTC 2017] uri='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:03 UTC 2017] _currentRoot='/home/doc4design/webapps/django_2016/doc4_2016'
[Mon Sep 11 05:05:03 UTC 2017] wellknown_path='/home/doc4design/webapps/django_2016/doc4_2016/.well-known/acme-challenge'
[Mon Sep 11 05:05:03 UTC 2017] writing token:jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c to /home/doc4design/webapps/django_2016/doc4_2016/.well-known/acme-challenge/jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8C$
[Mon Sep 11 05:05:03 UTC 2017] Changing owner/group of .well-known to doc4design:doc4design
[Mon Sep 11 05:05:03 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:03 UTC 2017] payload='{"resource": "challenge", "keyAuthorization": "jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM"}'
[Mon Sep 11 05:05:03 UTC 2017] POST
[Mon Sep 11 05:05:03 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:03 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:03 UTC 2017] _ret='0'
[Mon Sep 11 05:05:03 UTC 2017] code='202'
[Mon Sep 11 05:05:03 UTC 2017] sleep 2 secs to verify
[Mon Sep 11 05:05:05 UTC 2017] checking
[Mon Sep 11 05:05:05 UTC 2017] GET
[Mon Sep 11 05:05:05 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:05 UTC 2017] timeout
[Mon Sep 11 05:05:05 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:06 UTC 2017] ret='0'
[Mon Sep 11 05:05:06 UTC 2017] doc4design.com:Verify error:Invalid response from http://doc4design.com/.well-known/acme-challenge/jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c:
[Mon Sep 11 05:05:06 UTC 2017] pid
[Mon Sep 11 05:05:06 UTC 2017] No need to restore nginx, skip.
[Mon Sep 11 05:05:06 UTC 2017] _clearupdns
[Mon Sep 11 05:05:06 UTC 2017] skip dns.
[Mon Sep 11 05:05:06 UTC 2017] _on_issue_err
[Mon Sep 11 05:05:06 UTC 2017] Please check log file for more details: /home/doc4design/.acme.sh/acme.sh.log
[Mon Sep 11 05:05:06 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:06 UTC 2017] payload='{"resource": "challenge", "keyAuthorization": "jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM"}'
[Mon Sep 11 05:05:06 UTC 2017] POST
[Mon Sep 11 05:05:06 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:06 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:06 UTC 2017] _ret='0'
[Mon Sep 11 05:05:03 UTC 2017] Changing owner/group of .well-known to doc4design:doc4design
[Mon Sep 11 05:05:03 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:03 UTC 2017] payload='{"resource": "challenge", "keyAuthorization": "jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM"}'
[Mon Sep 11 05:05:03 UTC 2017] POST
[Mon Sep 11 05:05:03 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:03 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:03 UTC 2017] _ret='0'
[Mon Sep 11 05:05:03 UTC 2017] code='202'
[Mon Sep 11 05:05:03 UTC 2017] sleep 2 secs to verify
[Mon Sep 11 05:05:05 UTC 2017] checking
[Mon Sep 11 05:05:05 UTC 2017] GET
[Mon Sep 11 05:05:05 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:05 UTC 2017] timeout
[Mon Sep 11 05:05:05 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:06 UTC 2017] ret='0'
[Mon Sep 11 05:05:06 UTC 2017] doc4design.com:Verify error:Invalid response from http://doc4design.com/.well-known/acme-challenge/jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c:
[Mon Sep 11 05:05:06 UTC 2017] pid
[Mon Sep 11 05:05:06 UTC 2017] No need to restore nginx, skip.
[Mon Sep 11 05:05:06 UTC 2017] _clearupdns
[Mon Sep 11 05:05:06 UTC 2017] skip dns.
[Mon Sep 11 05:05:06 UTC 2017] _on_issue_err
[Mon Sep 11 05:05:06 UTC 2017] Please check log file for more details: /home/doc4design/.acme.sh/acme.sh.log
[Mon Sep 11 05:05:06 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:06 UTC 2017] payload='{"resource": "challenge", "keyAuthorization": "jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.KZ04ehApOrSMwkeVbG2UT-klFpwOPf_pDEdqVcHf4XM"}'
[Mon Sep 11 05:05:06 UTC 2017] POST
[Mon Sep 11 05:05:06 UTC 2017] url='https://acme-v01.api.letsencrypt.org/acme/challenge/7hHtQgJ6i3H5IplHkU8zq-2n6TVLuUuhN5K9M71nZ8I/1959333012'
[Mon Sep 11 05:05:06 UTC 2017] _CURL='curl -L --silent --dump-header /home/doc4design/.acme.sh/http.header '
[Mon Sep 11 05:05:06 UTC 2017] _ret='0'
[Mon Sep 11 05:05:06 UTC 2017] code='400'
Could someone who is familiar with LetsEncrypt shed some light on why LetsEncrypt can't verify my site, and issue me an SSL certificate ?
The problem is stated on this line:
[Mon Sep 11 05:05:06 UTC 2017] doc4design.com:Verify error:Invalid response from http://doc4design.com/.well-known/acme-challenge/jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c:
The issue is that for whatever reason, external traffic cannot access the file at http://doc4design.com/.well-known/acme-challenge/jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c, which was presumably placed on the filesystem in /home/wwwroot/example.com/.well-known/acme-challenge/jSwY3zdodjpOfh1m6iz1SWNZFFSKnfqdkzj8Cc6Dl2c.
That file needs to be externally accessible at the given URL.
I had this on webfaction.
I see you also have a Django install.
Do you have a separate webapp to serve the static assets?
In my case, I had to place the LetyEncrypt generated file in the same directory where the STATIC assets are located.
I personally settled for this letsencrypt webfaction script last year.
LetsEncrypt utility client for WebFaction hosts
https://github.com/will-in-wi/letsencrypt-webfaction
I have it configured for 2 domains, and last time I checked the LetsEncrypt certificates were renewed automatically.
you can add --debug 2 to get a more detail debug info:
acme.sh --issue -d example.com -w /home/wwwroot/example.com --debug 2
from the log above, I guess it's related to ipv6. your domain has ipv6 AAAA record resolved. Is your website listening at ipv6 ?
Here is my rewrite rule:
RewriteRule ^rest/v(?:[0-9.]+)/((?:[A-Za-z]+)/(?:[A-Za-z]+)(?:/(?:[A-Za-z0-9])+))?\.(json)$ https://localhost/rest/v1/index.php?url=$1&type=$2 [QSA,NC,L]
It’s something of a mouthful so doesn’t help when trying to debug, but it basically allows a URL like this: http://localhost/rest/v1/users/show/12345.json
I’ve tested it in a regex tester online and it passes. But when I add it to my config file, it doesn’t redirect and gives a 404 message as it tries to find the file 1234.json in the show folder of the users folder.
My error log looks like this:
[Tue Oct 27 21:55:16.345721 2015] [mpm_prefork:notice] [pid 4172] AH00169: caught SIGTERM, shutting down
[Tue Oct 27 21:55:21.005180 2015] [suexec:notice] [pid 4318] AH01232: suEXEC mechanism enabled (wrapper: /Applications/XAMPP/xamppfiles/bin/suexec)
[Tue Oct 27 21:55:22.001398 2015] [lbmethod_heartbeat:notice] [pid 4319] AH02282: No slotmem from mod_heartmonitor
[Tue Oct 27 21:55:22.001761 2015] [auth_digest:notice] [pid 4319] AH01757: generating secret for digest authentication ...
[Tue Oct 27 21:55:22.014532 2015] [mpm_prefork:notice] [pid 4319] AH00163: Apache/2.4.10 (Unix) OpenSSL/1.0.1j PHP/5.6.3 mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations
[Tue Oct 27 21:55:22.014627 2015] [core:notice] [pid 4319] AH00094: Command line: '/Applications/XAMPP/xamppfiles/bin/httpd -E /Applications/XAMPP/xamppfiles/logs/error_log -D SSL -D PHP'
[Tue Oct 27 21:55:30.096376 2015] [rewrite:trace3] [pid 4323] mod_rewrite.c(475): [client ::1:50020] ::1 - - [localhost/sid#101019668][rid#10087d4a0/initial] [perdir /Applications/XAMPP/xamppfiles/htdocs/rest/] add path info postfix: /Applications/XAMPP/xamppfiles/htdocs/rest/v1/users -> /Applications/XAMPP/xamppfiles/htdocs/rest/v1/users/show/12345.json
[Tue Oct 27 21:55:30.096499 2015] [rewrite:trace3] [pid 4323] mod_rewrite.c(475): [client ::1:50020] ::1 - - [localhost/sid#101019668][rid#10087d4a0/initial] [perdir /Applications/XAMPP/xamppfiles/htdocs/rest/] strip per-dir prefix: /Applications/XAMPP/xamppfiles/htdocs/rest/v1/users/show/12345.json -> v1/users/show/12345.json
[Tue Oct 27 21:55:30.096507 2015] [rewrite:trace3] [pid 4323] mod_rewrite.c(475): [client ::1:50020] ::1 - - [localhost/sid#101019668][rid#10087d4a0/initial] [perdir /Applications/XAMPP/xamppfiles/htdocs/rest/] applying pattern '^rest/v(?:[0-9.]+)/((?:[A-Za-z]+)/(?:[A-Za-z]+)(?:/(?:[A-Za-z0-9])+))?\\.(json)$' to uri 'v1/users/show/12345.json'
[Tue Oct 27 21:55:30.096521 2015] [rewrite:trace1] [pid 4323] mod_rewrite.c(475): [client ::1:50020] ::1 - - [localhost/sid#101019668][rid#10087d4a0/initial] [perdir /Applications/XAMPP/xamppfiles/htdocs/rest/] pass through /Applications/XAMPP/xamppfiles/htdocs/rest/v1/users
I’m not really sure what’s going on in the error log but it looks like it passes the regex?
Anyone know why it might not be working?
You have this rule in /rest/ directory. Try this rewrite rule instead without rest/ in your rule pattern:
RewriteRule ^v(?:[0-9.]+)/((?:[A-Za-z]+)/(?:[A-Za-z]+)(?:/(?:[A-Za-z0-9])+))?\.json$ v1/index.php?url=$1&type=$2 [QSA,NC,L]
I'll try found question, but I couldn't.
I'll try to deploy my application to CloudBees platform.
In my application.conf file I set params:
###############################################################
# Production config ###########################################
###############################################################
%production.application.mode=prod
%production.jpa.ddl=create
%production.db.url="jdbc:mysql:"${MYSQL_URL_EASYBOOKDB}
%production.db.driver=com.mysql.jdbc.Driver
%production.db.user=${MYSQL_USERNAME_EASYBOOKDB}
%production.db.pass=${MYSQL_PASSWORD_EASYBOOKDB}
before that, i linked my app with db
bees app:bind -db easybook -a zolt/easybook -as easybookdb
I have installed cloudbees module for playframework.
I deploy my app, like that:
play bees:app:deploy --%production
have that answer:
upload complete, response=<?xml version="1.0" encoding="UTF-8"?>
<ApplicationDeployArchiveResponse>
<id>zolt/easybook</id>
<url>http://easybook.zolt.cloudbees.net</url>
</ApplicationDeployArchiveResponse>
Application zolt/easybook deployed: http://easybook.zolt.cloudbees.net
after that, i go to link http://easybook.zolt.cloudbees.net and see tomcat error page...
in log i see that stacktrace:
SEVERE: Exception sending context initialized event to listener instance of class play.server.ServletWrapper
Jan 07 02:56:58 easybook i-9cd9d7e1: play.exceptions.DatabaseException: Cannot connected to the database, Communications link failure
Jan 07 02:56:58 easybook i-9cd9d7e1: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Jan 07 02:56:58 easybook i-9cd9d7e1: at play.db.DBPlugin.onApplicationStart(DBPlugin.java:161)
Jan 07 02:56:58 easybook i-9cd9d7e1: at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:525)
Jan 07 02:56:58 easybook i-9cd9d7e1: at play.Play.start(Play.java:533)
Jan 07 02:56:58 easybook i-9cd9d7e1: at play.Play.init(Play.java:305)
Jan 07 02:56:58 easybook i-9cd9d7e1: at play.server.ServletWrapper.contextInitialized(ServletWrapper.java:78)
Jan 07 02:56:58 easybook i-9cd9d7e1: at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
Jan 07 02:56:58 easybook i-9cd9d7e1: at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
Jan 07 02:56:58 easybook i-9cd9d7e1: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
Jan 07 02:56:58 easybook i-9cd9d7e1: at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
Jan 07 02:56:58 easybook i-9cd9d7e1: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
Jan 07 02:56:58 easybook i-9cd9d7e1: at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
Jan 07 02:56:58 easybook i-9cd9d7e1: at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.staxnet.appserver.TomcatServerBase.startContainer(TomcatServerBase.java:120)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.staxnet.appserver.TomcatServerBase.start(TomcatServerBase.java:190)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.staxnet.appserver.StaxAppServer.main(StaxAppServer.java:89)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.staxnet.appserver.SnazAppServer.main(SnazAppServer.java:26)
Jan 07 02:56:58 easybook i-9cd9d7e1: at net.stax.appserver.bootstrap.Bootstrap.invokeAppServerMain(Bootstrap.java:41)
Jan 07 02:56:58 easybook i-9cd9d7e1: at net.stax.appserver.bootstrap.Bootstrap.main(Bootstrap.java:30)
Jan 07 02:56:58 easybook i-9cd9d7e1: Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Jan 07 02:56:58 easybook i-9cd9d7e1: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:348)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2391)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2428)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2213)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:797)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.sql.DriverManager.getConnection(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.sql.DriverManager.getConnection(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at play.db.DBPlugin.onApplicationStart(DBPlugin.java:109)
Jan 07 02:56:58 easybook i-9cd9d7e1: ... 17 more
Jan 07 02:56:58 easybook i-9cd9d7e1: Caused by: java.net.ConnectException: Connection refused
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.PlainSocketImpl.socketConnect(Native Method)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.SocksSocketImpl.connect(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.Socket.connect(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.Socket.connect(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.Socket.<init>(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at java.net.Socket.<init>(Unknown Source)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
Jan 07 02:56:58 easybook i-9cd9d7e1: at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:298)
Jan 07 02:56:58 easybook i-9cd9d7e1: ... 28 more
Jan 07 02:56:58 easybook i-9cd9d7e1: Jan 07, 2014 10:56:57 AM org.apache.catalina.core.StandardContext start
Jan 07 02:56:58 easybook i-9cd9d7e1: SEVERE: Error listenerStart
if i try connect to DB over MysqWorkbench it's all fine...
what am I doing wrong?
I think you are not binding your database with your application in the right way.
According with Play1 ClickStart in which the database binding is working. These are the steps:
1.In application.conf you should have this:
db=java:comp/env/jdbc/mydb
jpa.dialect=org.hibernate.dialect.MySQL5Dialect
2.Bind the application to the database
$bees app:bind -a appName -db dbName -as mydb
3.Redeploy the application
bees app:deploy -a MY_APP -t tomcat7 myapp.war
Official documentation about Play1 is here.
Example:
[Fri Oct 18 17:39:11 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/client.com.br/app/etc/local.xml
[Fri Oct 18 17:39:38 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/client.com.br/app/etc/local.xml
[Fri Oct 18 17:39:44 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/mariapiacasa.com.br/app/etc/local.xml
[Fri Oct 18 17:42:41 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/client.com.br/app/etc/local.xml
[Fri Oct 18 17:47:33 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/client.com.br/app/etc/local.xml
[Fri Oct 18 17:47:49 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/client.com.br/app/etc/local.xml
[Fri Oct 18 17:47:58 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/client.com.br/app/etc/local.xml
[Fri Oct 18 17:50:02 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/client.com.br/app/etc/local.xml
[Fri Oct 18 17:59:37 2013] [error] [client x.x.x.x] client denied by server configuration: /home/client/client.com.br/app/etc/local.xml
[Fri Oct 18 19:05:34 2013] [error] [client x.x.x.x] File does not exist: /home/client/client.com.br/skin/frontend/default/MAG080138
In this example I do not want to be monitored lines with the message client denied by server configuration: /home/client/client.com.br/app/etc/local.xml.
Everything else should be monitored.
I know how to find what I do not want to appear with the following regex:
.*client denied by server configuration:.*\/app\/etc\/local\.xml$
In the above example should be monitored only the line:
[Fri Oct 18 19:05:34 2013] [error] [client x.x.x.x] File does not exist: /home/client/client.com.br/skin/frontend/default/MAG080138
In regex you can use a negative lookahead, using the (?!<regexpression>), to match something if and only if it is not followed by something else.
So in order to match any line that does not contain the expression:
client denied by server configuration:.*\/app\/etc\/local\.xml
You can use the negative lookahead in this way:
^(?:.(?!client denied by server configuration:.*\/app\/etc\/local\.xml))*$
^ non capture group
^ any character
^not followed by
^ your regex
(see it in action)
However, this regex will perform a lot better:
^.* \[client x.x.x.x\] (?!client denied by server configuration:.*\/app\/etc\/local\.xml).*$
(see it in action)
since the negative lookahead is performed only once instead of after every character match.
Hope this helps.
Good luck!