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

5th April 2008, 09:29 PM
|
|
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 ...................
|

7th April 2008, 04:29 PM
|
|
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
|

30th August 2008, 10:54 PM
|
 |
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
|

30th August 2008, 11:27 PM
|
|
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
|

31st August 2008, 02:24 AM
|
 |
Registered User
|
|
Join Date: Jul 2008
Posts: 11

|
|
|
what did I say about the "networking" answers?
|

31st August 2008, 03:58 AM
|
|
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.
|

31st August 2008, 08:35 AM
|
 |
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
|

31st August 2008, 12:12 PM
|
|
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.
|

31st August 2008, 01:03 PM
|
|
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.
|

31st August 2008, 02:22 PM
|
|
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.
|

31st August 2008, 03:04 PM
|
|
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.
|

2nd September 2008, 06:24 PM
|
 |
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?
|

2nd September 2008, 06:48 PM
|
|
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.
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.
|

2nd September 2008, 10:42 PM
|
 |
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 ?
|

3rd September 2008, 12:17 AM
|
|
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
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
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 07:40 (Wednesday, 22-05-2013)
|
|
 |
 |
 |
 |
|
|