LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   newbie webserver queries. (https://www.linuxquestions.org/questions/linux-newbie-8/newbie-webserver-queries-84570/)

Trinity22 08-22-2003 12:19 PM

newbie webserver queries.
 
Hey, I just did a search for this and didn't find anything answering this, so please don't crucify me :D.

I'm interested in starting the process required to have my computer be a webserver (hosting my small 30mb website). A few questions though.

1). I've heard that before you can have your computer be a webserver (at least for a website) you have to have 2 static IP's from your ISP. Is this true? Would I be okay with just the one I have now? I am running cable 'net.

2). Is there a tutorial for starting a webserver that I don't know of because I haven't been in the linux community very long?

3). How rabid must one be in securing the server? Would a firewall work or is there lots more that goes into the process?

well those are my questions, hoping someone can answer one or all or at the very least provide me with url's.....:)

thank you,
trinity

jdruin 08-22-2003 12:31 PM

1). I've heard that before you can have your computer be a webserver (at least for a website) you have to have 2 static IP's from your ISP. Is this true? Would I be okay with just the one I have now? I am running cable 'net.

You need one IP. It helps if it is static. If have a cable modem, you may already have a static IP. You can go into your router setup and click on 'refresh DHCP' which will cause the router to hot the cable company and try to get a new number. If it comes back the same number. You probably have a static IP. Cable companies say they dont give static IP's. But this is a legal issue. Mine has ben the same for 4 years.

If you dont have a router, check you IP and the lease time on it using IFCONFIG. When the lease time is up, check to see if it renews to be the same number. If so, you may have a static IP. Unless the cable company claims it to be static, they can change it at any time without telling you so its up to you to deal with that.



2). Is there a tutorial for starting a webserver that I don't know of because I haven't been in the linux community very long?
The webserver you will find the most documentation on is Apache. O'Reilly has a very easy to read primer on Apache that is writen for newbies. It is called, strangely enough, Apache. www.oreilly.com. You can find tons of info by googling apache as well. http://www.apache.org/

3). How rabid must one be in securing the server? Would a firewall work or is there lots more that goes into the process?

A firewall helps keep the box from getting hacked. It does nothing for the webserver. Ask yourself, if the box got hacked, what is the worst that could happen. For me the answer is I would havce to reload to OS and reinstall all my backup files such as configurations which I have on CD. Not bad. So I dont sweat it too much. If you have personnal or damaging info on the box, you cannot take security too seriously. The book Maximum Linux Security is a newbie to intermediate level book that will teach you tons about OS's, Linux, and also security.

martinman 08-22-2003 12:38 PM

this should help TONS. it doesnt explain much, like other tutorials, but it is straight and to the point, only a page long. It deals with configuring a LAMP setup on your webserver.

LAMP=Linux, Apache, MySQL, PHP

All of which you will need, I'm assuming ;)

http://www.mkaz.com/reference/php/setup_linux.html

also, you only need one static IP, and as long as you open port 80 to your box through a router (again, asssuming you have one), the world will be able to see your page.

About security...DONT be a fool and use your main desktop/laptop/workstation for a webserver. If you did, chances are a hacker would have a LOT more to exploit and fiddle with, e.g. mounted drives, other networked computers, etc. jdruin was right, think "what is the worst that can happen?"

Trinity22 08-22-2003 12:53 PM

thank you for the help so far :)

well i only have one computer so yeah i was hoping to turn this computer into one to host my page or at least host more files. is the security particularly hard to learn or implement? i'm not afraid of hard work, just that saving $100+ a year in webhosting fees is a tempting lure.

okay here's an extreme newbie question, how would i go into router config or even run IFCONFIG. I tried in the command line just for kicks and got nothing so i'm literally scratching my head.

and what is a router? I'm connected to the net via Ethernet and my Webstar cable modem.

trinity

figadiablo 08-22-2003 01:44 PM

Quote:

Originally posted by Trinity22


and what is a router? I'm connected to the net via Ethernet and my Webstar cable modem.

trinity

Then there is no router between you and the ISP.

A router (in very easy to understand words) is a device that comunicates or directs network trafic. In other words a router helps you get from point A (your house) to Point B (maybe www.linuxquestions.org) in the internet .
Routers are used to connect private LANs (Local Area Networks; example is a home network) to the internet. In this case they are also called a "gateway" because it is the point where all the traffic has to go through to be able to acces the internet or another networks.
In very basic words, a router conects networks together.

You can go to CompUSA and buy a cheap router (Linksys, Netgear); set up two or three computers at home in a Network, and be able to share the internet connection between them with the router.

Hope this helps
Figa

jdruin 08-22-2003 02:04 PM

I'm connected to the net via Ethernet and my Webstar cable modem.

In that case you do not have a router. Routers are cheap and come in good brands like Linksys and DLink but they require that you learn basic networking priciples to use them effectively. Basically they allow you to direct all web request to one particular computer thus securing the computers from a central point. Since you only have one computer, a router is not neccesary (but would still be useful)


how would i go into router config or even run IFCONFIG. I tried in the command line just for kicks and got nothing so i'm literally scratching my head.

ifconfig is probably not coming up because the path is not set. The path is the location of the executable program. To find out what the path is for ifconfig do:

find / -name ifconfig

THis will produce a result (or more) something like:

/sbin/ifconfig

You can type in the entire path to run the command.

To permanently set a path (in RedHat), make a backup of

/etc/profile

by:

cp /etc/profile /etc/profile.backup

and open the /etc/profile file in a text editor such as pico (ie pico /etc/profile) and add the lines:

pathmunge .
pathmunge /usr/bin
pathmunge /usr/sbin
pathmunge /usr/local/sbin

Put this before the line 'unset pathmunge' (about line 23 or so)

Save the file. Exit and login again. Test by using ifconfig but without the path (so just type ifconfig, not /sbin/ifconfig) and see if the shell finds it.

Good luck


All times are GMT -5. The time now is 12:44 PM.