======Install EgoWeb 2.0======
======Installation Overview====== 
EgoWeb 2.0 has been optimized for running on a web server and providing access to authoring and administering social network data collection interviews over the web, but it can also be installed on stand-alone machines and run locally through web browsers without use of the internet. Below are instructions for the various types of installations. 

//NOTE:// The Linux instructions below assume a web server and the Windows and Mac instructions assume local installation, but the Linux instructions apply to a local installation and EgoWeb 2.0 can also be run on a Windows or Mac based web server. 

======Desktop and Laptop Installations====== 

Although EgoWeb 2.0 was designed to be installed and run on a web server broadcasting over the internet, it can also be installed onto a single machine and run as a local server only. Stand-alone Linux machines can run the instructions above. Windows and Mac machine installation instructions are below. This installation will not allow use of some of the features that require the internet, such as sending links to respondents to fill out EgoWeb 2.0 surveys or for using EgoWeb 2.0 mobile.
-----

====Install EgoWeb 2.0 on a Windows machine==== 

UPDATE FROM DAVE K 9 NOV 18: Newer versions of WAMP are no longer working with EgoWeb so we are switching to AMPPS.  There are some beneifts to this.  The instructions are easier for AMPPS and they are nearly identical for Macs and Windows machines.  

Before starting to install the programs that need to run to use EgoWeb, go to www.github.com and download the latest zip file from the EgoWeb 2.0 Github repository [[https://github.com/qualintitative/egoweb/tree/dev|located here]] and extract its contents onto the desktop.  Unzip the file somewhere you can access it later. The link is to the "dev" branch of EgoWeb 2.0. There is a "Master" branch as well as a "dev" branch. Currently "dev" has much more updated code and is close to being made the master branch, but testing for a few new features and bug fixes is in progress. There are known bugs in the master branch that will be fixed once we update from dev, so we recommend using dev for now.  The master branch cannot be installed with newer versions of PHP because we had to change the encryption library which was no longer supported.  

**1) Install AMPPS**

  * Download AMPPS. You can get different versions at the [[https://www.ampps.com/downloads|AMPPS download page]]).   Install by running the .exe installer file and accepting the defaults.  When testing this, we also ran the C++ Redistributable Visual Studio installation that was an option by clicking "Yes" when the dialog box came up during installation.   If you have a firewall program running, you may also be prompted to grant permission to MySQL, which you should allow.

**2) Configure  AMPPS**

  * If it is not already running after installation, start the AMPPS app.  It will be located somewhere on  your local hard drive where program files are stored (e.g. C:\Program Files\Ampps or C:\Program Files (x86)\Ampps).  AMPPS will start the Apache and mySQL servers as the application boots up, and you should see both of them marked as "running" in the AMPPS app.

****NOTE****: If Apache is not running when you start AMPPS and if it does not start when you click "ON", you may have Apache already running with some other program.  It is typically turned off by default but if you have installed some other program that runs Apache, it might be running and needs to be shut down in order to run it through AMPPS.  

**3) Create default Egoweb database**

  * Open a browser and go to "http://localhost/phpmyadmin. 

  * In the PHPMyAdmin browser window, click on "Databases". Under "Create database", put in "egoweb" for the database name (all lowercase) and select "utf8mb4_unicode_ci" for the collation.  (We have previously recommended utf8_general_ci for fast performance,  but that may have issues with special characters).
  * Click create. A new database named "egoweb" should appear in the left sidebar.

** 4) Import database structure from SQL file**

  * In the phpMyAdmin browser window, click on the new database "egoweb" that you just created on the left hand side of the page. When the egoweb database structure appears in the middle of the page, select "Import" from the top navigation bar.
  * Under "File to Import:" you will browse your computer to find a file to import. Click on the "Choose File" button in the section under "File to import". Navigate to the egoweb folder you extracted from the .zip file downloaded from github. Find the "sql" folder, open it, you will see "egoweb_db.sql". Select this file and click OK.
  * After the file is selected (you will see "egoweb_db.sql" next to the "Choose File" button), click on "Go" at the bottom of the page. The EgoWeb database will now be populated with all of the tables needed to run EgoWeb on your Windows machine.

