Firefox PHP

Phorum-Install on Win32/IIS (repost)

Posted by thomas 
Phorum-Install on Win32/IIS (repost)
January 08, 2002 10:12AM
thanks a lot to Marc Lutolf (mfl@netspan.ch) who contributed these:

Installing Phorum on a WIMP environment (Windows/IIS/MySQL/PHP)

This installation procedure is designed to get you up and running quickly.
It's assumed you have a Windows NT or 2000 setup with IIS running.

I specifically make no allowances for security considerations. It's assumed that once you've succeeded in getting Phorum to run in a test environment and are feeling comfortable, it'll be easier to go back and tweak security to your specific needs. Note that the installation docs of PHP, MySQL and Phorum all devote space to security considerations. When you get serious about your Phorum setup you'll be well advised to read them carefully.

1. Install PHP: go to [www.php.net] and download the latest stable release. The PHP Windows release comes in a zip package or as a Windows installer. Download the installer because this is the easiest way to set up in the environment we're talking about.
The installer is an .exe file. Click twice and run it. Once it's done you'll have PHP fully installed. No further care and feeding needed.

2. Install MySQL: go to [www.mysql.com] and download the latest stable release for Windows. This will be a .zip file. Once you've got it, extract it to an empty folder to avoid a plethora of files all over your desktop. Click twice on setup.exe to get the installer running. Once the process is done MySQL will be installed on your machine.
However, you're not quite done yet. You need to install MySQL as a Windows service unless you want to be turning on and off with a command line interface. To do this, open a DOS window (Startmenu-->Programs-->Accessories-->Command Prompt) and type in the command
C:\mysql\bin\mysqld-nt --install
Yes, this assumes you installed MySQL directly under the C: drive, thanks for asking. If you have problems with this step, read the MySQL documentation found at [www.mysql.com]
You can download these docs as a set of html files or browse them online. The part about Windows services is found under "2.6.2.2 Starting MySQL on Windows NT or Windows 2000"
Once you've installed MySQL as a service, open the services control panel (Startmenu-->Settings-->Control Panel-->Administrative Tools-->Services). The services are ordered alphabetically. Scroll down until you find the one called MySQL (you do see it, don't you?), click on it twice to open it and start it up. You may want to configure it to start up when the computer powers up, otherwise you'll have to turn it on manually each time.

3. Install phpmyadmin: This is a handy application which lets you manage MySQL with a GUI (and as a Windows user you love GUIs). You can download it at [sourceforge.net]
This is a .zip file that unzips as a folder you need to stick on your web server. I put it under C:\InetPub\wwwroot\PHP\, which is the directory I use for all my PHP web applications. The call with the browser is then (assuming your web is at wwwroot)
[host]
If you are running on your local client, "host" will be "localhost". Otherwise it's the web's domain name or IP number.

4. Create a database for Phorum: Point the browser to phpmysqladmin/index.php as per above. The first option on the left under "MySQL" is "Create new database". Enter a name in the field, let's say "PhorumTest" and hit the "Create" button. Your database will appear in the list of db's in the column on the far left. That's all, close the browser. Don't bother creating any tables or anything.

5. Now comes Phorum: Download the latest stable release of Phorum from [www.phorum.org]
Again this is a .zip that opens as a folder e.g. phorum-3.3.1a.zip. I tend to rename it to something a bit shorter, let's say phorum331. Stick the folder under the web server analogous to step 3, say C:\InetPub\wwwroot\PHP\phorum331. Now start the phorum installation by pointing the browser at [host] and run the install script as described in the Phorum install.txt. Enter the host as "localhost" or your web servers domain or IP, and "PhorumTest" (or whatever name you chose) as the database name. Don't bother with users and passwords for the db, you're just testing, remember? But do give yourself an admin name and password.

6. Finally, the IIS hack: The hack is described in the Phorum FAQ list, but here's the gist of it. Get your text editor and open the file Phorum331/admin/login.php. This file contains 2 lines of code
header("Location: $PHP_SELF");
They should be at lines 12 and 38. If you don't see them, try searching with your editor.
Replace each of these lines with the following code:
print '<head><meta http-equiv="refresh" content="0;URL=index.php"></head><body></body>'; exit();
Now you know what a hack looks like.

7. It should be clear sailing from here on: point your browser at [host]
You'll be asked your admin login and password. If you enter them and get an error when you hit the login button, the hack was not properly implemented. Otherwise you'll be presented with Phorum's admin menus.

*** Security Issues ***
I can't repeat enough that these instructions completely ignore security issues. The objective here is to get you a working Phorum with minimum complication. To run a bulletin board in production will require that you go back and tighten security appropriately in MySQL and Phorum.

One final consideration concerning security. Depending on your Windows installation, moving the phpmyadmin and phorum folders under the web server may leave them with insufficient access settings. The result can be that an application seemingly installs correctly, but then doesn't work properly because it lacks the permission to read or write to certain files.
This can be corrected by allowing the application folders to inherit permissions from their parent folder (in my example called C:\InetPub\wwwroot\PHP). Windows allows you to have folders inherit permissions from parents or propagate them to subfolders.
To see how this is done right-click on a folder, then go Properties-->Security. Clicking on the "Advanced" button you'll open a window with two checkboxes corresponding to inheritance and propagation (the top one, inheritance, is usually checked). Use these to transfer permissions as you see fit. Careful, though, permissions propagate to ALL a folder's children, not just the one you may want to have changed.
The top level of your web server usually has the permissions you need. In my example I'd have the folder PHP inherit permissions from wwwroot, and then have phpmyadmin and phorum331 inherit from PHP. I wouldn't propagate permissions from wwwroot, because there might be other subfolders under it whose permissions I don't want changed.)
your steps really helped me lot. And with those i got the Phorums admin menu .
But what is the next thing to do so that user can write on the e-forum. Please guide me.
And the error i am getting while pointing list.php, read.php and post.php is as follow "The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:"
hi, i am wating for my yestradays reply. Perhaps the error now i am getting while accessing post.php is as following
Warning: Undefined variable: ForumSecurity in C:\Inetpub\wwwroot\phorum-3.3.1a\phorum-3.3.1a\post.php on line 21

Warning: Cannot add header information - headers already sent by (output started at C:\Inetpub\wwwroot\phorum-3.3.1a\phorum-3.3.1a\post.php:21) in C:\Inetpub\wwwroot\phorum-3.3.1a\phorum-3.3.1a\post.php on line 34
, after succesful installation we are getting following error while accessing post.php
<b>Re: Phorum-Install on Win32/IIS (repost)</b>
January 24, 2002 12:41AM
<HTML>post this in the support forum. this one is only the documentation phorum.

it was a post of a message I received by a user as I told in the post.</HTML>

Your installation document is a bit better than install.txt, but there are some step that are not clear.

In step 5. You said, "... Now start the phorum installation by pointing the browser at [host] and run the install script as described in the Phorum install.txt." Well I got stuck at this point because the install.txt said to run the install script by " > bash scripts/secure" but in windows environment, I can not run the script. So what should I do.

In step 6, (I am using phorum 3.3.2a) so there is no "("Location: $PHP_SELF")" line in the login.php file. What should I do?
I was modifying the login.php file (Phorum version 3.3.1, the file is placed in the admin folder) and I could not find:

"Location: $PHP_SELF"

in that file, instead I found:

header("Location: $target");

I replaced the latter with the code :

print '<head><meta http-equiv="refresh" content="0;URL=index.php"></head><body></body>'; exit();

But the hack did not work. Instead a dialogue box poped up with the heading:

inetinfo.exe - Application error

The exception unknown software exception (0xc00000fd) occured in the application at location 0x65f068f6

I guess I'm getting this message cuz the IIS hack is not in place. Can anyone help me with this?
Thanks
Yash.
yo
Re: Phorum-Install on Win32/IIS (repost)
April 22, 2004 12:39AM
finally a good description...but i get one problem when i try to start the service mysql i get this "error 1067: The Process Terminated Unexpectedly"
my.cnf
April 25, 2004 01:01AM
go to your mysql installation folder, open any of the "my-small" files with a text editor, un comment this lines:
#basedir = e:/mysql/
#datadir = e:/mysql/data/

by removing the #. Then save as my.cnf in c:\

so finally you will have c:\my.cnf with the file modified. Now restart IIS and start mysql. it should work now.
Sorry, you do not have permission to post/reply in this forum.