As the comments on the question suggest, there are regulatory concerns that may be relevant. But those are dependent on jurisdiction, so let's not get into that. A separate question, tagged with your location, would be appropriate.
Let's focus just on the technical aspects.
There are two concerns with getting a radio link over these distances: radio horizon and path loss.
Radio Horizon
The radio horizon is how far the antenna can "see" before the curvature of the earth gets in the way. Assuming flat terrain, it can be estimated by:
$$ \text{horizon in km} = 3.57 \sqrt{\text{height in meters}} $$
(For a result in miles and a height in feet, change the constant to 1.23.)
The horizons on each end add. So if one antenna has a horizon of 20 km and the other 10 km, the antennas could be up to 30 km apart.
With this equation, you can see to have a chance at a link over a distance of 50 km, you'll need a tower at least 50 meters tall on each end. Unless you are lucky to have one or both of the stations on a hilltop, this alone probably precludes the possibility of a simple DIY solution.
Path Loss
Path loss (assuming no obstructions) can be estimated with the Friis transmission equation to make a link budget. For Wi-fi to have any chance of working at all, you'll need a received power of at least -85 dBm. To have it work well, -60 dBm.
The free space path loss at 2.4 GHz at a distance of 50 km is 134 dB. A Wi-fi transmitter is typically 100 mW or 20 dBm. 20 dBm - 134 dB = -114 dBm, which is 29 dB below the absolute minimum of -85 dBm. That shortfall will have to come from antenna gain and/or amplifiers.
So one solution would be an antenna with 15 dB gain on each end, that would provide a total of 30 dB gain. This is a bare minimum, at the lower end of your "50-100 km" range, and assuming no obstructions. You mention "foliage and other obstacles", which will take additional power or gain to overcome, though realistically by the time you have the necessary 50 meter towers on each end as described above, foliage and obstacles may be much less of a concern.
All kinds of parabolic reflector antennas would be able to provide the necessary gain. A well-built Yagi could work as well.