Jump to content

I have an apache server that my gateway points to for port 80

 

I have 2 virtualhosts on that machine

 

if you go to my public ip http://67.180.162.118 you get a different site than if you go to my website http://98seaturtles.net

 

I need to setup a third virtualhost of media.98seaturtles.net to go to my emby media server

 

emby is on a different computer than apache2 so I need to setup a reverse proxy.

 

I dont know how to read this documentation can someone please help https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

 

basially I need help setting up a virtual host that uses reverse proxy to send traffic on port 80 on media.98seaturtles.net to another server behind my gateway

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to comment
https://linustechtips.com/topic/730695-apache2-virtual-host-reverse-proxy/
Share on other sites

Link to post
Share on other sites

3 minutes ago, leadeater said:

@MG2R

You able to help out? I would but I deleted my apache config files and I'm being lazy :P. Plus I don't use apache often enough.

are you asking me to help you with your server or are you saying you can help me with mine ?

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

5 minutes ago, cTurtle98 said:

are you asking me to help you with your server or are you saying you can help me with mine ?

I'm tagging someone I know can help you :).

 

There are a few others I'm sure can help who will likely see this soon also, like:

@tt2468

@Electronics Wizardy

@KuJoe

Link to post
Share on other sites

1 minute ago, leadeater said:

I'm tagging someone I know can help you :)

ohhhhh thats what the orange box thing is. thank you

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

