Installing a webserver for newbies Part II


In this guide, you will learn how to create and run a personally hosted webserver that uses Apache, PHP, mysql, and installing a forum. Your domain name will be something like http://yourip. This guide is written for newbies so it will cover more in depth. First you must uninstall any attempt of a server before you continue. Please install everything EXACTLY how i say for the first time, then after that, do it your own way.

This is what the guide will cover.

1. Installing Apache
2. Installing PHP
3. Installing MySQL
4. Installing PHPBB forum


Tools you will need

Apache2- http://www.apache.org/dist/binaries/win32/
(download apache2 in Windows Binary) 3mb

PHP 4.2.1- http://www.php.net/downloads.php
(download the Windows Binaries PHP 4.2.1 ) 5mb
NOTE: do NOT use php-4.3.0-dev-zend2-win32-alpha1.zip because it does not work.

MySQL 3x -http://mysql.com/downloads/mysql-3.23.html
(download mysql-3.23.51-win.zip) 17.2mb

PHPBB- www.phpbb.com/downloads.php

Ok, now that you downloaded that, you are ready to start installing! First unzip and install Apache. For the Server Information screen, type anything you want because it wont matter. You might want to type in a realy Admin email tho. Also install it on port 80 (normal). Change the install folder to C:\ (dont worry, it will make a folder apache2) and then install it! If you want a server with NO PHP support or Mysql Support then you may stop here and go on to the last step.

Now we are going to install PHP. First, you will unzip the constance of that 5meg file you downloaded. Now create a folder in C:\Apache2 and called PHP. Now move the constance of the ziped file to that folder. Now go to your httpd.conf file. It is in your C:\apache2\conf directory. Now open that sucker up with notepad. Be sure to do not add the files in ( )'s

First find the line:


Setting up Httpd.conf

ScriptAlias /cgi-bin/ "C:/Apache2/cgi-bin/"
Go to the line under it and insert:

ScriptAlias /php/ "C:/apache2/php/"
(what this does is tell the server where the php folder is)

Now find the lines:
# Format: Action handler-name /cgi-script/location

#

Go to the line following it and insert this:

Action application/x-httpd-php /php/php.exe

(What this does is tell the server where the php program is)

Now find the lines:

# AddType allows you to add to or override the MIME configuration

# file mime.types for specific file types

#

AddType application/x-tar .tgz

Go to the line following it and insert these lines:

AddType application/x-httpd-php .php

AddType application/x-httpd-php .php3

AddType application/x-httpd-php .phtml

AddType application/x-httpd-php-source .phps

(what this does is like the extensions on files)

Now, look for

<IfModule mod_mime_magic.c>

MIMEMagicFile conf/magic

</IfModule>

Now add this below:

<IfModule mod_dir.c>

DirectoryIndex index.html index.php default.php main.php

</IfModule>

(What that does is when you go to a folder, it will go to one of thoes files)




Installing MySQL

OK! Your done with installing PHP. Now, we are going to install MySQL. First unzip and run the SETUP and do everything that is reccomended. Now you installed it and hopefull it all worked....

NOTE: If you install MySQL in a folder other than C:\MYSQL or you intend to start MySQL on NT/Win2000 as a service, you must create a file named C:\MY.CNF or \Windows\my.ini or \winnt\my.ini with the following information::

[mysqld]
basedir=E:/installation-path/
datadir=E:/data-path/
After your have installed MySQL, the installation directory will contain a file named 'my-example.cnf'. You can use this as a starting point for your own
C:\my.cnf file.


Starting your server
To start your nice little server with PHP and mysql, goto Start---->Program Files---->Apache HTTP Server 2.0.39---->Control Apache Server---->Start Apache in Console That little thing will start your server. Now to start MySQL, Create a shortcut that leads to "C:\mysql\bin\mysqld.exe --standalone" . The file should open and then close. Now go to http://localhost and see if it works! If it does then go to C:\Apache2\htdocs and start making your website! Now to test your PHP & MySQL. First, make a new file called info.php and insert in the C:\Apache2\htdocs dir. In that file, add the following lines of code:

<?
phpinfo();
?>

Now go to http://localhost/info.php . You should see a screen with a bunch of info on it. If you DO NOT get this screen, Then go to "Common Error"



Installing a PhpBB forum

This can be harder then you think. First, you are going to unzip PHPBB to your htdocs dir. First you will need to go to c:\mysql\data and add a Folder. This folder can be named anything you want the board databaced be named. Now go to http://localhost/phpbb2/install.php . This should lead you to the install screen. For For Database Server Hostname / DSN, Put in LocalHost. For Database name, put in the name of the folder you put in the MySQL data directory. Do NOT put anything in Database Username, or Password. Now for the Admin Configuration, put in what you want. Now Hit Start Install and you are done! Now goto http://localhost/phpbb and have fun! Now Procede to "Last Step", if you get a error when starting the install or inside the forum, please go to "common errors"

Last Step:
This is the fun part! Goto www.dot.tk and register a FREE domain name if you please. For the server redirection thing, put in http://(youripaddress) or http://localhost Now Spread the news about your veryown website!

Common Errors:
Errors piss me off! All long i hade MySQL properly installed and i always forgot to make a "databace" in the MySQL folder. The error you would recieve would be "error connecting to databace". please go back to "install a forum" to fix this (its about the folder thing). Also, if you get the error "MySQL Connection Failed" then you need to start/restart MySQL. Please go back to "Starting MySQL to fix this. The last error that i can think of at the moment is inside the forum. If the problem is that the forum cannot send email, then you need to download and setup PortCast Server 2. It is a free outgoing mail server.

Info:
The software that has been said in this walkthrough, are property of them and you must abide by there rules. This server is not for installing a message board, that will require MySQL and you may try that if you please. If someone is claiming credit for MY work, notify me.

Credits:

Chat with me on MSN- Sirbighands@hotmail.com
Chat with me on AIM- Sirbighands
Chat with me on Yahoo- Sirbighands
Chat with me on ICQ- 159305050
Email me- Sirbighands@hotmail.com

This guide has been written by me so its MINE! ~made my Nose for Astalavista Group