Page 1 of 1

Redirect port to a particular folder

Posted: Mon May 15, 2017 3:56 pm
by lpcs007
Hello friends,

I have a client that needs to open port 85 and access the files of a certain folder. I added the port on the server firewall, but it did not work. How do I open port 85 and redirect to a particular folder?

Thank you.

Re: Redirect port to a particular folder

Posted: Mon May 15, 2017 7:37 pm
by Trentor
You have to create a virtualhost.

Apache:

Code: Select all

/home/admin/conf/web/httpd.conf

<VirtualHost your.ip:85>

	Your config

</VirtualHost>
You can copy and modify accordingly the config of other existing virtualhost. If you want to use https, add your virtualhost to shttp.conf.

nginx:

Code: Select all

/home/admin/conf/web/nginx.conf

server {
    listen      your.ip:85;
    
    	Your config

}
Same as before, copy another virtualhost and modify it according to your needs. snginx.conf if you want https.

Re: Redirect port to a particular folder

Posted: Wed May 17, 2017 3:29 am
by lpcs007
Trentor wrote:You have to create a virtualhost.

Apache:

Code: Select all

/home/admin/conf/web/httpd.conf

<VirtualHost your.ip:85>

	Your config

</VirtualHost>
You can copy and modify accordingly the config of other existing virtualhost. If you want to use https, add your virtualhost to shttp.conf.

nginx:

Code: Select all

/home/admin/conf/web/nginx.conf

server {
    listen      your.ip:85;
    
    	Your config

}
Same as before, copy another virtualhost and modify it according to your needs. snginx.conf if you want https.

Thank you for your help. Unfortunately I could not. I duplicated the virtualhost by changing the port to 85, but it did not work. It looks like the port is closed on the server. How do I check? Note: I already inserted port 85 into the firewall.

Re: Redirect port to a particular folder

Posted: Wed May 17, 2017 6:49 am
by skurudo
lpcs007, check via telnet from ssh console -> telnet -> open whatever

Re: Redirect port to a particular folder

Posted: Wed May 17, 2017 9:36 pm
by Trentor
lpcs007 wrote:Thank you for your help. Unfortunately I could not. I duplicated the virtualhost by changing the port to 85, but it did not work. It looks like the port is closed on the server. How do I check? Note: I already inserted port 85 into the firewall.
You can do what you've been told by Skurudo or use one of the multiples online sites to check open ports.

Or use nmap from another server.