logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache VHost server front end with local servers on back
Author
DomDis



Joined: 21 Apr 2023
Posts: 14
Location: USA

PostPosted: Tue 24 Dec '24 21:10    Post subject: Apache VHost server front end with local servers on back Reply with quote

So I have an apache server that serves up some simple pages and I have a server dedicated to Seafile (Cloud services like nextcloud). Sefile takes 443 and send it to the seahub server on 8000. I have a couple of servers that do SSl so If I fwd the port to the VHOST server then use VHost I should be able to distribute web access accordingly)

What do I need to add to my VHOST server to send 443 sf.mydomain.com and send say another 443 abc.mydomin.com to yet another vhost server on the backend (NATTED)

I tried

Code:
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName myseafile.mydomain.com
#DocumentRoot /var/www/html

 RewriteEngine On

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

 SSLProxyEngine on
 SSLProxyVerify none
 SSLProxyCheckPeerCN off
 SSLProxyCheckPeerName off
 SSLProxyCheckPeerExpire off
 SSLCertificateFile /etc/ssl/your-domain.com/zerossl_certificate.crt
 SSLCertificateKeyFile /etc/ssl/your-domain.com/private.key
 Include /etc/letsencrypt/options-ssl-apache.conf

Redirect “/” “https://192.168.0.100/” ###########THis kind of works but show the internal IP
##Kind of working #### Redirect permanent “/” “https://192.168.0.100/”
RedirectMatch ^/$ /myseafile
SSLProxyEngine on
ProxyPass / https://myseafile.mydomain.com/
ProxyPassReverse / https://192.168.0.100/

ProxyPass / https://192.168.0.100/
ProxyPassReverse / https://myseafile.mydomain.com


This kind of works but it shows the internal IPs and I’m pretty sure if I wasn’t sitting on the NAT i would not be able to access the server

any help would be appreciated
Back to top
DomDis



Joined: 21 Apr 2023
Posts: 14
Location: USA

PostPosted: Wed 25 Dec '24 0:14    Post subject: OK I think I reversed it Reply with quote

This seemed to work

Code:
<IfModule mod_ssl.c>
  <VirtualHost *:443>
     ServerAdmin webmaster@localhost
     ServerName myserver1.mydomain.com
     #DocumentRoot /var/www/html

     RewriteEngine On

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

     SSLProxyEngine on
     SSLProxyVerify none
     SSLProxyCheckPeerCN off
     SSLProxyCheckPeerName off
     SSLProxyCheckPeerExpire off
     SSLCertificateFile /etc/ssl/your-domain.com/zerossl_certificate.crt
     SSLCertificateKeyFile /etc/ssl/your-domain.com/private.key

     Include /etc/letsencrypt/options-ssl-apache.conf


   ProxyPass / https://192.168.1.100/
   ProxyPassReverse / httsp://192.168.1.100/
   ProxyPassReverse / https://myserver1.mydomain.com/


  </VirtualHost>
</IfModule>
Back to top


Reply to topic   Topic: Apache VHost server front end with local servers on back View previous topic :: View next topic
Post new topic   Forum Index -> Apache