go-acme / lego

Let's Encrypt/ACME client and library written in Go
https://go-acme.github.io/lego/
MIT License
8.01k stars 1.02k forks source link

Using --webroot hangs forever at "Trying to solve HTTP-01" #310

Open paulehoffman opened 8 years ago

paulehoffman commented 8 years ago

Greetings. I want to migrate from --dns to --webroot. I'm running under fairly recent Apache. I make .well_known in the host directory. I start:

lego --email="phoffman@mydomainhere.com" --webroot="/usr/web/mydomainhere.com" --domains="mydomainhere.com"  run
2016/11/01 22:38:56 [INFO][mydomainhere.com] acme: Obtaining bundled SAN certificate
2016/11/01 22:38:56 [INFO][mydomainhere.com] acme: Could not find solver for: dns-01
2016/11/01 22:38:56 [INFO][mydomainhere.com] acme: Trying to solve HTTP-01

The acme-challenge directory under .well-known is created, a file is in that directory, and I can wget that file from a different process. But lego hangs forever at "Trying to solve HTTP-01".

My apache config is:

Define Full www.mydomainhere.com
Define Short mydomainhere.com

<VirtualHost ${Full}:80>
ServerName ${Full}
Redirect / https://${Full}/
DocumentRoot /usr/web/${Short}
</VirtualHost>

<VirtualHost ${Short}:80>
ServerName ${Short}
Redirect / https://${Full}/
</VirtualHost>

<VirtualHost ${Full}:443>
ServerName ${Full}
DocumentRoot /usr/web/${Short}
CustomLog ${APACHE_LOG_DIR}/${Short}.access.log common
ErrorLog ${APACHE_LOG_DIR}/${Short}.error.log
SSLEngine on
SSLCertificateFile /etc/apache2/Certificates/${Short}.crt
SSLCertificateKeyFile /etc/apache2/Certificates/${Short}.key
SSLCertificateChainFile /etc/apache2/Certificates/chain.pem
</VirtualHost>

Clues would be appreciated.

mholt commented 8 years ago

Are you using the most recent release of lego?

paulehoffman commented 8 years ago

I believe so:

# lego --version
lego version v0.3.1-0-g96a2477
xenolf commented 8 years ago

@paulehoffman could you try with the latest version from master?

paulehoffman commented 8 years ago

Catching up again. I'm not sure how to create "the latest version from master", probably due to me being a complete newbie on Go. It looks like I need to pull in a bunch of libraries I have not.

I pulled down the latest with "git clone git@github.com:xenolf/lego.git", then tried "go run ~/lego/cli.go --email="phoffman@mydomainhere.com" --webroot="/usr/web/mydomainhere.com" --domains="mydomainhere.com" run", but I get a bunch of errors:

/home/phoffman/lego/cli.go:6:2: cannot find package "fmt" in any of:
    /home/phoffman/go/src/fmt (from $GOROOT)
    /home/phoffman/golang/src/fmt (from $GOPATH)
/home/phoffman/lego/cli.go:13:2: cannot find package "github.com/urfave/cli" in any of:
    /home/phoffman/go/src/github.com/urfave/cli (from $GOROOT)
    /home/phoffman/golang/src/github.com/urfave/cli (from $GOPATH)
. . .

Cluebat appreciated.

rawtaz commented 6 years ago

@paulehoffman Late to the party here, but if you just run go get -u -v github.com/xenolf/lego Go should get the source for you into $GOPATH/src/github.com/xenolf/lego (see go help gopath for more information). You can then go to that folder and run go build, and after that ./lego to run the program.