New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Assign /admin to port

Got problems with your B2 or B3? Share and get helped!
Post Reply
Gunnarsson
Posts: 31
Joined: 26 Mar 2009, 07:15

Assign /admin to port

Post by Gunnarsson »

Hi


I'm running my bubba the other way around, with the LAN-side to internet. Don't ask why.. long story :)
But I want to open up port 80 to the internet to be able to use the web-server and so on.
Of course i don't want to give access to such services as the /admin page and /music and so on to the internet.
My question:
How do I change the /admin link to a port like localhost:8081 so that I can access it inside my LAN but block the port in my router?

:D
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Assign /admin to port

Post by Gordon »

The obvious solution is to change the listen port in the bubba-vhost definition, but why not do it the other way 'round? If you create a new vhost you can make that listen to an alternative port and have your router forward the regular port 80 to that alternative port (unless your router runs anything that is built by Microsoft, I'm fairly certain it can do that).
Gunnarsson
Posts: 31
Joined: 26 Mar 2009, 07:15

Re: Assign /admin to port

Post by Gunnarsson »

I've tried that but whit no luck.

I added the listen port 8081 in /etc/apache2/ports.conf
and then I just copied the *:80 section in the /etc/apache2/sites-enabled/bubba and renamed it to 8081.
But when i tried to access localhost:8081 I got no response. Im thinking maybe the iptables are blocking port 8081?!

No problem with the router, that was my plan all along :)
nobody
Posts: 226
Joined: 10 Mar 2012, 14:46

Re: Assign /admin to port

Post by nobody »

First I would check with "apachectl -St" if your setup of port 8081 is actually working.
Gunnarsson
Posts: 31
Joined: 26 Mar 2009, 07:15

Re: Assign /admin to port

Post by Gunnarsson »

nobody wrote:First I would check with "apachectl -St" if your setup of port 8081 is actually working.
apachectl: command not found
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Assign /admin to port

Post by Gordon »

Gunnarsson wrote:
nobody wrote:First I would check with "apachectl -St" if your setup of port 8081 is actually working.
apachectl: command not found
Did you `su` to become root?

Also, I'm not sure how to read the localhost:8081 bit. Are you using something like wget to verify that the server returns a page, or is this the actual URL that you try to reach running your browser? Note that localhost is not an alias for the B3, but refers to the machine your currently working on (in fact it is *my* machine that I'm using this moment to type this message).

Did you restart apache after making the changes to the config file?
Gunnarsson
Posts: 31
Joined: 26 Mar 2009, 07:15

Re: Assign /admin to port

Post by Gunnarsson »

Did you `su` to become root?
Yes.
Also, I'm not sure how to read the localhost:8081 bit. Are you using something like wget to verify that the server returns a page, or is this the actual URL that you try to reach running your browser? Note that localhost is not an alias for the B3, but refers to the machine your currently working on (in fact it is *my* machine that I'm using this moment to type this message).
Sorry for the bad choice of words. I meen the bubba-ip.
So when i type http://bubba-ip:8081/admin i want access to it but when i just type http://bubbaip (port 80 that i want to be able to access from internet) I just want to get access to /home/web/ folder.
Did you restart apache after making the changes to the config file?
Yes.
nobody
Posts: 226
Joined: 10 Mar 2012, 14:46

Re: Assign /admin to port

Post by nobody »

so it's apache2ctl instead of apachectl. This is different on each linux edition. Next time try to figure this out yourself instead of merely complaining the command yields nothing.

also, download and run nmap to see if anything is listening on 8081.

Code: Select all

apt-get install nmap
nmap -p 80,8081 you.external.ip
Post Reply