You are not logged in.

#1 2005-05-25 01:44:29

paperinik
Member
Registered: 2005-05-25
Posts: 46

A Simple Webserver

Greetings.

I am not actually a newbie. Lately, I have become pretty comfortable with Arch Linux as a desktop. I have used major Linux distros, but have to admit Arch Linux is unique and sweet. I have been using Linux since early 2001, and only lately began to develop a keen interest to setup a server. I think I am ready.

I use cable to connect to the internet. I share the connection with 2 other pcs via a router. At this time, I am not planning to obtain a domain name; I just want to use my ip address, install/configure the necessary packages and setup the server. I just want to setup a simple webserver that displays pages in simple HTML. Once I succeed, I plan to move to the next step by obtaining a domain name and installing/configuring other advanced packages (php, mysql).

Now, I have read some topics about setting up a webserver, and understood I will definitely need to install apache. What other packages do I need?

Once the packages are installed, I understand I will have to configure some files. I think I need to know my ip address, but ifconfig only provides my router's address (192.168.x.x) and a 127.0.0.1 address. Is that what I will need for the configuration file(s)? What other information will I need for the configuration file(s)?

Your help is much appreciated.

Offline

#2 2005-05-25 01:52:58

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: A Simple Webserver

If you are only serving static content, you might consider using lighttpd. It is fast, and the config is much simpler than apache.

As for getting a website to work, you first need to find your router's external ip (and whether it is static or dynamically assigned).


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-05-25 02:04:37

paperinik
Member
Registered: 2005-05-25
Posts: 46

Re: A Simple Webserver

cactus wrote:

If you are only serving static content, you might consider using lighttpd. It is fast, and the config is much simpler than apache.

Thanks for the prompt response. Is lighttpd the only package that I need?

cactus wrote:

As for getting a website to work, you first need to find your router's external ip (and whether it is static or dynamically assigned).

I have to admit I don't know the command to find my router's external ip. I know certain sites can let you know what your ip address is; is that how I can find it? I believe my ip is dynamically assigned; a customer service of my provider (Comcast) once told me how I can change my ip address (turning off router/modem for a given time).

Offline

#4 2005-05-25 03:31:55

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: A Simple Webserver

The easiest way, I think, to get your external ip address is to go to
www.whatismyip.com
That will give you your ip.  Then of course you'll have to configure your router to forward requests on port 80 (or whatever port you decide to run your web server on) to the pc actually running the web server.

Offline

#5 2005-05-25 04:11:34

paperinik
Member
Registered: 2005-05-25
Posts: 46

Re: A Simple Webserver

Stinky wrote:

Then of course you'll have to configure your router to forward requests on port 80 (or whatever port you decide to run your web server on) to the pc actually running the web server.

This I will do it by typing the 19.168.x.x address in my browser, going to the page where there are many options to setup the router?

I have been reading about the /etc/httpd/conf/httpd.conf file, where YOUR_INET_IP & YOUR_FQDN are mentioned. I understood that I will put my ip address in YOUR_INET_IP. I didn't understand YOUR_FQDN.

Thanks.

Offline

#6 2005-05-25 11:37:03

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: A Simple Webserver

paperinik wrote:

This I will do it by typing the 19.168.x.x address in my browser, going to the page where there are many options to setup the router?

Yes, that is correct.
[Edit]
Those two settings you mentioned, I don't have in my httpd.conf.

Offline

#7 2005-05-25 16:26:19

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: A Simple Webserver

I don't like apache myself... at least for personal things... I'd rather run something smaller...
I'm going to go with cactus and say use lighttpd (yes it's the only package you need)

you can get it from cactus's or klapmetz's repo

paperinik, you don't need to set anything for the apache IP and the FQDN (Fully Qualified Domain Name)...

here's what you do... whatever web server you choose, apache/thttpd/lighttpd, set up whatever is required for that daemon... make a stupid "index.html" page that says "HOORAY IT WORKS" and put it whereever your daemon serves files from...

