1. Caddy version (caddy version
):v2.0.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
2. How I run Caddy:
For the output below caddy is run as in # caddy run -config /usr/local/www/Caddyfile - watch
In the Jail the rc.conf includes
php_fpm_enable="yes"
mysql_enable="yes"
caddy_enable="YES"
a. System environment:
Freenas Jail - built as shown in the Links to Relevant Resources below.
b. Command:
caddy run -config /usr/local/www/Caddyfile - watch
c. Service/unit/compose file:
paste full file contents here
d. My complete Caddyfile or JSON config:
blog.endnot.casa {
root * /var/www/wordpress
log /var/log/caddy_log.log
encode gzip
file_server
}
php_fastcgi unix//run//usr/local/etc/php7.3-fpm.sock
}
For whatever reason the log file does not create.
3. The problem Iām having:
As this is my first attempt at building a jail/website, I really donāt know how many problems this jail has.
This problem reported by caddy appears to be a DNS issue. I have searched the error looked at logs but at this point, I am lost. I do not have any ports open and really did not plan to make this site available to the internet.
If I try to connect to the server from chrome Caddy reports LS handshake error : no certicate available for āblog.endnot.casaā I did update my hosts file to point to the Jail.
4. Error messages and/or full log output:
root@wordpress:~ # caddy run -config /usr/local/www/Caddyfile - watch
2020/07/02 13:49:14.226 INFO using provided configuration {"config_file": "/usr/local/www/Caddyfile", "config_adapter": ""}
2020/07/02 13:49:14.227 INFO admin admin endpoint started {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["localhost:2019", "[::1]:2019", "127.0.0.1:2019"]}
2020/07/02 08:49:14 [INFO][cache:0xc0003dfe00] Started certificate maintenance routine
2020/07/02 13:49:14.227 INFO http server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2020/07/02 13:49:14.227 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2020/07/02 13:49:14.228 INFO tls cleaned up storage units
2020/07/02 13:49:14.228 INFO http enabling automatic TLS certificate management
2020/07/02 13:49:14.228 INFO autosaved config {"file": "/root/.config/caddy/autosave.json"}
2020/07/02 13:49:14.228 INFO serving initial configuration
2020/07/02 08:49:14 [INFO][unix] Obtain certificate; acquiring lock...
2020/07/02 08:49:14 [INFO][unix] Obtain: Lock acquired; proceeding...
2020/07/02 08:49:14 [INFO][php_fastcgi] Obtain certificate; acquiring lock...
2020/07/02 08:49:14 [INFO][php_fastcgi] Obtain: Lock acquired; proceeding...
2020/07/02 08:49:14 [INFO][unix] Waiting on rate limiter...
2020/07/02 08:49:14 [INFO][unix] Done waiting
2020/07/02 08:49:14 [INFO] [unix] acme: Obtaining bundled SAN certificate given a CSR
2020/07/02 08:49:14 [INFO][php_fastcgi] Waiting on rate limiter...
2020/07/02 08:49:14 [INFO][php_fastcgi] Done waiting
2020/07/02 08:49:14 [INFO] [php_fastcgi] acme: Obtaining bundled SAN certificate given a CSR
2020/07/02 08:49:14 [ERROR] acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-order :: urn:ietf:params:acme:error:rejectedIdentifier :: Error creating new order :: Cannot issue for "unix": Domain name needs at least one dot, url: (challenge=tls-alpn-01 remaining=[http-01])
2020/07/02 08:49:14 [ERROR] acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-order :: urn:ietf:params:acme:error:rejectedIdentifier :: Error creating new order :: Cannot issue for "php_fastcgi": Domain name contains an invalid character, url: (challenge=http-01 remaining=[tls-alpn-01])
2020/07/02 08:49:15 [INFO] [blog.endnot.casa] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/5620214597
20
5. What I already tried:
php-fpm seems to be ok- i am running it with debug and there are no errors.
6. Links to relevant resources:
not sure if this helps, but these are the steps that I followed.
1. Fetch
https://github.com/caddyserver/caddy/releases/download/v2.0.0/caddy_2.0.0_freebsd_amd64.tar.gz
2. tar -xjf caddy_2.0.0_freebsd_amd64.tar.gz
3. mv caddy /usr/local/bin/
4. /usr/local/www/Caddyfile
------
blog.mydomain.com {
root * /var/www/wordpress
encode zstd gzip
file_server
}
php_fastcgi unix//run//usr/local/etc/php7.3-fpm.sock
}
-------
5. pkg install php73 mysql57-server mysql57-client php73-xml php73-dom php73-curl php73-ctype php73-json php73-ftp php73-hash php73-session php73-pecl-imagick php73-pecl-memcached php73-tokenizer php73-mbstring php73-fileinfo php73-exif php73-openssl php73-filter php73-zip php73-zlib php73-mysqli php73-iconv php73-gd
6. append /etc/rc.conf
php_fpm_enable="yes"
mysql_enable="yes"
caddy_enable="YES"
7. edited usr/local/etc/php-fpm.conf
events.mechanism = kqueue ; only line of file that changed
8. edited /usr/local/etc/php-fpm.d/www.conf
a. #uncommented these lines
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
b. #added these lines
php_admin_value[memory_limit] = 512M
php_admin_value[cgi.fix_pathinfo] = 0
php_admin_value[post_max_size] = 13M
php_admin_value[upload_max_filesize] = 13M
php_admin_value[date.timezone] = "America/Chicago"
9. create mysql database wordpress
a. service mysql-server start # check netstat -an | grep 3306
b. mysql_secure_installation
#new root password, disable anonymous logins and root logins from external and remove the temp database
c. mysql āu root āp
d. create database wordpress;
e. grant all privileges on wordpress.* to 'wpuser'@'localhost' identified by 'wppassword';
f. flush privileges;
g. exit
10 fetch https://wordpress.org/latest.tar.gz
11. tar -xzvf latest.tar.gz
12. mv wordpress /var/www/