LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-05-2004, 08:58 AM   #1
Snerkel
Member
 
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262

Rep: Reputation: 30
creating an intranet using apache


hi, im trying to setup an intranet but i just thought of something.
how would i setup webpages so that there only accessable from inside my network? would i have to set it up with VHosts ?
any advice/tips would be greatly apricated

Thanks, Ben.
 
Old 11-05-2004, 09:06 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
I think if you use only the internal IP address of the machine running apache instead of you external IP, it should work. For the site do not be visible outside the network, just make sure that port 80 is not reachable for the computer running apache. Examples:

1-) I have my IP address, given by my ISP. Let's say it's 212.215.133.554.

2-) I've a router, so every computer has it's Internal IP generated automatically by DHCP. Let's say one machine (with IP 196.198.2.212) is running apache.

3-) If I type in a browser from any of the machine in the network (intranet): http://196.198.2.212 , we should reach the machine running apache.

4-) To make your page visible outside the network, you've to forward port 80 (default) in your router/firewall setting to the machine running Apache (in this case, 196.198.2.212). The, any computer, inside or outside the Intranet would reach you machine by typing in a browser: http://212.215.133.554. If you don't want the page to be reached outside, make sure to either change the port, or block the traffic to that machine (e.g, port 80).

I think that would work... never tried myself though

Good luck!

Last edited by Mega Man X; 11-05-2004 at 09:07 AM.
 
Old 11-05-2004, 09:26 AM   #3
Snerkel
Member
 
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262

Original Poster
Rep: Reputation: 30
the computer running apache is a server, i cant stop port 80 from being forwarded to it because i have websites etc. on there so i want people to be able to reach it. but i want a seperate website just for inside my network, that cannot be accessed from outside.

i know about putting e.g. http://192.168.0.150/ (my server ip) in my browser (from inside my network) will reach my webserver.

Thanks, Ben
 
Old 11-05-2004, 12:06 PM   #4
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
create a vertual site (think that is what it is called) you can have more then 1 directory for your index.html and host more then one site.

i do not know if you can have ea site running on a different port... if you can, then just run your internal site on port 8080 and add :8080 to the end of the IP for the LAN site.
 
Old 11-05-2004, 04:26 PM   #5
Snerkel
Member
 
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262

Original Poster
Rep: Reputation: 30
yeh, you mean create a virtualhost right ? thats what i thought but i was wondering if it was possible to setup the VHost so that it only accepts connections from 192.168.0.*?

Thanks, Ben
 
Old 11-05-2004, 06:11 PM   #6
jon_k
Member
 
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547

Rep: Reputation: 30
Make a .htaccess file in the root of your website (e.g. /var/www or /var/www/html... or wherever the 'root' for the host or virtual host is located.

Put something like the following in the file:
<limit GET>
deny from all
allow from 192.168.0.
</limit>

This -should- prevent people from loading webpages unless their IP is within the range 192.168.0.* for that directory and all sub directorys.

Try it, see if it works, if it doesn't, post again here.

By the way, please post back if it works! I like to know if I'm right y'know ;-)


If you'd like to do this from the httpd.conf file, I'm sure there is a very similar approach, but within virtual host directives.

Regards,
Jon Kelley

Last edited by jon_k; 11-05-2004 at 06:16 PM.
 
Old 11-05-2004, 07:49 PM   #7
Snerkel
Member
 
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262

Original Poster
Rep: Reputation: 30
cheers, thats exacly what i was looking for

 
Old 11-05-2004, 10:42 PM   #8
jon_k
Member
 
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547

Rep: Reputation: 30
Your very welcome. ;-)

I wonder... did you decide to use a .htaccess or go about doing it in httpd.conf?

Last edited by jon_k; 11-05-2004 at 10:45 PM.
 
Old 11-09-2004, 11:44 PM   #9
silmaril8n
Member
 
Registered: May 2004
Posts: 123

Rep: Reputation: 15
How would you configure apache to allow internal and external access?

Right now I have apache configured with my public IP and a router forwarding requests on 8080 to it. The only way I can access it from inside the network is to connect to a proxy and come back in. When I go to the local address it tries to access the public IP.
 
  


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
Apache doesn't like internet connections, allows intranet Eyaw_Nayr Linux - Networking 3 08-24-2004 08:32 AM
Apache doesn't like internet connections, allows intranet Eyaw_Nayr Linux - Software 1 08-20-2004 06:17 PM
Apache virtual hosts for intranet and external site tawalker Linux - Software 12 06-25-2004 12:01 PM
Apache Intranet Configuration Problem ericleunghk Red Hat 0 05-16-2004 06:16 AM
Intranet - apache - samba geertm Linux - Networking 22 04-09-2003 01:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:22 PM.

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
Open Source Consulting | Domain Registration