How To Install on Windows as a Service

From Sit
Jump to: navigation, search

Contents

Required Prerequisits

A computer with Windows 2000 and up. It has not been tested if the Workstation (HOME and Professional) versions can handle more connections using apache than the Server versions do, but it's useful for testing purposes.

Download.png Download the following

7-Zip For unpacking SiT.

MySQL The database server. Recommended is the latest 5.1 version.

MySQL GUI Tools Utilities to manage your MySQL server.

Windows IIS Webserver OR Apache webserver Apache webserver is a good choice since PHP can be a pain to setup on IIS. Recommended is the latest 2.2 version.

PHP Recommended is the latest 5.2 version (Zip package only).

SiT from Sourceforge The reason why you are here, download the latest release.

Recommended Prerequisits

Download.png Download the following

Firefox Fast and secure webbrowser, SiT is best viewed with this.

Notepad++ A nice advanced notepad editor with code highlights and macro capability.

Installations

Make sure your Windows installation is fully updated with the latest patches and servicepacks.

The installation of the programs are pretty straight forward Recommended installation order is.

  1. 7-Zip
  2. MySQL Server
  3. MySQL GUI Tools
  4. Apache or IIS
  5. PHP*
  6. SiT

Step 1

Install 7-Zip with the default options (just click next until the installation is done)

Step 2


Install MySQL server with Typical Settings

When the Wizard is complete, you'll have two checkboxes:

  • Configure the MySQL Server now -- Check this one
  • Register the MySQL Server Now -- This is optional, uf you are unsure, remove the checkmark.

On the MySQL Server Instance Configuration Screen, choose:

  • Standard Configuration

MySQL Server Instance Configuration - page 2:

  • Install as Windows Service -- Check this one
    • Service name: Leave as default "MySQL"
    • Launch the MySQL Server automatically -- Check this one
  • Include Bin Directory in Windows PATH -- Optional. If you are in doubt, Check this one.

MySQL Server Instance Configuration - page 3:

  • Modify Security Settings -- Check this one
    • Current root password: -- Leave blank
    • New root password: -- Your new MySQL Root password
    • Confirm: -- Your new MySQL Root password
    • Enable root access from the remote machines -- Leave unchecked
  • Create an Anonymous Accounr -- Leave unchecked

Click EXECUTE in the last screen. MySQL is now installed and ready.


Step 3

Install MySQL GUI Tools with default options (just click next until the installation is done)


Apache webserver

Step 4

If you want to use IIS rather than Apache skip to IIS Webserver

  1. Run the downloaded executeable Apache file
  2. If a security warning pops up, click Run
  3. Click next on the introduction screen
  4. Accept the License agreement if you agree with them, and click next
  5. Click next on the Read this first page
  6. Choose the default settings on the Server information page (change the administrators email to a valid one if neccessary)
  7. Choose Typical and click next
  8. Click next without changing the destination folder (if you change this, remember where you put it, when following the rest of this guide)
  9. Click Install to begin installation

Congraulations, you've now installed Apache for windows.


Step 4.1


Install PHP

Change the default installation folder to C:\PHP

Choose Apache 2.2 Module (if it was the Apache 2.2 version you installed)

Point to the conf folder of where you installed Apache. The default location for the conf folder is : C:\Program Files\Apache Software Foundation\Apache2.2\conf

Make sure the following PHP extensions are added:

  • MySQL
  • zip
  • IMAP
  • LDAP
  • MB String
Setting up php.ini

php.ini