This should work (I used nginx and squid for my reverse proxies, never used Apache before so this is based off the documentation I've found):

<VirtualHost *:*>
    ProxyPreserveHost On
    ProxyPass / http://<IP_ADDRESS>/
    ProxyPassReverse / http://<IP_ADDRESS>/
    ServerName media.98seaturtles.net
</VirtualHost>

Thanks for the tag @leadeater

-KuJoe

Link to post
Share on other sites

3 minutes ago, KuJoe said:

This should work (I used nginx and squid for my reverse proxies, never used Apache before so this is based off the documentation I've found):


<VirtualHost *:*>
    ProxyPreserveHost On
    ProxyPass / http://<IP_ADDRESS>/
    ProxyPassReverse / http://<IP_ADDRESS>/
    ServerName media.98seaturtles.net
</VirtualHost>

Thanks for the tag @leadeater

how do I modify that so that the subdomain for the proxy input is media.98seaturtles.net and so the output server (place to get web server from) (not another apache) is 10.0.8.94 ?

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

1 minute ago, cTurtle98 said:

how do I modify that so that the subdomain for the proxy input is media.98seaturtles.net and so the output server (place to get web server from) (not another apache) is 10.0.8.94 ?

Replace <IP_ADDRESS> with 10.0.8.94.

-KuJoe

Link to post
Share on other sites

1 minute ago, KuJoe said:

Replace <IP_ADDRESS> with 10.0.8.94.

awesome

 

THANK YOU

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

3 minutes ago, cTurtle98 said:

how do I modify that so that the subdomain for the proxy input is media.98seaturtles.net and so the output server (place to get web server from) (not another apache) is 10.0.8.94 ?

from what I read in the apache documenation I should have 

ProxyPreserveHost On

only if its going to another apache2 server but is going to emby witch makes its own webpage without apache

 

what should I do?

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

5 minutes ago, cTurtle98 said:

from what I read in the apache documenation I should have 


ProxyPreserveHost On

only if its going to another apache2 server but is going to emby witch makes its own webpage without apache

 

what should I do?

It looks like that just preserves the header information so it should be valid for any webserver. You can leave it enabled and if something doesn't look right just disable it. Server admin work is a lot of trial and error. :)

-KuJoe

Link to post
Share on other sites

2 minutes ago, KuJoe said:

It looks like that just preserves the header information so it should be valid for any webserver. You can leave it enabled and if something doesn't look right just disable it. Server admin work is a lot of trial and error. :)

can you try going to media.98seaturtles.net ?

im just getting the default apache page

 

should I set the web server on my media server to be on a different port ?

how would I set that up so port 80 traffic on media.* goes to port 8080 traffic on the other computer

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

7 minutes ago, cTurtle98 said:

can you try going to media.98seaturtles.net ?

im just getting the default apache page

 

should I set the web server on my media server to be on a different port ?

how would I set that up so port 80 traffic on media.* goes to port 8080 traffic on the other computer

Did you reload the config or restart the service after making the change?

 

As for changing the port, you'd need to set the other server to listen on port 8080 and then the config you would change it to this:

 

<VirtualHost *:*>
    ProxyPreserveHost On
    ProxyPass / http://10.0.8.94:8080/
    ProxyPassReverse / http://10.0.8.94:8080/
    ServerName media.98seaturtles.net
</VirtualHost>

 

-KuJoe

Link to post
Share on other sites

4 minutes ago, KuJoe said:

Did you reload the config or restart the service after making the change?

 

As for changing the port, you'd need to set the other server to listen on port 8080 and then the config you would change it to this:

 


<VirtualHost *:*>
    ProxyPreserveHost On
    ProxyPass / http://10.0.8.94:8080/
    ProxyPassReverse / http://10.0.8.94:8080/
    ServerName media.98seaturtles.net
</VirtualHost>

 

i have been restarting the service

 

still getting default apache page

 

could it be an error in my dns record for media.98seaturtles.net?

 

i just set an "A" record to my public ip

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

1 minute ago, cTurtle98 said:

i have been restarting the service

 

still getting default apache page

 

could it be an error in my dns record for media.98seaturtles.net?

 

i just set an "A" record to my public ip

That should work. Can you post your whole config file?

-KuJoe

Link to post
Share on other sites

3 minutes ago, KuJoe said:

That should work. Can you post your whole config file?

ciaran@98SeaTurtles-91:~$ cat /etc/apache2/sites-available/media-server.conf
<VirtualHost *:*>
    ProxyPreserveHost Off
    ProxyPass "/" "http://10.0.8.94:8080/"
    ProxyPassReverse "/" "http://10.0.8.94:8080/"
    ServerName media.98seaturtles.net
</VirtualHost>
ciaran@98SeaTurtles-91:~$ 

 

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

2 minutes ago, cTurtle98 said:

ciaran@98SeaTurtles-91:~$ cat /etc/apache2/sites-available/media-server.conf
<VirtualHost *:*>
    ProxyPreserveHost Off
    ProxyPass "/" "http://10.0.8.94:8080/"
    ProxyPassReverse "/" "http://10.0.8.94:8080/"
    ServerName media.98seaturtles.net
</VirtualHost>
ciaran@98SeaTurtles-91:~$ 

 

it seems that I broke my media server trying to change the internal port, if I go to the link in that config file inside my network it doesent work so I need to get that fixed

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

1 minute ago, KuJoe said:

@cTurtle98 did you symlink your media-server.conf file to the /sites-enabled/ directory?

 

I would keep the media server port the same and focus on getting Apache working correctly.

i ran

sudo a2ensite media-server

 

cTurtle98 - Desktop

Spoiler

CPU: i7 7700k

COOLER: Thermaltake - Water 3.0 Extreme S
MOBO: Asrock z270 killer sli/ac

RAM: G.Skill Trident Z 32 GB (4 x 8 GB) DDR4-3200

SSD 1: Intel - 600p Series 1TB M.2-2280 (Windows)

SSD 2: Samsung 970 Evo 1 TB M.2-2280 NVME (POP_OS)

GPU: MSI - GTX 1070

PSU: EVGA - SuperNOVA G2 550W 80+ Gold Fully-Modular

CASE: Thermaltake - Versa H26

cTurtle98 - Portable PC

Spoiler

CPU: R5 1600

COOLER: NH-L9a-AM4

MOBO: ASRock - AB350 Gaming-ITX/ac

RAM: 16GB (2 x 8GB) Corsair - Vengeance LPX DDR4-3200

SSD 1: Intel - 600p Series 512 GB M.2-2280 (Windows)

SSD 2: 860 Evo 1 TB 2.5" (Manjaro)

SSD 3: PNY - CS1311 120 GB 2.5" (POP_OS)

GPU: Gigabyte GeForce GTX 1650 4 GB MINI ITX OC

PSU: HDPLEX 400 AC-DC DC-ATX Combo

CASE: NFC Skyreach 4 mini

 

Link to post
Share on other sites

@leadeater

Yay my life is complete!

 

I don't usually work with Apache, but it looks like you need ruby on rails installed (if it is not installed already)

 

Here is a config I found off the internet. It doesn't use ProxyPreserveHost.

<VirtualHost *:80>
    DocumentRoot "/var/www/html"
    ServerName subdomain.mydomain.com
    ProxyPass / http://localhost:3001/
    ProxyPassReverse / http://localhost:3001
</VirtualHost>

 

My native language is C++

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×