LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-08-2013, 02:36 AM   #1
pedenski
Member
 
Registered: Feb 2012
Posts: 33

Rep: Reputation: Disabled
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
 
Old 06-08-2013, 03:27 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forbidden (/var/www/directory access error) amritpalpathak Linux - Software 15 08-02-2011 03:43 AM
Unable to browse /var/www/directory amritpalpathak Linux - Software 5 07-18-2011 02:06 PM
Allow apache to access user_home_t only inside /var/www/ dhelyar Linux - Security 1 12-02-2010 11:35 AM
How to forward port to listening apps inside VirtualBox? matruschka Linux - Networking 1 09-24-2008 08:44 AM
how do i forward a port to and inside IP parabit Linux - Networking 3 01-09-2002 11:17 AM


All times are GMT -5. The time now is 04:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration