Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 5th April 2008, 09:29 PM
fed_sdm Offline
Registered User
 
Join Date: Apr 2008
Location: Calcutta, India
Age: 26
Posts: 24
How To Configure Apache For A Small Home Network

plz help me out..
i am stuck to set up apache for home network[Lan]........
actually i want apache to work like this-----------
if my ip address is placed in a web browser in any computer in this network, it will show a web page which is in my /var/www/html directory
i would like to have cgi scripts working tooooooo

so plz help me ...................
Reply With Quote
  #2  
Old 7th April 2008, 04:29 PM
zakaroo Offline
Registered User
 
Join Date: Jan 2008
Posts: 9
Hi - Can you tell us about your network? Are you using DHCP or static addresses? Is the computer running Apache a full server (which runs other network server operations) or just a computer runnning Apache?

Z
Reply With Quote
  #3  
Old 30th August 2008, 10:54 PM
bbiandov's Avatar
bbiandov Offline
Registered User
 
Join Date: Jul 2008
Posts: 11
Good luck! I dont mean to be sarcastic. That simply DOES NOT work with the stock apache install for FC9. The one that comes from the DVD or "yum install httpd"

Whatever they did to it it will not work if you simply put http://192.168.5.1 in your web browser. A work around is to setup hosts on your PC so then you put http://hyserver and then apache works

I have seen ton of useless answers regarding SElinux and iptables withouth anyone realizing this has NOTHING to do with networing but it is an issue with the stock apache in FC9. Nothing you do to httpd.conf can solve this. I am guessing the binary was compiled with some option to FORCE name resolution in the html headers and hence ip address will not work. Sure, tried default vhosts and all the other "trivial" stuff but none works.

The real fix? "yum remote apache" then download and source, compile and it works as it should.

If anyone is a true guru about apache please post the underlying cause that will make FC9 stock apache behave in this way. If there is a fix instead of removing and compiling as I was fourced to please let us know!

~B
Reply With Quote
  #4  
Old 30th August 2008, 11:27 PM
pete_1967 Online
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,927
Quote:
Originally Posted by bbiandov
Good luck! I dont mean to be sarcastic. That simply DOES NOT work with the stock apache install for FC9. The one that comes from the DVD or "yum install httpd"

Whatever they did to it it will not work if you simply put http://192.168.5.1 in your web browser. A work around is to setup hosts on your PC so then you put http://hyserver and then apache works

I have seen ton of useless answers regarding SElinux and iptables withouth anyone realizing this has NOTHING to do with networing but it is an issue with the stock apache in FC9. Nothing you do to httpd.conf can solve this. I am guessing the binary was compiled with some option to FORCE name resolution in the html headers and hence ip address will not work. Sure, tried default vhosts and all the other "trivial" stuff but none works.

The real fix? "yum remote apache" then download and source, compile and it works as it should.

If anyone is a true guru about apache please post the underlying cause that will make FC9 stock apache behave in this way. If there is a fix instead of removing and compiling as I was fourced to please let us know!

~B
And that's completely, utterly, total bollox.

Just make sure you have http (port 80) opened in your firewall and you can access the server with its (network) IP address from other network computers. If you want it to use hostname or be publicly available, it gets little bit more complicated.

Of course, don't forget to start Apache on host computer first
__________________
A Drink is Not Just For Christmas - SaskyCom :thumb:


“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime” so now go and...
RTFM FIRST: http://docs.fedoraproject.org/ & http://rute.2038bug.com/index.html.gz
Reply With Quote
  #5  
Old 31st August 2008, 02:24 AM
bbiandov's Avatar
bbiandov Offline
Registered User
 
Join Date: Jul 2008
Posts: 11
what did I say about the "networking" answers?
Reply With Quote
  #6  
Old 31st August 2008, 03:58 AM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Just tested "stock" httpd and have no problem with or without VirtualHost. Put IP address in browser and worked like a charm.

See, no "networking" answer here.

Edit: wonder how "yum remote apache" works.

Last edited by briantan; 31st August 2008 at 04:02 AM.
Reply With Quote
  #7  
Old 31st August 2008, 08:35 AM
bbiandov's Avatar
bbiandov Offline
Registered User
 
Join Date: Jul 2008
Posts: 11
good point, I mean to say "remove"

Did you do yum update - that is what broke it for me. I missed to mention that - my bad.

Once yum update was done, hitting httpd by IP was no longer possible. The only fix after that was to remove it and then compile sources (which takes the story out of yum's vision) and then all worked the way it did before yum update

Thanks for your reply!
~B
Reply With Quote
  #8  
Old 31st August 2008, 12:12 PM
pete_1967 Online
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,927
Quote:
Originally Posted by bbiandov
good point, I mean to say "remove"

Did you do yum update - that is what broke it for me. I missed to mention that - my bad.

Once yum update was done, hitting httpd by IP was no longer possible. The only fix after that was to remove it and then compile sources (which takes the story out of yum's vision) and then all worked the way it did before yum update

Thanks for your reply!
~B
You see, if you block your ports, you are invisible to network. If you want your service to be available for network, you need to have ports open for it.

What comes to updates breaking httpd, that's another false statement. I got stock Apache installation with what ever yum updates there have been.

Your httpd package problems are seated tightly between the chair and the keyboard.
__________________
A Drink is Not Just For Christmas - SaskyCom :thumb:


“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime” so now go and...
RTFM FIRST: http://docs.fedoraproject.org/ & http://rute.2038bug.com/index.html.gz
Reply With Quote
  #9  
Old 31st August 2008, 01:03 PM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Quote:
Originally Posted by bbiandov
good point, I mean to say "remove"

Did you do yum update - that is what broke it for me. I missed to mention that - my bad.

Once yum update was done, hitting httpd by IP was no longer possible. The only fix after that was to remove it and then compile sources (which takes the story out of yum's vision) and then all worked the way it did before yum update

Thanks for your reply!
~B
I guess you mean httpd rather than apache too.

Of course it's the latest httpd-2.2.9-1.fc9.x86_64. Worked out of the box.

There must be something you've done to httpd.conf that made it not working by IP.
Reply With Quote
  #10  
Old 31st August 2008, 02:22 PM
vallimar Offline
Registered User
 
Join Date: Jul 2008
Posts: 806
I can access my stock httpd using IP.
I agree, must be a case of user error.

Make sure you have proper values for the Listen and
the ServerName directives and there shouldn't be a problem.
Reply With Quote
  #11  
Old 31st August 2008, 03:04 PM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Quote:
Originally Posted by fed_sdm
plz help me out..
i am stuck to set up apache for home network[Lan]........
actually i want apache to work like this-----------
if my ip address is placed in a web browser in any computer in this network, it will show a web page which is in my /var/www/html directory
i would like to have cgi scripts working tooooooo

so plz help me ...................
By default, httpd worked out of the box.

Place your cgi scripts in /var/www/cgi-bin and you're good to go.

Make sure the scripts have exec permission (chmod 755 myscript.pl)

Example of simple perl cgi scripts. For use with CGI package, see http://perldoc.perl.org/CGI.html

Code:
#!/usr/bin/perl

print <<HTML;
Content-Type: text/html

<html>
<body>
<h3>Hello world!</h3>
</body>
</html>
HTML
To execute this script, use this url (assuming server ip is 192.168.1.1):

http://192.168.1.1/cgi-bin/myscript.pl

Edit: Oops, didn't realized this was old thread. OP is probably gone.

Last edited by briantan; 31st August 2008 at 03:08 PM.
Reply With Quote
  #12  
Old 2nd September 2008, 06:24 PM
M4rc0's Avatar
M4rc0 Offline
Registered User
 
Join Date: Aug 2007
Location: Brasil
Posts: 471
Hi there,

I have apache here in a small network and i can't see it from the other comp.
They are connected through a router, and i've already checked both firewall and SElinux for the port 80.

What else could it be?
Reply With Quote
  #13  
Old 2nd September 2008, 06:48 PM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
are the other computers in the same subnet? All the computers plugged into LAN ports on router? Can you ping or telnet the web server from other computer?

lets check them from the bottom up, on the server, su to root.
Code:
$ su -
#
1. Check apache port is opened (listening) (192.168.x.x is server ip address)
Code:
# nmap -p 80 192.168.x.x
PORT   STATE SERVICE
80/tcp open  http
2. Check firewall configured for port 80 access
Code:
# /sbin/iptables -nL INPUT |grep dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:80
3. Check selinux configuration, should be there by default
Code:
# /sbin/semanage port -l|grep http_port_t
http_port_t                    tcp      80, 443, 488, .....
On client machine, open a terminal or dos command prompt
Code:
$ telnet 192.168.x.x 80
Trying 192.168.x.x...
Connected to 192.168.x.x.
Escape character is '^]'.
type "get /" and enter

If freeze, type ^] (Ctrl-]) and enter to get out.

Last edited by briantan; 2nd September 2008 at 06:52 PM.
Reply With Quote
  #14  
Old 2nd September 2008, 10:42 PM
M4rc0's Avatar
M4rc0 Offline
Registered User
 
Join Date: Aug 2007
Location: Brasil
Posts: 471
1 and 2 passed

3, i don't have semanage

and 4 i couldn't connect from the client (windows), it said couldn't connect to host on port 23, "connection failed"

Should i attach my httpd.conf or the problem is elsewhere ?
Reply With Quote
  #15  
Old 3rd September 2008, 12:17 AM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Wrong path for semange. Try this one.

Code:
# /usr/sbin/semanage port -l|grep http_port_t
It is telnet with "80" at the end
Code:
$ telnet ip 80
If 1 and 2 passed, most probably there's nothing wrong with server setup. Could be just network cable connection, or the computers are not on the same subnet.

On the server and other linux computer, do this and report the output.
Code:
# /usr/sbin/ifconfig
For Windows, open a DOS command window

Code:
C:\> ipconfig
You may also try pinging from other computers to test the connectivity.
Code:
$ ping -c 5 server_ip
or for DOS prompt
C:\> ping -n 5 server_ip
Reply With Quote
Reply

Tags
apache, configure, home, network, small

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache small problem prudhviy Servers & Networking 0 7th October 2007 08:14 PM
configure apache to work in internal and External network hdamis Servers & Networking 3 9th August 2007 08:30 PM
Setting up a small home network maxstradamus Servers & Networking 3 3rd August 2006 03:45 AM


Current GMT-time: 07:40 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat