Disable SSL for Single Directory on Apache Virtual Host (SOLVED)

I’m not exactly sure what more I can say. I used the letsencrypt binary from the Ubuntu 16 reprository to convert my dozen or so virtual servers from HTTP to HTTPS. It worked great. However, I now want resources in a single directory of one virtual server to be accessible to a service on a different server.

I have posted the two configs for my virtual server. I could post more apache configs, but which? There are dozens and I have no idea which ones were edited by /bin/letsencrypt. As far as testing goes, I’m not even checking with my browser, I’m checking with the service that needs access. I’ve reloaded apache, restarted apache, restarted my machine after every change.

Last night I disabled everything in *:443 and declared my DocumentRoot in *:80. My site is no longer encrypted (booooo), but the service in question can now access the resources.

Thanks to everyone for their help and patience. I’ll gladly take more advice.

Aha! I hadn't noticed that this was missing before. You need a DocumentRoot on port 80 to serve content from there, even if you also have one on port 443. Maybe try adding that into one of the examples? Such as:

<VirtualHost *:80>
  ServerName adventuresoftron.com
  ServerAlias www.adventuresoftron.com
  DocumentRoot /var/www/html/aot
  RedirectMatch 301 ^/((?!aa/resource).*)$ https://adventuresoftron.com/$1
</VirtualHost>

and re-enable the *:443 config of course.

1 Like

IT WORKS!

Thanks for your help jmorahan. Your explanations have helped me understand Apache a little better and I hope I can help someone else with this new understanding. PM me your PayPal address and I’ll buy you a 6-pack of your favorite beverage. :relieved:

Glad you got it sorted!

If you feel like donating, please donate to ISRG to help keep this awesome service running :slight_smile:

1 Like

Great idea, I just left a donation. :heavy_dollar_sign:

1 Like

In case a n00b like me is reading this and wants to learn more about Apache, Digital Ocean just released a good introduction to some of the ideas in this thread.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.