How to setup a webserver?

Place to discuss Fedora and/or Red Hat
Post Reply
jrich4
user
user
Posts: 14
Joined: Sun Mar 16, 2003 10:49 pm
Location: Tennessee

How to setup a webserver?

Post by jrich4 »

What all do I need to setup a webserver using RedHat 9? I have Apache running and am currently reading up on how to set it up. Right now I just want to setup my own webserver and webpage for family with pictures of our newborn daughter. Can I use port 80 or do I need to assign it something else. My ISP wants you to buy another account for running servers, but I just want to run a very small one for family to access with my current account. What is a good program for creating webpages in linux? Any info or tips would be greatly appreciated.

Thanks,
jrich4

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Apache is usually configured and ready to run and should require no configuration for a basic web site running on the standard port 80. Just make sure it's configured to start at bootup and is running:

# chkconfig httpd on
# service httpd start

You can get a hostname for free from www.dyndns.org (as well as other places). If you have a dynamic IP address you can run a client to make sure your hostname is always up to date with the correct IP address. You can also get static host names. I have my voidmain hostnames registered through them.

Your ISP may not allow connections on port 80 since they want a special contract for web servers, but it won't hurt to try it.

Your content goes under /var/www/html for the default configuration. The directory index pages are called "index.html". I use VIM to create my web pages, which is without question the best editor for just about everything, but if you've never used it then you may get frustrated with it. "kate" is also an excellent HTML editor. These are not WYSIWYG editors. I personally can not stand WYSIWYG but if you want that then the editor included with Mozilla is very good one or I hear people like Quanta Plus.

jrich4
user
user
Posts: 14
Joined: Sun Mar 16, 2003 10:49 pm
Location: Tennessee

Post by jrich4 »

Thanks for your response void main.
I have cable internet going through a linksys router. I have 1 computer with windows on it for my wife, she doen't understand or like Linux and I have the other one that I am using to write this running RedHat 9.
I have played with Vi very little, I am planning on learning it though. I am getting so fed up with windows and microsoft, and am planning on really learning Linux. I also know some basic C and C++, but haven't done any programming in Linux.
Sorry for the rant and getting off topic. Thanks for all your help and this forum.

jrich4

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Keep ranting, I like. If you are a C programmer and you learn a little VIM (and/or many more *NIX editors) I believe you are really going enjoy Linux/UNIX. Since you are using a LinkSys router you will have to forward port 80 to your Linux machine. You should have a section on port forwarding in your manual (or just play around in the web interface until you find it). As I mentioned, I picked the name "voidmain.is-a-geek.net" from dyndns.org and use a utility called "ddclient" to keep the name updated with my current IP address. Actually I picked a few names for my server. If you do the above people should be able to get to your web server. First make sure your web server is working internally by doing:

http://xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is the internal IP address of your Linux box (probably in the range of 192.168.x.x) . Try doing it from the browser on one of your other computers. If your web site comes up then if you have port 80 on your router forwarded to your Linux box then people on the internet should be able to put your external IP address in their browser and get to your site. Registering a name on dyndns.org would allow them to get to your site by name. dyndns.org has many domains to choose a hostname on: xxx.is-a-geek.net, xxx.is-a-geek.com, xxx.is-a-geek.org, xxx.dyndns.org, xxx.homelinux.net, xxx.homeip.net, and many more.

jrich4
user
user
Posts: 14
Joined: Sun Mar 16, 2003 10:49 pm
Location: Tennessee

Post by jrich4 »

I had to learn C for work. I work maintenace in a factory that makes ECUs, Keyless entry modules, Airbag sensors, relays, and some other electrical systems for automobiles. The new style robots that we are using are programmed with a bastardized language that has some of C, Basic, and their own robot language. They made us take a class in C though. I guess that I am considered a beginner to intermediate C programmer. Also, I have found a video game tutorial for C and C++ that I have been studying.

For the webserver, I just want to set up a very small website for mainly family and friends to be able to see pictures of our newborn daughter. I want them to be able to download the pictures that they like too. This is just a learning experience for now. Later, I want to set up an FTP server and a forums website, and maybe other webpages. Or maybe a website that incorporates all of these in one.

Thanks for your help. You have helped me out for a couple of years now void main. I use to go by a different name on the fsckmicro$oft site. You helped me get my linux box on the net. I have been slacking though and havn't really put forth the time to really learn Linux yet. I have some books and other docs and am starting to learn now.

Thanks,
jrich4

jrich4
user
user
Posts: 14
Joined: Sun Mar 16, 2003 10:49 pm
Location: Tennessee

Post by jrich4 »

I finally got the Apache webserver up and running and can connect to it from my different computers through the web browser. Does this mean that anyone connected to the net can access it now with their web browser if they put in the IP address and port number? I am behind a Linksys router on a cable internet connection.
How do I go about setting it up or configuring what ever it is I need to configure so that people can just type in ex. www.xxxxxxx.com to get to my webpage? Do I need to configure Bind?
Thanks for everyones help!

Thanks,
jrich4

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

I think I explained all that in my last post. Please reread it and if you have questions about anything feel free to ask. You do not have to set up bind unless you would like to purchase your own domain and run your own DNS server which I would not recommend, especially if you do not have a static IP. You can get a name for free from http://www.dyndns.org/ and other free DNS services. Just register there and create a DNS entry for your IP address (it should detect automatically what your IP address is). You'll need to forward port 80 on your LinkSys router to your web server as I mentioned in my previous note. Once you do both of those things people out on the internet should be able to get to your server both by name and by IP.

Post Reply