LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to port-forward a directory inside /var/www (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-port-forward-a-directory-inside-var-www-4175465196/)

pedenski 06-08-2013 01:36 AM

how to port-forward a directory inside /var/www
 
Hi, this is more a webserver question running in ubuntu.

i have 3 folders(websites) in /var/www, that i run for internal use.

- public
- private 1
- private 2

i was tasked to make 1 public folder to be accessed via internet.

i have managed to port forward my WAN IP to my internal web server successfully and i can browse these folder with no problems (internal/internet).

what are my alternatives to only restrict public folder to be accessed via public internet?

can i map an IP address to a specific directory?? so i could just port forward that directory? i really dont know, im just thinking based on my general knowledge.

thanks :)

bathory 06-08-2013 02:27 AM

Hi,

You can restrict access on folders, based on the client IP. E.g.:
Code:

<Directory  /var/www/private1>
Order Deny,Allow
Allow from 127.0.0.1 192.168.0
Deny from all
</Directory>

assuming 192.168.0.0/24 is your LAN. You should change that accordingly. You don't need something similar for the public folder, as you want anyone to access it.
For more details have a look here

Regards


All times are GMT -5. The time now is 07:34 PM.