LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting up a Webserver (https://www.linuxquestions.org/questions/linux-networking-3/setting-up-a-webserver-142197/)

LinuxLala 02-04-2004 10:00 AM

Setting up a Webserver
 
Hi guys,

I have a fixed IP address and a DNS address (both different :)

How do I configure Apache to run my webserver? If I don't get a domain name can
people from outside still access my website.

jtshaw 02-04-2004 10:17 AM

Without a domain name they could access it by IP, but it is certainly easier if you have a nice easy to remember domain name. There is extensive documentation on all the various features of apache and there configuration on Apache's HTTPD site. If you have specific questions on configuring a certain feature feel free to ask, but "How do I configure Apache to run my webserver" is quite vague and there could be hundreds of different answers you might be looking for.

lone_nut 02-04-2004 10:23 AM

At least Red Hat (I can see, it is one of your distroes) comes with apache (the web server. to see if it is running, open your browser and type the following in as the address:
http://127.0.0.1
if you see anything but a error, you have already a web server running.
Then you need to locate the files of the web server. The files are sometimes placed in /var/www/html. sometimes not.
you may need to dig a little around.

If you get a error message, you need to install the apache rpms. Cheek all the Red Hat CD's and install all apache* packages you see fit.

good luck and happy hacking

LinuxLala 02-06-2004 08:18 AM

OK guys so I did a few things. Now here's the scene.....

# Portions of my httpd.conf

Listen *:80

ServerName localhost
ServerName 61.16.150.118

DocumentRoot "/var/www/web"

#############################

Now this is my
/var/www/web/index.html

<HTML>
<Body>
<B>Hello Web!</B>
</Body>
</HTML>

Now I do a: service httpd start and get an [OK]

On opening 61.16.150.118 in the browser I get an error: "Connection was refused". So what's up?

LinuxLala 02-06-2004 08:20 AM

For got to add that I do have a localhost set-up. It's supposed to do a DocumentRoot on /var/www/html. But I have commented it out for now.

codedv 02-07-2004 06:27 AM

Quote:

Originally posted by LinuxLala
OK guys so I did a few things. Now here's the scene.....

# Portions of my httpd.conf

Listen *:80

ServerName localhost
ServerName 61.16.150.118

DocumentRoot "/var/www/web"

#############################

Now this is my
/var/www/web/index.html

<HTML>
<Body>
<B>Hello Web!</B>
</Body>
</HTML>

Now I do a: service httpd start and get an [OK]

On opening 61.16.150.118 in the browser I get an error: "Connection was refused". So what's up?

Firstly you need to make sure your web server is accessable via localhost.
http://127.0.0.1/

If that works then try and access it via your lan. That is if you are connected to a lan of course:
http://10.10.1.1/ <-- your IP address is probably different

If you get connection refused on the lan then your firewall is probably blocking inbound HTTP connections in which case you'll need to add the following rule to your firewall:
#iptables -I INPUT 1 -p tcp --dport 80 -J ACCEPT

Once you get it working through your lan try your static IP address. If that still doesn't work it might mean that your ISP is refusing conections on port 80. If that's the case you'll need to have Apache listen on a different port.

LinuxLala 02-07-2004 12:56 PM

OK. Thanks codedv. I'll look into ur suggestions and post again if I am successful and even if I am not :D

Thanks

Keeble 02-08-2004 03:02 PM

i get the same error when i try to find my server.

GraemeK 02-09-2004 03:47 AM

i skimmed this thread but is the apache webserver actually started? redhat doesnt start it by default...

you always get a connection refused if it isnt started.

G

marghorp 02-09-2004 04:05 AM

redirecting domains
 
You can get your own domain for free at www.dot.tk where you can register your domain and it will redirect users to your IP without showing them your IP. And it's free!

LinuxLala 02-09-2004 09:44 AM

It gets started fine.


All times are GMT -5. The time now is 04:05 AM.