Now, start your web server (/etc/rc.d/<sever> start) and set up your router to forward port 80 to the machine the web server is running on (you're correct, go to the IP of the router and forward port 80 to your IP).

Ok, you're up and running... now.. go to www.whatismyip.com and find you external IP (the IP your router has to the rest of the world)

open up that IP in firefox (or whatever) and it should say "HOORAY IT WORKS"

now, you can do like I did and setup a DynDNS account so you don't have to go to your IP address, but can get a real URL

Offline

#8 2005-05-25 16:56:41

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: A Simple Webserver

What's lighttpd's advantage over thttpd?

Offline

#9 2005-05-25 16:59:39

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: A Simple Webserver

i3839 wrote:

What's lighttpd's advantage over thttpd?

it handles fastcgi and caching...
cactus did some benchmarks somewhere...

Offline

#10 2005-05-25 19:15:54

paperinik
Member
Registered: 2005-05-25
Posts: 46

Re: A Simple Webserver

phrakture wrote:

here's what you do... whatever web server you choose, apache/thttpd/lighttpd, set up whatever is required for that daemon... make a stupid "index.html" page that says "HOORAY IT WORKS" and put it whereever your daemon serves files from...

Could you specify in what directory I should put the index.html file? Thanks.

Offline

#11 2005-05-25 19:54:53

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: A Simple Webserver

paperinik wrote:

Could you specify in what directory I should put the index.html file? Thanks.

It depends on what web server you're using and how it's configured... for lighttpd, I use /www/pages... I think apache uses /home/htdocs... just check the docs on what server you decide on

Offline

#12 2005-05-25 21:07:38

paperinik
Member
Registered: 2005-05-25
Posts: 46

Re: A Simple Webserver

Well, I have installed Apache and followed your instructions. There was already and index.html file in /home/httpd/html. When I enter my ip address in the browser, it just keeps loading without opening any page. When I enter my router's address in the browser, it displays a simple page that reads:

Arch Linux
This is a test page for the Apache Web Server.

Obviously, the page is actually the /home/httpd/html/index.html file. However, it appears I can only access it internally. Any ideas?

Offline

#13 2005-05-25 21:13:31

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: A Simple Webserver

no you're supposed to go to the router's IP... your IP is something like 192.168.X.X... so is mine... so is about 4 million other people... that IP won't work
you need the public IP which is that of the router...

just do this... go to dyndns.org and sign up for a dynamic account (it's free).. then just use the IP address if gives you...

enter that URL into the browser

Offline

#14 2005-05-30 02:37:19

paperinik
Member
Registered: 2005-05-25
Posts: 46

Re: A Simple Webserver

Finally, I have succeeded! For those who have helped, I appreciate. This is what I did: I have configured my router's setup, registered with dyndns.org, started Apache, and didn't even touch the httpd.conf file at all. That's it.

big_smile

Offline

#15 2005-09-15 20:29:36

Oin
Member
Registered: 2005-09-02
Posts: 63

Re: A Simple Webserver

Ok, so I kinda did the same things... I installed apache, did the proper configuration (i think...) and tried accessing my ip on my browser, there was no error,no waiting, just a blank page...
I didn't change the directory where the index.html file should be located, which in my case was: /home/httpd/html/index.html

I then installed lighttpd and I configured this as well, and got exactly the same result: a blank page... there is, apparently, no error when i start the server...

I don't know what to think... What did I do wrong?

I also tried registering for a domain-name at dyndns.org, and when i accessed that domain i got the same result again, an instant blank page...
And there is a html code in the /home/httpd/html/index.html that should load and should say Arch Linux web server something... but all i get is an instant blank page...

Can anybody help me with this ? Please?


In Linux there are no secrets!

Offline

#16 2005-09-19 20:22:41

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 548

Re: A Simple Webserver

ddclient (in the AUR) is well worth installing and configuring if there's a possibility of your ip address changing.

Offline

#17 2005-09-21 15:00:38

Oin
Member
Registered: 2005-09-02
Posts: 63

Re: A Simple Webserver

I resolved my own problem big_smile
it turns out that everything was working fine with both of them (apache and lighttpd), because other people could see my page when using my ip, only I couldn't see it...  lol


In Linux there are no secrets!

Offline

Board footer

Powered by FluxBB