Recommended and required settings for the php.ini file is listed below, most require only to have the comment (#) sign removed, but check the settings with your own installation.

  • change the drive and folders to match your installation. If you followed our guides set the settings shown below.
    • include_path = ".;c:\php\includes"
  • Upload maximum filesize takes alot of memory on the server. We don't set too high, but still high enough should someone upload a Screenshot og a large log file. If the 50MB isn't enough for your needs, just edit here and restart the IIS/Apache.
    • upload_max_filesize = 50M
  • Outgoing mail server - Set this to a SMTP server, perhaps your ISP's SMTP server or your own. The windows server has a SMTP server that can be used, but is not covered in this installation guide
    • SMTP = smtp.your_isp_domain.com


  • To remove the "notice" messages that is shown when auto.php is run, find the line in php.ini that says
    • error_reporting = E_ALL
  • and place a semi-colon in the first column, so it'll look like this
    • ;error_reporting = ALL
  • then remove the semi colon from the line
    • ;error_reporting = E_ALL & ~E_NOTICE
  • to make it
    • error_reporting = E_ALL & ~E_NOTICE


  • The location of the extension modules
    • extension_dir = "./ext/"
  • Windows Extensions
    • extension=php_imap.dll
    • extension=php_ldap.dll
    • extension=php_mbstring.dll
    • extension=php_mysql.dll

The Extensions: Session, zlib and PCRE which also are required, are integrated in the windows version of PHP

Step 4.2

Install SiT on Apache

Unpack the SiT file with 7Zip put the contents (starting with all the files and folders where the index.php file is located) into the htdocs folder of the apache installation. The default location for the htdocs folder is : C:\Program Files\Apache Software Foundation\Apache2.2\htdocs

IIS Webserver

Step 4

  1. Start the Manage Your Server.
  2. Choose Add or remove a role.
  3. Make sure you have your Windows 2003 Installation CD ready, click Next.
  4. Choose the Application server (IIS, ASP.NET) and click next
  5. Choose the default settings through the rest of the installation procedure.
  6. If the server needs a reboot, do this now.

Step 4.1

Install PHP

Download the PHP Zip package for Windows (not the Windows Installer).

And extract the contents to C:\PHP (php.exe must reside inside the root of the C:\PHP folder)

Copy the C:\PHP\php.ini-dist to C:\PHP\php.ini and edit it with notepad or a similar program (not word, wordpad or other wordprocessors), I prefer Notepad++

php.ini

Recommended and required settings for the php.ini file is listed below, most require only to have the comment (#) sign removed, but check the settings with your own installation.

  • change the drive and folders to match your installation. If you followed our guides set the settings shown below.
    • include_path = ".;c:\php\includes"
  • Upload maximum filesize takes alot of memory on the server. We don't set too high, but still high enough should someone upload a Screenshot og a large log file. If the 50MB isn't enough for your needs, just edit here and restart the IIS/Apache.
    • upload_max_filesize = 50M
  • Outgoing mail server - Set this to a SMTP server, perhaps your ISP's SMTP server or your own. The windows server has a SMTP server that can be used, but is not covered in this installation guide
    • SMTP = smtp.your_isp_domain.com


  • To remove the "notice" messages that is shown when auto.php is run, find the line in php.ini that says
    • error_reporting = E_ALL
  • and place a semi-colon in the first column, so it'll look like this
    • ;error_reporting = ALL
  • then remove the semi colon from the line
    • ;error_reporting = E_ALL & ~E_NOTICE
  • to make it
    • error_reporting = E_ALL & ~E_NOTICE


  • The location of the extension modules
    • extension_dir = "./ext/"
  • Windows Extensions
    • extension=php_imap.dll
    • extension=php_ldap.dll
    • extension=php_mbstring.dll
    • extension=php_mysql.dll

The Extensions: Session, zlib and PCRE which also are required, are integrated in the windows version of PHP

Configuring IIS with PHP

Open up the Internet Information Services (IIS) Manager Open the Web Sites folder and find the website you have configured for SiT. Rightclick on this Website and click on Properties

Click on the Home Directory as shown below.

Php-iis6-1.png


Click on Configuration.

Php-iis6-2.png


Click Add... in the Application extensions frame.

Php-iis6-3.png


In the textfield Extension: type in .php, then click on Browse....

Php-iis6-4.png


Click the php5isapi.dll file in you PHP folder and click the Open button. The full file path is C:\PHP\php5isapi.dll if you've followed our guides.

Php-iis6-5.png


Click OK a few times to get to the main IIS manager window again

  • For IIS6 (IIS5 users don't have this extra security option)

In the IIS manager click on the Web Service Extension.

Php-iis6-6.png


Click on a random Webservice Extension to get the Tasts menu up. Click Add a new Web Service extension...

Php-iis6-7.png


Type in a name for the Extension we are going to add, perferable PHP 5 ISAPI, Check the Set extension status Allowed and then click the Add.. button.

Php-iis6-8.png


Click Browse to start looking for the php5isapi.dll file.

Php-iis6-9.png


Click the php5isapi.dll file in you PHP folder and click the Open button. The full file path is C:\PHP\php5isapi.dll if you've followed our guides.

Php-iis6-5.png


Click OK a few times to get to the main IIS manager window again. Close the IIS manager window.

Start up the Services program by clicking on Start --> Run... Type in services.msc and click on OK. Find the service named World Wide Web Publishing Service Right click on this one and select Restart

WARNING: If you are a typical windows user and know how to use IIS, don't use the restart iis from within the IIS manager on this one. It tends to discard what you've just done.


Step 4.2

Setting up php.ini

php.ini

Recommended and required settings for the php.ini file is listed below, most require only to have the comment (#) sign removed, but check the settings with your own installation.

  • change the drive and folders to match your installation. If you followed our guides set the settings shown below.
    • include_path = ".;c:\php\includes"
  • Upload maximum filesize takes alot of memory on the server. We don't set too high, but still high enough should someone upload a Screenshot og a large log file. If the 50MB isn't enough for your needs, just edit here and restart the IIS/Apache.
    • upload_max_filesize = 50M
  • Outgoing mail server - Set this to a SMTP server, perhaps your ISP's SMTP server or your own. The windows server has a SMTP server that can be used, but is not covered in this installation guide
    • SMTP = smtp.your_isp_domain.com


  • To remove the "notice" messages that is shown when auto.php is run, find the line in php.ini that says
    • error_reporting = E_ALL
  • and place a semi-colon in the first column, so it'll look like this
    • ;error_reporting = ALL
  • then remove the semi colon from the line
    • ;error_reporting = E_ALL & ~E_NOTICE
  • to make it
    • error_reporting = E_ALL & ~E_NOTICE


  • The location of the extension modules
    • extension_dir = "./ext/"
  • Windows Extensions
    • extension=php_imap.dll
    • extension=php_ldap.dll
    • extension=php_mbstring.dll
    • extension=php_mysql.dll

The Extensions: Session, zlib and PCRE which also are required, are integrated in the windows version of PHP

Install SiT on IIS

Unpack the SiT file with 7Zip put the contents (starting with all the files and folders where the index.php file is located) into the wwwroot folder of the IIS installation. The default location for the wwwroot folder is : C:\inetpub\wwwroot


Step 5

Install MySQL Gui

Add the database and user with MySQL GUI Tools

Start the program MySQL Administrator, and login to localhost with root as username, and your password you configured ealier.

Mysql-gui-1.PNG


First you need to create the database, click on Catalogs, rightclick in the lower left bottom window (schemadata), and click Create New Schema.

Mysql-gui-2.PNG


Type into the field, the name of the SiT database. We recommend you use sit.

Mysql-gui-3.PNG


Next you need to create a user, so click on User administration, and click on the Button Add new user as shown with the red circle.

Mysql-gui-4.PNG


  • Type in the username you need to connect from SiT (recommended to use sit as username)
  • Type in a password, and confirm it.
  • Click the Apply changes button.
Mysql-gui-5.PNG


  • Under Schemata, click on the sit database.
  • Click on the << button to grant all privileges of the user to the selected database.
Mysql-gui-6.PNG


  • Click Apply changes
  • You can now close the MySQL Administrator
Mysql-gui-7.PNG


Step 6

Setup Scheduler

Configuring the auto.php with Windows Scheduler

Start up Scheduler from the Control Panel.

Double click on the Add Scheduled Task

Fig. Scheduler 1.


Just click next on the Scheduler wizard introduction page.

Fig. Scheduler 2.


Choose a program to add to the scheduled task. Since PHP isn't in the list, click on Browse...

Fig. Scheduler 3.


Navigate into C:\PHP, click on php.exe and click on Open

Fig. Scheduler 4.


Type in an appropriate name for the scheduled task, click on Daily, actually any will do since we are going to change this later. Click Next

Fig. Scheduler 5.


We are going to change these aswell later, just click Next

Fig. Scheduler 6.


Type in the username and password, for which this task is going to run.

Fig. Scheduler 12.


Check the Open avanced properties... checkbox, and click Finish

Fig. Scheduler 7.


  • For the Apache installation add the following text in the fields (remember the double quotes):
    • Run: C:\php\php.exe "C:\Program Files\Apache Software Foundation\htdocs\auto.php".
    • Start in: "C:\Program Files\Apache Software Foundation\htdocs\".
Fig. Scheduler 8-Apache.


  • For the IIS installation add the following text in the fields:
    • Run: C:\php\php.exe C:\InetPub\wwwroot\auto.php.
    • Start in: C:\InetPub\wwwroot\.
Fig. Scheduler 8-IIS.


  • Click the Apply button.
  • Click Schedule and then
  • Click the Advanced button
Fig. Scheduler 9.


  • Check the Repeat task checkbox
  • Set it to repeat to a repeatable time of your choice, the auto.php triggers a download of mails, activates triggers and is SiT's own scheduler. Recommended is every minute. If you are in doubt, set to 1 minute.
  • Click OK a few times to finish editing the scheduled task.
Fig. Scheduler 10.


In the main screen, validate that the schedule is set acordingly to your choice.

Fig. Scheduler 11.


Step 7

Setup SMTP Server

Configuring the SMTP server on Windows

This step is not necessary if you setup php.ini to send mails to your ISP's SMTP server

The installation of SMTP Server is quite easy, and I'll not go into much details on doing this, but you'll finde it in Add/Remove programs & Windows Components. If you have Exchange server installed in your domain, you can use this server as your SMTP server, this guide should be the same.

First you need to open "Internet Informations Services (IIS) Manager", you do that from within Administrative Tools from the start menu.

Now locate the SMTP server, it should be named "Default SMTP Virtual Server"

Right-click on the "Default SMTP Virtual Server" and select Properties

Fig. 1 - Properties

We need to setup that the SiT server can send emails through this SMTP server

  • Click on the Access pane, and click on the Relay...
Fig. 2 - Access/Relay

On the Relay Restrictions page make sure

  • Only the list below is checked

Click the Add.. button

Fig. 3 - Relay

Now you have a choice if you want to add a single computer or a whole network.

  • Single computer would be my prefered choice
    • You need to add the IP address of the computer running SiT, and click OK to finish
Fig. 4 - Add Relay computer

This is an example of a whole network, this is NOT prefered unless you know what you are doing, and why

Fig. 5 - Add Relay network

Now, depending on your choice you should now have added an IP address (My example shows the network). Click OK to accept the changes.

Fig. 6 - Relay

For a delivery to your ISP's SMTP server using smarthost do the following, otherwise you can just close all windows and exit the IIS manager if you don't need it anymore.

  • Go to the Delivery pane and click on the Advanced Button
Fig. 7 - Delivery

In the Smart host field type in the hostname of your ISP's SMTP server, this hostname is the same as you would have configured your email client to. Click OK to accept the changes. You can now close the IIS manager if you don't need it

Fig. 8 - Smart host

(Don't forget to configure your php.ini file, edit the Windows SMTP settings and put in the IP address or hostname of this new SMTP server)

Installing SiT!

Start your web browser and install SiT!

Personal tools
project