How to Set up my own web server?
Well, I finally have gotten my hands on an old computer to do with as I like. I've decided to wipe it clean of the Windows stuff and set up a "web server" for testing purposes as I try to learn PHP and some of the other scripting languages. It won't actually be online and it won't serve anything except for me for testing and learning purposes. I'd prefer to do all my development offline for now, as it will eliminate uploads and in general should make things easier.
So, I have a lot of questions on how to get started. First of all, what operating system should I choose? I want some variant of Linux, but I'm not sure what to use. Also, how would Apache figure in here? I thought it was an OS itself, but apparently it's an add-on to Linux or something. Some clarification would be appreciated. Also, what sever modules are standard and should be installed? Will I need to know the command line to do the installations? Also, how do I go about setting up "root users" and such? Finally, this computer won't have Internet access at all (can't get it routed up to that part of the house). So is it feasible to download all the software, modules, etc. to CD's and install them that way? I'm sure you get the idea now that I don't have the slightest idea what I'm doing. But I'm anxious to learn! Thanks a lot, Matthew Back to top |
|||||
What are all these thing?
Mysql: [ download ] is the most popular opensource database. Small, powerful, not quite enterprise level due to some shortcomings, but good enough for anything most users will ever need, more than good enough. It runs as a service, or daemon in linux, that means it's always on and available. Apache: [ download ] 1.3 is known as apache, 2.0 is known as httpd. is a web server, like IIS, well, not like it, it's not considered insecure by design, it runs about 65% of the web. Apache kicks butt, it's great, I love it. Current stable release is 2.0, I've been using that for a year, zero problems, it's very good. Apache also should run as a service in winnt/xp/2k. It's a server, a web server, but needs an operating system to run on. Servers simply serve requests for things, apache is a http server, and https with the proper modifications. There are dns servers, email servers, file servers, print servers, they all serve requests and carry them out if they can, except for IIS, that's mainly a server for trojans and hackers to play with [ joke, but true in a sad way ] PHP: [ download ] is a module that apache runs the http request through if it's been told to do so. there are many apache modules, amazingly many, for example gd generates graphics, mod_perl runs perl, and so on. when apache has been told to use one of these modules, that's what it does, it sends the php through that, then serves you, the end user, the html output. latest release: 5.0, it's a big decision to go with 4.3.x, which is what almost all webhosters run, or go for the new 5. I've stayed with 4.3 for the time being, I'll move to 5.0 sometime this year I think. LAMP linuxhelp.net installation guide How to do it? If you run LAMP, Linux Apache Mysql PHP, most standard distros come complete with all that, and if you select those packages, usually under the 'development' or 'webserver' package collections, at least in redhat, it's automatic, though you still have to configure it all. Short answer, yes, you can download all the packages and burn them onto a cd, then install them. It's critical if you go this route that you fully read the documentation before installing, mistakes are easier to deal with if you did it right. I currently run my desktop development system with all these, it's W2K currently, though I'm in the process of moving to Yoper linux, which is a very very fast linux, probably the fastest one out there that a normal user can actually get running, gentoo will be faster but not by that much, and it can take days to install. I'm happy with my windows setup, it works perfectly, no problems, but I installed everything individually, no weird configuration stuff to work on. For individual package installation, the sequence is this: mysql: install, test, run as service [in Windows NT/2k/xp], make sure it's all running, test each step, usually pretty easy, has a binary program installer for windows, if your os is on your c: drive it will just work, then you have to start it as a service in w2k services. Once mysql is installed, install apache, same deal, it will find mysql I think, can't remember. Apache has what's called httpd.conf which runs all the configuration stuff, that's where you set up your virtual hosting, which is what is used for running multiple sites on your box. then install php, that takes a few configuration changes to add to apache as a module, but they are pretty easy. next install any graphics type modules you might want to use, like gd or imagemagik, but you can wait and do that later. That's on windows. Make sure to read the directions on each step, it's hard to emphasize this enough. If you failed to get mysql installed correctly, you may have difficulty installing apache and getting it to connect. And php won't do a thing alone. I'll be posting, or someone here will be, directions on installing mysql /apache/php on linux as soon as time permits. Best advice I've gotten, from the network admins at work, is install it all from new packages, on linux install from source, with the correct configuration parameters, this gives the best results but takes some learning, not a lot, but enough. If you have specific questions, post them on the apache forum, that's where we are putting all this server type stuff. Do it yourself While you can get all in one installer packages, I dont' recommend it, for the same reason I'd recommend building your own pc, it's the only way to learn how to do this stuff. And when you install the latest version, you have the latest stable releases, and if you compile from source in linux, you really have the latest stuff, configured to your needs. All the sites have excellent documentation, and I think the installers also have readme files, but read the docs before installing of course. When you are done, if you did it right, you will have an almost identical copy of all your websites running on your pc, there is no difference between my development box setup and the web servers the sites run on, in fact, with a few configuration changes, I could run all my sites off my box, it would be slow of course, since I don't have the bandwidth, and they wouldn't have unique ips, but the user couldn't tell the difference. Back to top |
|||||
|
|||||
This was just posted in the Apache forum, you can try the XAMPP project if you don't want to deal with setting up each piece, remember, this is only for development purposes, but it might fit your needs better.
I tend to try to set up my stuff so it works like real web servers do, but I think this package might do the trick for those who don't want to go through all the steps of setting up, testing, and configuring the different components. Back to top |
|||||
For a novice, the best thing to do is to use the Uniform Server on a Windows box. You should be able to be up and running in about 1 minute with no installing modules, configuring ini scripts, etc. Just set it up and go.
A bit of a shameless plug, but I wrote an article on how to do this. Check it out at: [new user link] <mod: cleaned up url> Back to top |
|||||
All times are GMT - 8 Hours
|