Bitnami配置主域名及子域名访问失败排查求助
Hey there, let's break down your issues step by step since you're new to Bitnami and Apache—no worries, we'll get this sorted!
1. Fix the DNS_PROBE_FINISHED_NXDOMAIN Errors (example.com & app1.example.com)
First off, this error has nothing to do with your Apache configuration right now—it means your browser can't find the IP address linked to those two domains. Here's what to check:
- Double-check your A records: Log into your DNS provider's dashboard and confirm that both
example.comandapp1.example.comhave A records pointing to your server's public IP address (not the internal/private IP). It's easy to accidentally paste the wrong IP here! - Wait for DNS propagation: DNS changes can take anywhere from 15 minutes to 24 hours to fully roll out, depending on the TTL (Time to Live) setting of your records. Test the resolution directly from your terminal to see if it's working:
If these commands return your server's public IP, the DNS is starting to work. If not, give it more time or double-check your record setup.nslookup example.com dig app1.example.com - Clear local browser/DNS cache: Your browser might be holding onto old DNS data. Force-refresh the page with
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac), or flush your local DNS cache (steps vary by OS).
2. Confirm Apache Configuration & Permissions
Your updated bitnami.conf fixed the 403 error for app2, which means you got the directory permissions and virtual host structure right. Let's make sure the other domains are set up the same way:
- Restart Apache after config changes: Any edits to Apache config files require a restart to take effect. In Bitnami, use this command:
sudo /opt/bitnami/ctlscript.sh restart apache - Verify directory permissions: Even though app2 works, double-check that
default_websiteandapp1_websitehave the same ownership and permissions as app2. Bitnami's Apache runs as thedaemonuser, so run these commands:
Repeat the same commands forsudo chown -R daemon:daemon /opt/bitnami/apache2/htdocs/default_website sudo chmod -R 755 /opt/bitnami/apache2/htdocs/default_websiteapp1_website. - Check for conflicting config files: Bitnami often stores additional virtual host files in
/opt/bitnami/apache2/conf/vhosts/. Make sure none of these files are overriding the settings in yourbitnami.conf.
3. Test Locally on the Server (Rule Out Network Issues)
To confirm your Apache config is actually working for all domains, test directly from the server itself:
- Edit the server's
/etc/hostsfile to map the domains to localhost:127.0.0.1 example.com 127.0.0.1 app1.example.com 127.0.0.1 app2.example.com - Use
curlto fetch each site:
If you see the correctcurl http://example.com curl http://app1.example.com<h>tag content for each, your Apache config is perfect—all remaining issues are DNS-related.
Quick Summary
The fact that app2 works confirms your Apache virtual host and permission setup is valid. The main problem with example.com and app1.example.com is almost certainly DNS resolution (either incorrect records or propagation delays). Fix that, and you should have all three sites up and running!
内容的提问来源于stack exchange,提问作者Anirudh

