Click to See Complete Forum and Search --> : Apache Running on 2 different Ports


Swann
08-12-2001, 11:59 PM
How do I set Apache up so that it will run on Port 80 and on port 3000. I need port 80 for inside my network, and then port 3000 for outside traffic. So I need the same content on both ports. Thanks ahead of time.


BTW, I'm running Mandrake 8.0. THanks

freebsd
08-13-2001, 01:17 AM
You don't need to do that for such purpose. Just set up appropriate vhosts, some with internal servername (can be looked up via /etc/hosts) and some use real FQDN (via DNS).
Within <VirtualHost>, you can set the ServerName to be www.realdomain.com (http://www.realdomain.com) and set the ServerAlias to be internal.realdomain.com.

Swann
08-13-2001, 09:22 AM
I have a linksys router that all I wanna do is do port fowarding to port 3000 to the linux machine. And for the internal network, keep it at port 80. Is there any way just to broadcast both ports? Thanks again

Arvoreen
08-20-2001, 10:47 AM
Can you run the webserver on port 80, then forward port 3000 from the router to port 80 on the inside? I use ipmasqadm for portforwarding on my linux router/firewall thingy, and it works slick for stuff like that.

The Whizzard
08-23-2001, 05:24 AM
You should do like Avoreen says. But if you insist:
Listen 127.0.0.1:80
Listen 192.168.0.1:80
Listen 24.216.120.254:8080

And
NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>

ServerName www.thewhizzardslair.net (http://www.thewhizzardslair.net)
ServerAlias thewhizzardslair.net

# primary content

DocumentRoot /home/e-smith/files/primary/html
ScriptAlias /cgi-bin /home/e-smith/files/primary/cgi-bin
Alias /files /home/e-smith/files/primary/files
Alias /common /etc/e-smith/web/common

# alias for Apache icons

Alias /icons/ /var/www/icons/

</VirtualHost>
NameVirtualHost 192.168.0.1:80

<VirtualHost 192.168.0.1:80>

ServerName www.thewhizzardslair.net (http://www.thewhizzardslair.net)
ServerAlias thewhizzardslair.net

# primary content

DocumentRoot /home/e-smith/files/primary/html
ScriptAlias /cgi-bin /home/e-smith/files/primary/cgi-bin
Alias /files /home/e-smith/files/primary/files
Alias /common /etc/e-smith/web/common

# alias for Apache icons

Alias /icons/ /var/www/icons/

</VirtualHost>
NameVirtualHost 24.216.120.254:8080

<VirtualHost 24.216.120.254:8080>

ServerName www.thewhizzardslair.net (http://www.thewhizzardslair.net)
ServerAlias thewhizzardslair.net

# primary content

DocumentRoot /home/e-smith/files/primary/html
ScriptAlias /cgi-bin /home/e-smith/files/primary/cgi-bin
Alias /files /home/e-smith/files/primary/files
Alias /common /etc/e-smith/web/common

# alias for Apache icons

Alias /icons/ /var/www/icons/

</VirtualHost>


Yea, snips from my own httpd.conf. e-smith set up the virtual hosts and I changed the port for the outside link. Works great.

[ 23 August 2001: Message edited by: The Whizzard ]