Help -changing port configuration for apache

551 views
Skip to first unread message

AJ

unread,
Sep 15, 2012, 3:29:41 PM9/15/12
to milwau...@googlegroups.com
Hi everyone,

Ok, I'm wondering if you guys might have a clue where I might be going wrong.

I'm trying to set up my apache server for ZoneMinder to be accessible outside my local network.  It works on port 80 internally but not externally.  But  I'm trying to change everything from the default port 80 to 81 because I already have a server on port 80.  Dale was helping me with this but I think I'm missing something.
 
I changed my router to port 81 for the IP address where zoneminder resides. 


I changed:

/etc/apache2/sites-enabled/000-default
to reflect:   <Virtual Host *.81>

I changed:

/etc/apache2/ports.conf
to reflect:   Name VirtualHost *.81
                 Listen 81


Now these are some additional instructions I found online:

Linking Apache to the Zoneminder Script

Finally the a link needs to be established to call the ZM script over Apache:

sudo ln -s /etc/zm/apache.conf /etc/apache2/sites-enabled/001-zoneminder

This makes zoneminder available under http://[server]/zm.

----

Create a new virtual host config in /etc/apache2/sites-available.
E.g.
- copy the existing "default" to "default-81"
- modify the port of the virtual host as needed: <VirtualHost *:81>
- change the document root to be the zm script location: DocumentRoot /usr/share/zoneminder

Enable the new virtual host by setting a link from the /etc/apache2/sites-enabled directory to the just created file:
sudo ln -s ../sites-available/default-81 002-default-81

Reload apache:
sudo /etc/init.d/apache2 reload

Now ZM is available under http://[server]:81
----


I'm confused what this is telling me.  I have to add a new line to that file??
I don't know if missing these steps is all that's needed to make my zoneminder appear again. 
Right now it won't show up at all internally or externally. 

Is anything blatantly obvious to you guys?

Thanks,
Ally




-- 

<>

Paul Schmidt

unread,
Sep 15, 2012, 3:51:25 PM9/15/12
to milwau...@googlegroups.com
You most likely need to open that port to outside connections. This is
usually done in the configuration of the modem/router (gateway) that
connects you to the internet. How you do this depends on what provider
you have, and what hardware they have provided you.

On 09/15/2012 02:29 PM, AJ wrote:
> Hi everyone,
>
> Ok, I'm wondering if you guys might have a clue where I might be going
> wrong.
>
> I'm trying to set up my apache server for ZoneMinder to be accessible
> outside my local network. It works on port 80 internally but not
> externally. But I'm trying to change everything from the default
> port 80 to 81 because I already have a server on port 80. Dale was
> helping me with this but I think I'm missing something.
> I changed my router to port 81 for the IP address where zoneminder
> resides.
>
> *I changed:*
> /etc/apache2/sites-enabled/000-default
> to reflect: <Virtual Host *.81>
> *
> **I changed:*
> /etc/apache2/ports.conf
> to reflect: Name VirtualHost *.81
> Listen 81
>
>
> Now these are some additional instructions I found online:
>
> *Linking Apache to the Zoneminder Script*
>
> Finally the a link needs to be established to call the ZM script over
> Apache:
>
> sudo ln -s /etc/zm/apache.conf /etc/apache2/sites-enabled/001-zoneminder
>
> This makes zoneminder available under http://[server]/zm.
>
> ----
>
> *Create a new virtual host config* in /etc/apache2/sites-available.

Tom

unread,
Sep 15, 2012, 4:27:51 PM9/15/12
to milwau...@googlegroups.com
IPTables has the port blocked?


446 . [Humor] I just got skylights put in my place. The people who live above me are furious. --Steven Wright
NEW: a50m...@gmail.com • N9QQB (amateur radio)
"HEY YOU" (loud shouting) • Second Tops (Set Dancing) • FIND ME ON FACEBOOK
43° 7' 17.2" N by 88° 6' 28.9" W • Elevation 815' • Grid Square EN53wc
LAN/Telecom Analyst • Open-source Dude • Musician • Registered Linux User 385531

AJ

unread,
Sep 15, 2012, 4:29:39 PM9/15/12
to milwau...@googlegroups.com
I assigned port 81 to my zoneminder IP address in Port Forwarding in my Router. 
Isn't that what opens up the port?  or am I mistaken?

Chris Burger

unread,
Sep 15, 2012, 4:37:28 PM9/15/12
to milwau...@googlegroups.com
Depending on the router you may or may not be able to access it using your outside IP.  Try it from outside your network (3G/4G on phone, or through a proxy like HMA) and see if it comes up, assuming it also works on your local network on port 81.


-=Chris Burger=-
<phob...@gmail.com>

Tom

unread,
Sep 15, 2012, 4:44:24 PM9/15/12
to milwau...@googlegroups.com
There's three (at least- probably more) issues here.
1. Is the zoneminder / Apache config correct??
    If you can see the appropriate page on port 81 on the same computer, it probably is.

2. Is IPTables or other local firewall open? This interacts with question 1, in that a "no" answer here could also cause failure to see the page on the same computer as zoneminder lives on. But it certainly will cause any machine on your local network, and farther away, to be unable to see the page.

3. Is your ISP router open to that port? Seems like it is, since you've done a port forward. Recheck it though. Make sure you're forwarding port 81 to the appropriate IP Address. Make sure the machine hosting Zoneminder has that address, on that interface.

Is there an example in the router's config for port 80 that you can copy?

-Tom


469 . [Commentary] War talk by men who have been in a war is always interesting, whereas moon talk by a poet who has not been in the moon is likely to be dull. --Twain

AJ

unread,
Sep 15, 2012, 4:53:35 PM9/15/12
to milwau...@googlegroups.com
No, I could never even pull up zoneminder using port 81 internally.
So I'm wondering if maybe those extra instructions that I pasted on the first email where something I needed to do.  I just had a hard interpreting exactly what it was I was supposed to do with those instructions.

So I guess it's not configured right.  Zoneminder only seems to want to work internally on port 80.  but I never could access it externally ever. 

I don't know that I even have a firewall.

Paul Schmidt

unread,
Sep 15, 2012, 4:58:55 PM9/15/12
to milwau...@googlegroups.com
You may need to make the Zoneminder PC accessible from the outside. On
my U-verse router, it is called the DMZ zone. You then would access it
using the IP address assigned to you by your internet provider.

AJ

unread,
Sep 15, 2012, 5:07:26 PM9/15/12
to milwau...@googlegroups.com
ok, my router has my other server (on port 80) as the default DMZ server.
But there's only space to put one IP address in for the "default DMZ
server".

Tom

unread,
Sep 15, 2012, 5:11:23 PM9/15/12
to milwau...@googlegroups.com
Your router may not be smart enough to cope with multiple servers in the DMZ. Many consumer grade ones are not.

But you have to be able to view the web page on port 81 internally before worrying about your router.


805 . [Optimism] When you have seven percent unemployed, you have ninety-three percent working. --John F. Kennedy

AJ

unread,
Sep 15, 2012, 5:27:12 PM9/15/12
to milwau...@googlegroups.com
ok.  makes sense.

So if I can see it ok internally on port 80, is there a way to have two servers running on port 80? and have them accessible from the outside?  maybe with a better router? 
I guess I just don't have the know how yet to successfully change it to work on port 81 internally even. 

Chris C

unread,
Sep 15, 2012, 5:31:31 PM9/15/12
to milwau...@googlegroups.com
from what i know, you can usually set up something like this

external_IP:80 -> router (maps port 80 to a specific server, say 1.2.3.4:80) -> 1.2.3.4:80

external_IP:81 -> router (maps port 81 to a specific server, say 1.2.3.6:80) -> 1.2.3.6:80

something like that...so you can have multiple servers running apache on port 80 (on the internal network), and then have them all be accessable via the external network by different IP's

if your looking for a new router that can do this, try to find one that works w/ DDWRT or OpenWRT, or the like (theres several).....orrrr you could try pfSense (which is a firewall that can also act as a router, but you need a computer to run it on)

Paul Schmidt

unread,
Sep 15, 2012, 5:45:02 PM9/15/12
to milwau...@googlegroups.com
A Zoneminder wiki that I looked at says that you can change the port to
the alternate port of 1024. And you can do it using the Zoneminder
webconfig. Don't know how to access that, but that usually starts with
using 127.0.0.1 or localhost as the web address.
>> /805 . [Optimism] When you have seven percent unemployed, you have
>> ninety-three percent working. --John F. Kennedy/
>> NEW: a50m...@gmail.com � N9QQB (amateur radio)
>> "HEY YOU" (loud shouting) � Second Tops (Set Dancing) � FIND ME ON
>> FACEBOOK
>> 43� 7' 17.2" N by 88� 6' 28.9" W � Elevation 815' � Grid Square EN53wc
>> LAN/Telecom Analyst � Open-source Dude � Musician � Registered Linux
>> User 385531
>>
>

AJ

unread,
Sep 15, 2012, 5:46:10 PM9/15/12
to milwau...@googlegroups.com
I thought I was trying to do that by setting the internal port to 80 and external port to 81 on this screen for my router. (see attached photo).
Is that what you mean? 
portforwarding.jpeg

AJ

unread,
Sep 15, 2012, 5:48:59 PM9/15/12
to milwau...@googlegroups.com
ok, thanks. I'll see if that port works.

Chris C

unread,
Sep 15, 2012, 5:51:24 PM9/15/12
to milwau...@googlegroups.com
that screen shot is putting port 81 -> port 81... looks like you have to uncheck the box 'use the same port....' and then change that port to 80

AJ

unread,
Sep 15, 2012, 5:54:41 PM9/15/12
to milwau...@googlegroups.com
yea I've been changing those numbers around.  but i had it where 81 was external and 80 was internal.  but it still didn't work.  but does this screen tell you anything about whether or not my router is capable of having 2 servers on port 80?

Chris C

unread,
Sep 15, 2012, 5:55:54 PM9/15/12
to milwau...@googlegroups.com
not really...unless theres an option to add multiple 'custom services'

