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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-05-2004, 07:58 AM
|
#1
|
Member
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262
Rep:
|
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.
|
|
|
11-05-2004, 08:06 AM
|
#2
|
LQ Guru
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,337
Rep:
|
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 08:07 AM.
|
|
|
11-05-2004, 08:26 AM
|
#3
|
Member
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262
Original Poster
Rep:
|
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
|
|
|
11-05-2004, 11:06 AM
|
#4
|
Senior Member
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765
Rep:
|
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.
|
|
|
11-05-2004, 03:26 PM
|
#5
|
Member
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262
Original Poster
Rep:
|
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
|
|
|
11-05-2004, 05:11 PM
|
#6
|
Member
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547
Rep:
|
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 05:16 PM.
|
|
|
11-05-2004, 06:49 PM
|
#7
|
Member
Registered: Jul 2004
Location: England
Distribution: 1 Gentoo 2005.0 system(desktop), 1 hardened-gentoo SeLinux stage1 server ;)
Posts: 262
Original Poster
Rep:
|
cheers, thats exacly what i was looking for

|
|
|
11-05-2004, 09:42 PM
|
#8
|
Member
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547
Rep:
|
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 09:45 PM.
|
|
|
11-09-2004, 10:44 PM
|
#9
|
Member
Registered: May 2004
Posts: 123
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 12:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|