**5) Add user privileges to egoweb database**

  * At the top menu of the phpMyAdmin page, click on the "Privileges" menu option. Click on the "Add User" link. The default username is "egowebuser" and the default password is "egowebpass".
  * //NOTE:// If setting up a production server that is not broadcasting / facing externally (if you are not just using your Mac to run EgoWeb -- e.g. if you are running it over a network and others will have access to the installation on a server) please replace egowebpass with a password of your choice. If you change this value you will need to change the corresponding value in the "main.php" config file.
  * Select "Local" for the host field.
  * Click on "Go" at the bottom of the page.

**6) Install the EgoWeb PHP files into the AMPPS www directory**

Go to the folder "/Program Files/AMPPS/www". It is located inside the same folder where the AMPPS.exe file is located.

  * Open the folder created when you extracted the egoweb .zip file from github in another Finder Window. Open the folder "app" within that folder.
  * Copy all of the contents of the "app" folder (not the folder itself) into the "www" folder.
  * There should now be a file named "index.php" in the folder "/Applications/AMPPS/www".

**7) Configure egoweb**
  * In the www folder ("/Applications/AMPPS/www/"), create a new folder called "assets".
  * Open the folder "protected" within "www" (“/Applications/AMPPS/www/protected/"). Create a new folder named "runtime".
  * In the folder "config" within the "protected" folder (“/Applications/AMPPS/www/protected/config/"), rename the file "main.php.example" to "main.php". You will be asked if you really want to change the extension in a dialog box. Confirm that you do want to change from .example to .php.
  * //NOTE:// If you changed the default database password (in step 5 above), you will need to edit "main.php" and change the corresponding values under the "db" section.

**8) Start EgoWeb 2.0**

Open a browser and go to "http://localhost" to start using EgoWeb 2.0. You will be prompted to create an admin user. After creating the user, you can log in to EgoWeb 2.0 with the user’s email and password.
-----

===Update an EgoWeb 2.0 installation on a Windows Machine=== 

1) Repeat steps from the main installation instructions starting with 6 (copy files from the .zip file app folder into the www folder).

2) Type the following into a browser address and hit enter:

> localhost/admin/migrate

If there are database changes, these will be migrated into the existing data base and EgoWeb 2.0 will be fully updated. If there are no changes that need to be migrated, running this will confirm that your system is up to date.
-----


====Install EgoWeb 2.0 on a Mac OS machine==== 

****** NOTE FROM DAVE K: 04/04/20 AMPPS was updated for 64 bit, so it now works for Mac OS Catalina. I tested the installation and nothing changed as far as I could tell from the previous instructions. I updated them to make them more clear.  ******

Before you begin installation, get the latest EgoWeb 2.0 files from github.  As of 4/4/20 the dev branch is the best branch because it has all the latest files for newer versions of PHP. [[https://github.com/qualintitative/egoweb/tree/dev]]. Download the latest zip file and extract its contents somewhere on your desktop where yo will be able to find them in the next steps. 

**1) Install AMPPS**

  * Download AMPPS. You can get different versions at the AMPPS download page [[https://ampps.com/download]]). Install by opening the DMG file and dragging AMPPS to the Applications folder. You should be given a graphical prompt to do this after downloading. 

**2) Configure  AMPPS**

  * Launch the AMPPS app from Applications. Find the AMPPS folder you created when you dragged the .dmg into the Applications folder and click on the AMPPS application file to launch it. AMPPS will start the Apache and mySQL servers as the application boots up, and you should see both of them marked as "running" in the AMPPS app.
  * See NOTE 1 below 


**3) Create default egoweb database**

  * Open a browser and enter "http://localhost/phpmyadmin" into the location bar (or just "localhost/phpmyadmin" will work). 

  * In the PHPMyAdmin browser window, click on "Databases". Under "Create database", put in "egoweb" for the database name (all lowercase) and scroll almost all the way down the list to select "utf8mb4_unicode_ci" for the collation.  (We have previously recommended utf8_general_ci for fast performance,  but that may have issues with special characters).
  * Click create. A new database named "egoweb" should appear in the left sidebar.

** 4) Import database structure from SQL file**

  * In the phpMyAdmin browser window, click on the new database "egoweb" that you just created on the left hand side of the page. When the egoweb database structure appears in the middle of the page, select "Import" from the top navigation bar.
  * Under "File to Import:" you will browse your computer to the folder where you saved the EgoWeb 2.0 files from github. Click on the "Choose File" button in the section under "File to import". Navigate to the egoweb folder you extracted from the .zip file downloaded from github. Find the "sql" folder, open it, you will see "egoweb_db.sql". Select this file and click OK.
  * After the file is selected (you will see "egoweb_db.sql" next to the "Choose File" button), click on "Go" at the bottom of the page. The EgoWeb database will now be populated with all of the tables needed to run EgoWeb on your Mac.

**5) Add user privileges to egoweb database**

  * At the top menu of the phpMyAdmin page, click on the "Privileges" menu option. Click on the "Add User" link. 
  * Enter the default username: "egowebuser". 
  * Select "Local" for the host field.
  * Enter the default password: "egowebpass".
  * (See Note 2 below for setting up a localhost with something other than the default username and password.)  
  * Click on "Go" at the bottom of the page.

**6) Turn on Show Hidden Files for Finder**

This step is necessary to copy the hidden file .htaccess, which is necessary for Apache to set the configurations for EgoWeb 2.0.

  * Open up a terminal by going into the Application Launcher and typing in "Terminal". If you are running OS X Mavericks/Yosemite/or later, run the following command (you can copy and paste the text into a terminal session and hit "enter":


> defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

(Note 3 below has alternative terminal command)

**7) Install the EgoWeb PHP files into the AMPPS www directory**

Go to the folder "/Applications/AMPPS/www". It is located inside the AMPPS app in the application folder.

  * Open the folder created when you extracted the egoweb .zip file from github in another Finder Window. Open the folder "app" within that folder.
  * Copy all of the contents of the "app" folder (not the folder itself) into the "www" folder.
  * There should now be a file named "index.php" in the folder "/Applications/AMPPS/www".

**8) Configure egoweb**
  * In the www folder ("/Applications/AMPPS/www/"), create a new folder called "assets".
  * Open the folder "protected" within "www" (“/Applications/AMPPS/www/protected/"). Create a new folder named "runtime".
  * In the folder "config" within the "protected" folder (“/Applications/AMPPS/www/protected/config/"), rename the file "main.php.example" to "main.php". You will be asked if you really want to change the extension in a dialog box. Confirm that you do want to change from .example to .php.

**9) Start EgoWeb 2.0**

Open a browser and go to "http://localhost" to start using EgoWeb 2.0. You will be prompted to create an admin user. After creating the user, you can log in to EgoWeb 2.0 with the user’s email and password.

****NOTE1****: If Apache is not running when you start AMPPS and if it does not start when you click "ON", you may have Apache already running.  It is typically turned off by default but if you have installed MAMP or some other program that runs Apache, it might be running and needs to be shut down in order to run it through AMPPS.  

In order to turn Apache off, you will need to run some commands in the "terminal" app on your Mac. Open up a terminal by going into the Application Launcher and typing in "Terminal". If you enter a password to access your Mac, you will need to enter the same password to use Terminal. Copy and paste the lines below and hit "enter" after each line. (I found these commands [[https://www.softaculous.com/board/index.php?tid=13586&title=AMPPS_3.8_Apache_not_starting_on_MAC_OS_High_Sierra|on a Q&A message board]]):

  * sudo apachectl -k stop
  * sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 
 
After running these you should be able to click Apache "On" in the AMPPS application.  


****NOTE2****: If setting up a production server that is not broadcasting / facing externally (if you are not just using your Mac to run EgoWeb -- e.g. if you are running it over a network and others will have access to the installation on a server) please replace egowebpass with a password of your choice. If you change this value you will need to change the corresponding value in the "main.php" config file under the "db" section. 


****NOTE3****: 
  * If you're running OS X 10.8 or below, run the following command instead:

> defaults write com.apple.finder AppleShowAllFiles TRUE ; killall Finder

-----

===Update an EgoWeb 2.0 installation on a Mac OS Machine=== 

1) Repeat steps from the main installation instructions starting with 7 (copy files from the .zip file app folder into the www folder).

2) Type the following into a browser address and hit enter:

> localhost/admin/migrate

If there are database changes, these will be migrated into the existing data base and EgoWeb 2.0 will be fully updated. If there are no changes that need to be migrated, running this will confirm that your system is up to date.
-----
====Install EgoWeb 2.0 on an existing Linux server==== 

These are instructions for a machine running Ubuntu 14.10 with the latest Ubuntu / Debian repositories. Open up a terminal on your server and execute the commands listed below.\\ 
**1) Install LAMP Server**
> sudo apt-get update
> sudo apt-get install lamp-server^ git
When prompted whether or not to install, hit 'y' and press enter. Remember the root password you enter when installing the MySQL server. You will need this password later.

**2) Configure Apache**
> sudo nano /etc/apache2/apache2.conf
Under <Directory /var/www/>, change AllowOverride None to AllowOverride All Ctrl + X and type Y to save.

**3) Enable the Apache rewrite and PHP Mcrypt modules**
> a2enmod rewrite 
> php5enmod mcrypt 
> service apache2 restart

**4) Install the EgoWeb PHP files into the Apache www directory**
> git clone [[https://github.com/qualintitative/egoweb]]
> rm -rf /var/www/*
> cp -r egoweb/app/. /var/www/html/

**5) Configure MySQL Database**
> mysql -p
> CREATE DATABASE egoweb DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
> USE egoweb
> SOURCE ~/egoweb/sql/egoweb_db.sql

**For production servers, please replace //egowebpass// in the command below with a password of your choice. If egoweb is the only database you're setting up in MySQL, you may re-use the root password from Step 1. Otherwise, please use a different password.**
> CREATE USER 'egowebuser'@'localhost' IDENTIFIED BY 'egowebpass';
> GRANT ALL PRIVILEGES ON egoweb.* TO 'egowebuser'@'localhost';
> quit

**6) Configure Yii by running initialize.sh**
> cd /var/www/html
>./initialize.sh

**For production servers, you will need to edit /var/www/html/protected/config/main.php. Replace //egowebpass// in the database connection string with the password you used in Step 4. For additional security, you may change the encryption key near the bottom of the configuration file.**

**7) Start EgoWeb 2.0**

Open a browser and go to "http://localhost" (Or replace localhost with your IP) to start using EgoWeb 2.0. You will be prompted to create an admin user with a name, email (which will be used as a username for logging in), and password. **Please note that this is different from the database username and password which allows EgoWeb 2.0 to connect to the MySQL database. You may want to use a different password than the one used in Step 4.** After creating the user, you can log in to EgoWeb 2.0 with the user’s email and password.
-----
===Update an EgoWeb 2.0 installation on a Linux server=== 

This set of instructions assumes you followed the Linux setup instructions on this wiki to install EgoWeb 2.0 initially, and that there is a copy of egoweb in the ~/ folder.  (You may need to install rsync if not installed already with the following command: > apt-get install rsync)

After logging in, type these following commands:

> cd egoweb
> git pull
> cd ..
> rsync -avz egoweb/app/ /var/www/html/

After these commands are successfully run, open a browser and log in to the version of EgoWeb 2.0 just updated. Go to the following URL extension of the EgoWeb 2.0 URL that is being updated:

> ~admin/migrate

If there are database changes, these will be migrated into the existing data base and EgoWeb 2.0 will be fully updated.
-----
===Update a Linux server to a different EgoWeb 2.0 branch=== 

Run this set of commands if you want to switch your webpage to a different EgoWeb 2.0 branch. The final 5 lines are the same as the final 5 lines above.  (You may need to install rsync if not already installed with the following command: > apt-get install rsync)

> cd -
> cd egoweb
> git checkout {branch name}
> git pull
> cd ..
> rsync -avz egoweb/app/ /var/www/html/

And then run the same migrate command to update the data base if necessary:

> ~/admin/migrate

-----
====Creating a new Linux server with www.linode.com==== 

The script below is available in the [[http://www.linode.com|www.linode.com]] stack script library. This [[https://www.linode.com/docs/platform/stackscripts|StackScript]] installs EgoWeb 2.0 and all software required to run on Linode. Most of the code should work on other systems. The Current Distribution is set to Ubuntu 14.04 LTS.

> #!/bin/bash
> set -e
> # <UDF name="db_password" Label="MySQL root Password" />
> DB_NAME="egoweb"
> DB_USER="egowebuser"
> DB_USER_PASSWORD="egowebpass"
> echo "db_name is $DB_NAME"
> echo "db_user is $DB_USER"
> echo "db_user_password is $DB_USER_PASSWORD"
> source <ssinclude StackScriptID="1">
> system_update
> postfix_install_loopback_only
> mysql_install "$DB_PASSWORD" && mysql_tune 40
> mysql_create_database "$DB_PASSWORD" "$DB_NAME"
> mysql_create_user "$DB_PASSWORD" "$DB_USER" "$DB_USER_PASSWORD"
> mysql_grant_user "$DB_PASSWORD" "$DB_USER" "$DB_NAME"
> php_install_with_apache && php_tune
> apache_install && apache_tune 40
> goodstuff
> a2enmod rewrite
> sudo apt-get install -y php5-mcrypt
> sudo php5enmod mcrypt
> sudo apt-get install -y git
> echo 'CLONING EGOWEB FROM GIT'
> git clone https://github.com/qualintitative/egoweb
> echo 'REMOVING DEFAULT WEB FILES'
> sudo rm -rf /var/www/*
> echo 'ADDING EGOWEB FILES TO WEB DIRECTORY'
> sudo cp -r egoweb/app/. /var/www/html/
> echo 'SETTING UP TABLES IN MYSQL FOR EGOWEB - USE SQL FILE AS SOURCE'
> echo "SOURCE /egoweb/sql/egoweb_db.sql" | mysql egoweb -u root -p$DB_PASSWORD
> ELINENOF=$(grep -n '/var/www/' /etc/apache2/apache2.conf |cut -f1 -d:)
> echo "lineno is $ELINENOF"
> <nowiki>ELINENO=$(($ELINENOF + 2))</nowiki>
> echo "lineno is $ELINENO"
> echo "$ELINENO s/None/All/"
> sed -i -e "$ELINENO s/None/All/" /etc/apache2/apache2.conf
> restartServices
> cd /var/www/html
>./initialize.sh
-----

====Other Important Information==== 

==How to reset the administrative password== 

If attempts to login with any administrative passwords fail, access can be regained to an EgoWeb 2.0 installation by deleting all entries in the "user" table. If this table is blank when a user attempts to open an EgoWeb instance, the user is immediately prompted to create an administrative account name and password. Deleting entries in the "user" table can be done using MySQL for Linux installations, WAMP for Windows installations, and MAMP for Mac installations.

After re-entry into EgoWeb 2.0, any users that were deleted would have to be re-created using the new administrator account.

| {{ :11_reinitiateadmin.png |}} |

| {{ :12_reinitiateadmin2.png |}} |

| {{ :13_reinitiateadmin3.png |}} |

| {{ :14_reinitiateadmin4.png |}} |

| {{ :15_reinitiateadmin5.png |}} |

==What to do if the page is not loading properly== 

If EgoWeb 2.0 code has changed, browsers may still load old versions of pages because they are storing page data in the cache. Sometimes there is a mixture of old and new page code, which can cause the page to appear broken in different ways. 

To remedy this problem, [[http://refreshyourcache.com/en/cache/|do a hard browser refresh]], which clears the browser’s cache for that page and forces the browser to load the current page code. Browsers hang onto old code so that they do not have to load everything each time you visit the same page, but it sometimes hangs onto too much. 

Doing a hard refresh depends on the browser and the operating system. For Windows and Chrome, hold down the “ctrl” key and click the browser refresh (or F5) and this should make the menu bar load properly. For Mac, do the same but instead of "ctrl" hold down "shift". 

[[https://wiki.scratch.mit.edu/wiki/Help:Hard_Refresh|See this page about clearing the cache for other options.]]

====OLD WAMP Instructions====

**1) Download EgoWeb files**

The first step for running EgoWeb 2.0 on a laptop or desktop computer **(for use without an active connection to the internet)** is to download all of the program files onto the machine you are using. Download the latest zip file from [[https://github.com/qualintitative/egoweb]] and extract its contents onto the Desktop. There is a "Master" branch as well as a "dev" branch. Dev has more updated code by testing is in progress.

| {{ :1_downloadfromgit.png |}} |

**2) Download and install supporting programs: Visual Basic Windows Update**

Because Windows cannot execute PHP scripts, additional software is necessary to run EgoWeb 2.0 on a desktop or laptop running Windows OS. To run EgoWeb 2.0 locally, you will need to install the software WampServer. This will allow a Windows machine to mimic the functions of a web server without broadcasting over the internet. Below are the steps for installing WampServer.

//NOTE:// Some older versions of Windows require installation of a Windows update program called "Visual C++ Redistributable for Visual Studio 2012 Update 4" before moving onto the WampServer software installation procedures described below. If you know that you have this update, you can skip to Step 3. However, it is probably a good idea to install and run the update just to be safe. In some previous attempts to install EgoWeb 2.0 without first installing the update file above, WAMP crashed after install because of a missing *.dll file that caused the WampServer install to break. This required uninstalling WampServer, deleting the remaining WAMP folder and then starting the reinstallation process again after installing the Visual C++ file. Therefore, we recommend installing this first before trying to install WampServer to be sure this does not need to happen.

The file was available for downloading at the link below when these instructions were written (but it's possible the link could change or be moved in the future): https://www.microsoft.com/en-us/download/details.aspx?id=30679

Download and run the file from the link above and follow the default installation steps. If the link above does not work because it has been changed, a current link can be found through an internet search for “Visual C++ Redistributable for Visual Studio 2012 Update 4".

The download page looks like this:
| {{ :2_visualcupdate4.png |}} |

**3) Download and install supporting programs: WampServer (version 2.5)**

Install WampServer by going to the following link and downloading the appropriate version (32 or 64 bit): 
[[https://sourceforge.net/projects/wampserver/files/WampServer%202/Wampserver%202.5/|WAMPSERVER 2.5]].

| {{ :3_wamp25screen.jpg |}} |

//NOTE:// We have examples of users who had installation problems with WAMP 3.0+ and the problem was fixed by using 2.5. Therefore, we recommend 2.5! The main WampServer page with current versions of WAMP is at [[http://www.wampserver.com/en/]] but this will take you to newer versions of WampServer that cause problems. All of the installation instructions are based on WAMP version 2.5, 64-bit, so to avoid problems use this version.

Select default options for the install. Other versions may require slight variations. Therefore, we recommend the 64-bit version if possible.

**4) Start WampServer and services**

If it's not already running after installation, start WampServer from the Windows start menu.

| {{ :4_startmenuwampserver.jpg |}} |

//NOTE:// This required an admin login to run after initial set up.

Locate the WAMP menu in system tray (lower right-hand side of Windows desktop screen). If the icon is not green, you may need to manually install a component. For instance, I had to manually install Apache by going to Apache -> Service -> Install Service, then start it by going to Apache -> Service -> Start Service.

| {{ :5_startwampserver.png |}} |

**5) Edit httpd.conf**

From the WAMP Menu, go to Apache -> httpd.conf. In Notepad, search for the phrase "AllowOverride all" and remove the hash tag character (“#”) immediately preceding it. Save the file.

| {{ :6_apachehttpconfig.png |}} |

| {{ :7_allowoverride.png |}} |

**6) Enable the rewrite module**

From the WAMP menu, make sure Apache -> Apache Modules -> rewrite_module is checked. Clicking on an unchecked module will enable it.

| {{ :8_apachemodules.png |}} |


| {{ :9_rewritemodule.png |}} |


After clicking on rewrite_module, WAMP will reboot. Follow the same steps as above to confirm that the rewrite_module has been checked.

**7) Launch PHPMyAdmin**

Click on the WAMP menu in the system tray, and visit PHPMyAdmin, a PHP Application that allows you to manage the MySQL server in WAMP. A browser should open with PHPMyAdmin loaded. If you are prompted for a password, leave it blank and log in.

**8) Create default egoweb database**

In the PHPMyAdmin browser window, click on "databases." Under "Create database", put in "egoweb" for the database name (all lowercase) and select "utf8mb4_unicode_ci" for the collation.  (We have previously recommended utf8_general_ci for fast performance,  but that may have issues with special characters). Click create. A new database named "egoweb" should appear in the left sidebar.

**9) Import database structure from SQL file**

In the PHPMyAdmin browser window, click on "egoweb", then select "Import" from the top navigation bar. Click on the file input under "File to import". Find "egoweb_db.sql" in the “sql” folder among the extracted files on the desktop. After the file is selected, click on "Go" at the bottom of the page. The egoweb database should now be populated with tables.

**10) Add user privileges to egoweb database**

In the PHPMyAdmin browser window, click on "privileges" in the navigation menu, then click on the "Add User" link. The default username is "egowebuser" and the default password is "egowebpass". **For production servers, please replace //egowebpass// with a password of your choice. if you change this value you will need to change the corresponding value in the "main.php" config file**. Select "Local" for the host field. Click on "Go" at the bottom of the page.

**11) Install the EgoWeb 2.0 PHP files into the WAMP www directory**

  * Open the folder "C:\wamp\www" and delete all of the existing files inside the folder.
  * You can either directly open it up using Windows Explorer by pointing it to "C:\wamp\www" or you can open this window using WAMP menu by selecting "www directory".
  * After deleting these files, locate the the egoweb files that you extracted from the github .zip file you downloaded.
  * Locate the folder "app" among the extracted files on the desktop and copy its contents into "C:\wamp\www". Do not copy the folder itself, copy the files within the folder.
  * There should now be a new "index.php" file in the folder "C:\wamp\www".

**12) Configure EgoWeb 2.0**

  * In the folder "C\wamp\www", create a new folder called "assets".
  * In the folder “C:\wamp\www\protected", create a new folder named "runtime".
  * In the folder “C:\wamp\www\protected\config", rename the file "main.php.example" to "main.php".
  * If you changed the default database password in step 8, you will need to edit this file and change the corresponding values under the "db" section.

**13) Start EgoWeb 2.0**

Open a browser and go to "http://localhost" to start using EgoWeb 2.0. You will be prompted to create an admin user. After creating the user, you can log in to EgoWeb 2.0 with the user’s email and password. Enjoy!

//NOTE:// The initial installation was conducted with an administrator account. A non-admin account could not run wampserver. We attempted to set up wampserver to automatically load at startup without administrative rights but have not figured that out yet. We will update the documentation when we identify reliable procedures.
-----

===Update an EgoWeb 2.0 installation on a Windows machine=== 

1) Repeat steps from the main installation instructions starting with Step 11 (copy files from the .zip file webapp folder into the www folder).

2) Type the following into a browser address and hit enter:

> localhost/admin/migrate

If there are database changes, these will be migrated into the existing data base and EgoWeb 2.0 will be fully updated. If there are no changes that need to be migrated, running this will confirm that your system is up to date.

-----
~~DISCUSSION~~