Below are the prerequisites for running CSWeb on an IIS server.
Copy the root directory of your project to <Drive>:\inetpub\wwwroot. The result may look like C:\inetpub\wwwroot\csweb.
You will find the below directories in your document root. Their permissions will need to be updated as shown.
- files: Read and Write
- logs: Read and Write
- var: Read and Write
- src\api\app: Read and Write
- src\ui\src: Read and Write
Let us use the files directory as an example. Right-click on files and select Properties. Then click the Security tab. Press the Add... button and type IUSR under Enter the names to select. Press the Check Names button and confirm your changes. Select the user name you just added, IUSR, then update the permissions under Permissions for IUSR so that Read and Write are allowed. Now repeat this process for logs, var, src\api\app, and src\ui\src setting the correct permissions.
Do not forget to start the server. If you installed MySQL Server as a service you can start it by doing the following:
- Win + R
- Run services.msc
- Right-click on MySQLXX
Alternatively, if you did not install MySQL server as a service or have a web development environment like WampServer installed, you can start MySQL Server from the command line. You will need to open a command prompt and change directory to the directory that contains mysqld.exe
Next, you can use MySQL Monitor to add a database. Connect to MySQL Server. You will need to open a command prompt and change directory to the directory that contains mysql.exe.
Now, add the database.
> create database <name-of-your-database>;
As an example, I have named my database cspro.
To verify our work, we can list the databases.
If you would prefer not to use the command line we recommend MySQL Workbench
If IIS is installed you will find the Internet Information Services (IIS) Manager shortcut under Administrative Tools in the Control Panel. Double click the shortcut to launch the IIS Manager. In the Connections tree on the left-hand side expand Sites and select Default Web Site. You will see your document root below this. On the right-hand side there is an Actions panel. Under Manage Website click Start.
Open a browser and in our case navigate to localhost/csweb/setup
. The setup script will first check to make sure your server meets the prerequisites. If your server does not pass, refer to the Minimum Server Requirements
. Update your server and run the script again. If your server passed the script will ask for the last few configuration details.
- Database name: the name of the database you created earlier.
- Hostname: this will typically be localhost.
- Database username: by default this will be root. This is created during the installation of the MySQL Server.
- Database password: by default this may be is blank. Using the default password is a security issue. This is set during the installation of the MySQL Server.
- CSWeb admin password: create a password to pair with the default user admin to log into the web app.
Now verify the final two fields.
- Path to files directory: for this setup, C:\inetpub\wwwroot\csweb\files
- CSWeb API URL: for this setup, http://localhost/csweb/api
If everything is correct you will hit next and receive the "Setup Complete!" message. From here log in using admin
as the username and the CSWeb admin password
you just created. Once you have run the setup script you will not
be able to run it again unless you delete src\api\app\config.php