Forum Moderators: phranque
(Connected to a DHCP network and has got IP 192.168.0.50)
MAIN
Server name: 192.168.0.50
Webmaster email adress: something@ispprovider.com =)
Available adresses: 192.168.0.31:80 (The Win XP PC I'm trying to access the webpage with!)
VIRTUAL HOSTS
Name: Testpage
Adress: Default Virtual host on port 80
Virtual Host Name: Testpage
Document Root Directory: /var/www/html/
Webmaster email adress: something@ispprovider.com
Host Information: Default Virtual Host
All requests on port: 80
Haven't changed anything in site configuration! It's default!
SSL: Deactivated
Logging is also by default settings!
Environment variables seems to be empty!
Directories is also default!
SERVER
All settings are by default.
PERFORMANCE TUNING
The settings here are also by default.
-----------------------------------------------------------
Tell me if you need any more information!
Thanks!
//Tommy
My approach was to get Apache serving pages locally to my RH box, then to add other systems on the lan.
First, realize that Virtual Hosts are used to serve multiple domain names from one IP. Since you have no domain names and will operate locally, restore these setting to their defaults and leave them alone.
Next, insure that your Hosts file contains "127.0.0.1 localhost" which maps the name "localhost" to the "loopback" port. RH normally sets this to "127.0.0.1 localhost.localdomain localhost", if so, there is no need to change it.
Now insert (or revise) these in your hosts.allow file (note: substitute your local (RH box) IP for the XXXs in my examples):
ALL: 127.0.0.1 192.168.XXX.XXX
ALL: localhost
Change the webmaster email address to yourusername@localhost.
Here are the key settings I'm using for Apache:
Listen 192.168.XXX.XXX:80
Listen 127.0.0.1:80ServerName 192.168.XXX.XXX:80
<Directory "/">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from 192.168.XXX
Allow from 127.0.0.1
Allow from localhost
</Directory><Directory "/var/www/html">
Options Indexes Includes FollowSymLinks ExecCGI MultiViews
AllowOverride All
Order allow,deny
Allow from 192.168.XXX
Allow from 127.0.0.1
Allow from localhost
</Directory><Directory "/var/www/html/phpMyAdmin">
Options Indexes Includes FollowSymLinks ExecCGI MultiViews
AllowOverride None
Order allow,deny
Allow from 127.0.0.1
Allow from localhost
</Directory><Directory "/var/www/manual">
Options Indexes Includes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from 192.168.XXX
Allow from 127.0.0.1
Allow from localhost
</Directory><Directory "/var/www/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from 192.168.XXX
Allow from 127.0.0.1
Allow from localhost
</Directory><Directory "/var/www/cgi-bin">
Options +ExecCGI
Order allow,deny
Allow from 192.168.XXX
Allow from 127.0.0.1
Allow from localhost
</Directory>
On your RH box, try surfing to localhost and you should see a page. From your XP box, try surfing to the IP of the RH box, in other words, [192.168.XXX.XXX...] and you should see a page.
Good luck!
I put all the info in the /etc/httpd/conf/httpd.conf file.
Then I tried surfing to it, but it didn't work. After a lot of tries I realised that my httpd service had been shut of somehow. I've turned it on now and it works fine from the localhost. Now I'm going to let the other computers on the network have access.
Thanks again!
//Tommy
//Tommy
hosts.allow controls access to all Internet services on your RH box including Apache. You can read about what Red Hat calls TCP Wrappers for some background. Simply add the IPs you want to access your server to your hosts.allow. For example, I use:
ALL: 127.0.0.1 192.168.AAA.AA?
so IPs in the range 192.168.AAA.AA0 to 192.168.AAA.AA9 can access my Internet services.
You could simply change yours to:
ALL: 127.0.0.1 192.168.XXX.YYY 192.168.XXX.ZZZ
where Y=the last 3 digits of your RH box and Z=the last 3 digits of your XP box. This limits access to just 2 IPs, and that's good from a security point of view.
Then, when I restart the httpd service, I get an error message about the listen ports... So i start deleting the listen ports that the service is complaining, which leaves me with... nothing! It still complains!
That did I do wrong?
Go back and set up EVERYTHING EXACTLY as detailed in message 2.
Confirm that Apache serves pages to the localhost, on the RH box. When that is working properly, don't change it! The Apache is configured.
Then we'll begin allowing access from other systems, a little at a time. Let me know when you are ready to add a system.
[edited by: DaveAtIFG at 3:36 am (utc) on Jan. 2, 2004]
Well I set everything EXACTLY as you told me in MSG 2... But I still get an error: httpd failed. The error was: Starting httpd: (99)Cannot assign requested adress: make_sock: could not bind to adress 192.168.****.xxx:80
no listening sockets available, shutting down. [FAILED]
Somethings wrong... but what?
//Tommy
//Happy new Year! =)
If not, did you start configuring as described in message 2 from the original httpd.conf or from a file that may have had other changes made to it?
If neither of these is the problem, it must be something external to Apache blocking it's port access.
On Windows the command is ipconfig to check a system's IP address.
Insure that any firewall software on the RH machine AND the Win machine is disabled.
Surf to your server from the Win machine, for example:
[192.168.XXX.XXX...]
<added>I just read that hosts.allow and hosts.deny rules may fail unless a blank line is included after the last rule. Edit each file and add a couple blank lines.
Also, for our purposes, hosts.deny should contain:
ALL: ALL
blank line
</added>
My Netgear router (RP614) has that capability and now my web server always has the same address. It's under LAN IP Setup -> Address Reservation.
//Tommy
For example, Cox does periodic port scans to see if their subscribers are setting up servers. If it finds one, they automatically block that port at the IP so that any requests coming in to your IP on , for example, port 80 would be stopped.
To get around this most people set up their web server, mail server, ssh, etc. on an unused, obscure port number. But to do so would require the visitors to know that port number ahead of time.
In order to serve to the world, you will need to add your gateway IP to each of the Directories you want to serve, in your httpd.conf, for example change:
<Directory "/var/www/html">
Options Indexes Includes FollowSymLinks ExecCGI MultiViews
AllowOverride All
Order allow,deny
Allow from 192.168.XXX
Allow from 127.0.0.1
Allow from localhost
</Directory>
to:
<Directory "/var/www/html">
Options Indexes Includes FollowSymLinks ExecCGI MultiViews
AllowOverride All
Order allow,deny
Allow from 192.168.XXX
Allow from 127.0.0.1
Allow from localhost
Allow from gateway IP here
</Directory>
Add the "allow line" for each directory you want to share with the world.
Also, you will need to add your gateway IP to your hosts.allow file.
As far as I'm concerned, you're now on your own since I've never made my server available beyond my LAN and don't plan to. You should be reasonably safe from having your server hacked in it's present state, but if you begin adding services such as FTP or Telnet, you're begging to be hacked.
Good luck.