Linux desktop or server portforwarding

Forum for questions and support relating to the 1.24.x releases only.
Locked
uttbigal
Posts: 6
Joined: Wed Jul 13, 2011 5:26 pm

Linux desktop or server portforwarding

Post by uttbigal »

Thank You ahead of time for anyone who replies to this, or even looks at this!

I have search through your forums and I found a few topics on port forwarding but none that address this issue or maybe I'm too stupid and I just don't understand. I am new to Linux, Zoneminder, networking, etc...

I am running:
Ubuntu 10.10 Desktop
Zoneminder 1.24.2

I have a Motorola SBG900 modem/router and the Ubuntu desktop ip is 192.168.0.7

I am trying to access my zoneminder from a Windows 7 laptop using firefox from a remote location (work).

This is my port forwarding setting for the Motorola SBG900 I have 2:
1)
Name: HTTPzm
Port Start: 80
Port End: 80
LAN IP Address: 192.168.0.7
Enable: Yes
2)
Name: zm test
Port Start: 2727
Port End: 2727
LAN IP Address: 192.168.0.7
Enable: Yes


From my Windows laptop I have tried the following entries into firefox to try and get to zoneminder.

<my-ip-address>/zm/
<my-ip-address>:80/zm/
<my-ip-address>:2727/zm/
<my-ip-address>:80/192.168.0.7/zm/
<my-ip-address>:2727/192.168.0.7/zm/

I have tried dyndns and I couldn't get it to work, and I don't want to have to pay.

I do not have any users or passwords on my zoneminder.

What am I doing wrong?
Do I need to have Ubuntu Server to make this work?
Do I need to change zoneminder's port from 80 to something else?
Could I be my Modem/Router?

I new to this and I know I am a total noob. Please Help
kross
Posts: 12
Joined: Wed Jun 01, 2011 8:12 pm

Re: Linux desktop or server portforwarding

Post by kross »

Many ISP's will block incoming connections on port 80. Try running your Apache web server on a different port, like 8080, and then try forwarding port 8080 instead of 80.

Where does 2727 come from? Are you running your web server on port 2727 also?
alf
Posts: 41
Joined: Wed Jun 17, 2009 6:13 pm

Re: Linux desktop or server portforwarding

Post by alf »

I run dyndns and it works like a champ when you get it configured.

look around there is another script you need to configure after you get dyndns.


As far as I know you have to forward all routers and modems to a specific machine. Even if there is only one computer on it you have to check for that, my router still has machines I have not used for years in it by default. Took me forever to figure that out.

Also try accessing the index HTML.

As far as services go, I have ATT and it doesn't block port 80, if that helps.
uttbigal
Posts: 6
Joined: Wed Jul 13, 2011 5:26 pm

Re: Linux desktop or server portforwarding

Post by uttbigal »

thank you all for responding! How do you change your default port on apache? I was just forwarding port 2727 to 192.168.0.7 to see if I could get it to work.
uttbigal
Posts: 6
Joined: Wed Jul 13, 2011 5:26 pm

Re: Linux desktop or server portforwarding

Post by uttbigal »

i will try and find a tutorial somewhere for Dydns and post a link.
alf
Posts: 41
Joined: Wed Jun 17, 2009 6:13 pm

Re: Linux desktop or server portforwarding

Post by alf »

apache is default port 80


as to dyndns follow the directions for the ddns there and that sorta worked for me, it would update off and on. When I was puzzling that out I discovered one little script change that made it go.


I access my home ZM from my ####.dyndns-blog.com page and then link it from my index.html.


So I don't know exactly how to do it the way you are doing it. But at some point yous should see the apache "it works" page.


This all took me months to figure out.
uttbigal
Posts: 6
Joined: Wed Jul 13, 2011 5:26 pm

Re: Linux desktop or server portforwarding

Post by uttbigal »

Sorry if this post is long and repetitive.

this is what I did in the terminal:

I opened the ports.conf

Code: Select all

sudo gedit /etc/apache2/ports.conf
I changed "Listen 80" to "Listen 8080"

Code: Select all

sudo /etc/init.d/apache2 restart
when I tried to go to localhost:8080 in the broswer I got a 404 error "Not Found".

So I added the "Listen 80" back into port.conf and I was able to access localhost:80, but still unable to access localhost:8080

Then I tried to edit the virtual host to 8080 and when I tried to restart apache it failed.

So I changed it back to virtual host 80

Then I edited the httpd:conf file

Code: Select all

sudo gedit /etc/apache2/httpd.conf 
I added "Listen 8080" to the blank file, and when I tried to restart apache it failed.

I also tried editing a combination of the two files adding Listen 8080, and still nothing.
uttbigal
Posts: 6
Joined: Wed Jul 13, 2011 5:26 pm

Re: Linux desktop or server portforwarding

Post by uttbigal »

Also I looked at this youtube tutorial to try and help with the dyndns
watch?v=QmF0_UM-5wY
I do not have to ddns option on my router so I wasn't much help.

Thank you once again for helping.

I will keep you posted. I'm going to figure this out!
alf
Posts: 41
Joined: Wed Jun 17, 2009 6:13 pm

Re: Linux desktop or server portforwarding

Post by alf »

If you can access port 80 from the outside and get the "it works" page, try typing zm after that.

Something like

http://localhost/zm



or whatever it says.


You seem to have two problems, one making dyndns work and one making your computer available to to you outside the network. They both work together.

use this to test your port when you are on the zoneminder computer

http://www.dyndns.com/support/tools/openport.html

When that says open

There's two ways to enable dns, one on the router which is suggested to be the bad way, and the software way which is suggested to be the best way. Thats just what I've read.

I use the software method go here and log in

http://www.dyndns.com/support/tools/clientconfig.html

and do exactly what it says with the ddclient, this should update your computer with dyndns automatically, after I ironed those things out I had to modify one file which I learned from I believe here. It writes a handy little php program that you install.

https://help.ubuntu.com/community/DynamicDNS

I can log into my account and ssh using the info dyndns gives me.

You seem real close. It was driving me crazy for a few weeks.

I don't know if this is any help.

here's my dyndns page

suck.dyndns-blog.com
uttbigal
Posts: 6
Joined: Wed Jul 13, 2011 5:26 pm

Re: Linux desktop or server portforwarding

Post by uttbigal »

I FIGURED IT OUT!!!!!!!!

this is what I did:

After many google searches on apache2, apache2 port, apache2 port forwarding I learned that the VirualHost has something to do with port forwarding.

while messing with the ports.conf file forever I started to read the comments at the top of the file which said
that if you wanted to change the VirtualHost statement you need to change the 000-default file.
So this is how I got it to work:
In the terminal I typed:

Code: Select all

sudo gedit /etc/apache2/sites-enabled/000-default
when I got into the file I copied all that was in the VirtualHost brackets:

Code: Select all

<VirtualHost *:80>
...lines of code...
</VirualHost>
After the last line of code "</VirtualHost>" I pasted that entire block of code.

And I edited the <VirtualHost *:80> newly pasted block of code to this <VirtualHost *:8080>
So the entire 000-default file looked like this:

Code: Select all

<VirtualHost *:80>
...same lines of code...
</VirualHost>
<VirtualHost *:8080>
...same lines of code...
</VirualHost>
After this I got into the ports.conf

Code: Select all

sudo gedit /etc/apache2/ports.conf
I added the this like of code after "Listen 80":

Code: Select all

NameVirtualHost *:8080
Listen 8080
After that I restarted apache:

Code: Select all

sudo /etc/init.d/apache2 restart
Finally from my router I forwarded port 8080 to 192.168.0.7 which is the IP address of my Ubuntu machine that runs zoneminder.

I can now type in my browser from work this:
<my-ip-address>:8080/zm/
and the zoneminder console comes up!!!!!!

I hope this helps someone
Thank You to everyone who helped me!
Locked