AJ

unread,
Sep 15, 2012, 5:58:55 PM9/15/12
to milwau...@googlegroups.com
I've got 5 custom services running right now.
So maybe it can handle two devices on port 80?
Then perhaps it is just a zoneminder configuration problem yet.
ok, back to the drawing board.  lol  :)

Dale Noll

unread,
Sep 15, 2012, 9:01:59 PM9/15/12
to milwau...@googlegroups.com
There may be another possible solution if you cannot get this to work on port 81.

Consider this.  Put everything back the way it was,  so you can access zoneminder on port 80 from your local network.
On the existing server, you can configure apache as a proxy.  This way, the request still goes to the original server, but then it proxies that request to the ZM server.

If you want to try that road, I can look up some information on what I am doing at work with that.

AJ

unread,
Sep 15, 2012, 9:06:33 PM9/15/12
to milwau...@googlegroups.com
I'll try anything if there's even a remote possibility it works!� I'm baffled on this one.

Thanks for checking.� :)



<>
On 09/15/2012 08:01 PM, Dale Noll wrote:
There may be another possible solution if you cannot get this to work on port 81.

Consider this. �Put everything back the way it was, �so you can access zoneminder on port 80 from your local network.
On the existing server, you can configure apache as a proxy. �This way, the request still goes to the original server, but then it proxies that request to the ZM server.

If you want to try that road, I can look up some information on what I am doing at work with that.

On Sat, Sep 15, 2012 at 4:58 PM, AJ <bike...@gmail.com> wrote:
I've got 5 custom services running right now.
So maybe it can handle two devices on port 80?
Then perhaps it is just a zoneminder configuration problem yet.
ok, back to the drawing board.� lol� :)


<>
On 09/15/2012 04:55 PM, Chris C wrote:
not really...unless theres an option to add multiple 'custom services'

On Sat, Sep 15, 2012 at 4:54 PM, AJ <bike...@gmail.com> wrote:
yea I've been changing those numbers around.� but i had it where 81 was external and 80 was internal.� but it still didn't work.� but does this screen tell you anything about whether or not my router is capable of having 2 servers on port 80?

<>
On 09/15/2012 04:51 PM, Chris C wrote:
that screen shot is putting port 81 -> port 81... looks like you have to uncheck the box 'use the same port....' and then change that port to 80

On Sat, Sep 15, 2012 at 4:46 PM, AJ <bike...@gmail.com> wrote:
I thought I was trying to do that by setting the internal port to 80 and external port to 81 on this screen for my router. (see attached photo).
Is that what you mean?�


<>
On 09/15/2012 04:31 PM, Chris C wrote:
from what i know, you can usually set up something like this

external_IP:80 -> router (maps port 80 to a specific server, say 1.2.3.4:80) -> 1.2.3.4:80

external_IP:81 -> router (maps port 81 to a specific server, say 1.2.3.6:80) -> 1.2.3.6:80

something like that...so you can have multiple servers running apache on port 80 (on the internal network), and then have them all be accessable via the external network by different IP's

if your looking for a new router that can do this, try to find one that works w/ DDWRT or OpenWRT, or the like (theres several).....orrrr you could try pfSense (which is a firewall that can also act as a router, but you need a computer to run it on)
On Sat, Sep 15, 2012 at 4:27 PM, AJ <bike...@gmail.com> wrote:
ok.� makes sense.

So if I can see it ok internally on port 80, is there a way to have two servers running on port 80? and have them accessible from the outside?� maybe with a better router?�
I guess I just don't have the know how yet to successfully change it to work on port 81 internally even.�


<>
On 09/15/2012 04:11 PM, Tom wrote:
Your router may not be smart enough to cope with multiple servers in the DMZ. Many consumer grade ones are not.

But you have to be able to view the web page on port 81 internally before worrying about your router.

At 04:07 PM 9/15/2012, you wrote:
ok, my router has my other server (on port 80) as the default DMZ server.
But there's only space to put one IP address in for the "default DMZ server".




<>

On 09/15/2012 03:58 PM, Paul Schmidt wrote:
You may need to make the Zoneminder PC accessible from the outside. On my U-verse router, it is called the DMZ zone. You then would access it using the IP address assigned to you by your internet provider.

On 09/15/2012 03:53 PM, AJ wrote:
No, I could never even pull up zoneminder using port 81 internally.
So I'm wondering if maybe those extra instructions that I pasted on the first email where something I needed to do.� I just had a hard interpreting exactly what it was I was supposed to do with those instructions.

So I guess it's not configured right.� Zoneminder only seems to want to work internally on port 80.� but I never could access it externally ever.


I don't know that I even have a firewall.
<>


805 . [Optimism] When you have seven percent unemployed, you have ninety-three percent working. --John F. Kennedy

NEW: a50m...@gmail.com � N9QQB (amateur radio)


"HEY YOU" (loud shouting) � Second Tops (Set Dancing) � FIND ME ON FACEBOOK

43� 7' 17.2" N by 88� 6' 28.9" W � Elevation 815' � Grid Square EN53wc

Reply all
Reply to author
Forward
0 new messages