harryalder
2018-11-14 19:04:47 UTC
Hi, First, I want to say that I am a Noob at all of this and have no experience with Linux, Apache, php, or WordPress. That being said, I have spent the last 7 to 10 days trying to learn something about them. My overall idea is to create a website in WordPress that will serve up the same content for four different domains in http and https. The domains are the .com, .net, .info, and .org versions of the same site. Example.org would be the main site. What I have done so far is build an Intel server with two NIC cards. One NIC for our local network with a private IP like 192.168.100.188 the second NIC is for the Public IP address for use in the DNS. I then set up each domains DNS to point to the single Public IP. Next, I installed and configured CentOS 7.5.1804, installed the LAMP stack including Apache 2.4.6 and php 2.4.0. Installed WordPress and created some content to test with. At this point everything is pretty much working as planned. Going to either of these sites in a browser currently brings up the desired content externally on the Public IP and internally on the local private address. Now the issue at hand is to get it to work with https. I decided to use Let’s Encrypt for my certificates. I installed the EPEL repository and then installed mod-ssl python-certbot-apache, restarted httpd, checked to see if the service was “active” and checked to make sure ports 80 and 443 were open on the firewall. I then used curl and curl -k to ensure that the example.org site was reachable. Both returned me back to the command prompt after a few seconds of execution with no errors. Next, I ran certbot –apache without any domains. I was prompted for the domains. Upon Entering the domains and continuing I got the message: “Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.” I know that I should create a virtual host for each domain but I’m not exactly sure how. I could probably create directories for each domain with a public_html subdirectory under each but it seems that would require duplicating the website code to each of the subdirectories. Can four domains share the same DocumentRoot directory? If someone could please give me an example of what my virtual host entries should look like for the domains example.com, example.net, example.org, example.info, I would greatly appreciate it. I probably only need to see how two of the virtual host entries look to determine what is duplicate and non-duplicate info. Also, how would I determine exactly where WordPress is storing the needed info for DocumentRoot? Thanks very much, ahead of time, for your help. Please be nice. Ten days ago I couldn’t even spell Linux, I’ve come this far, but I’m truly lost now.