fuel9 / DisplayMonkey

Display Monkey digital signage solution
Other
126 stars 50 forks source link

Configuration page is invalid #142

Closed r3ptar closed 4 years ago

r3ptar commented 4 years ago

Finally got it running. I want to emphasize that there is nothing wrong with the application. It was a unfamiliarity with IIS and SQL. Here's the guide.

Summary of environment: 0.1. Windows Server 2012 R2 in a Hyper-V VM. 0.2. Microsoft SQL Server 2014 Express. 64-bit version. 0.3. Installed .NET 4.7 0.4. Machine name is KE71DM. Logged in as a local administrator account that is to be associated with the DisplayMonkey instance.

Step 1: Copy Applications 1.1. Unzipped the DM_1.6.1.189-1.zip file to the desktop. 1.2. Copy the folders DisplayMonkey and DisplayMonkey_Management to C:\inetpub\wwwroot. 1.3. Set folder permissions on the copied folders to Everyone = full access. (For testing purposes.)

Step 2: Create Applications 2.1 Launch Internet Information Services (IIS) Manager. 2.2 Under “Connections,” expand KE71DM. Right-click “Application Pools.” Select “Add Application Pool.” Set name = “DisplayMonkey” Set .NET Framework version = v4.0.30319 Set Managed Pipeline mode = Integrated Check “Start application pool immediately” 2.3 In “Application Pools,” right-click the DisplayMonkey pool and select Advanced Settings. Under “Process Model,” select “Identity.” Select the browse button to open the Application Pool Identity dialog. Under “Built-in account,” select “NetworkService.” Click OK. Click OK. 2.4 In the Connections pane of IIS Manager, expand Sites | Default Web Site. Right-click the DisplayMonkey folder and select “Convert to Application.” Under “Application Pool,” select the pool created in Step 2.3. Click OK. Right-click the DisplayMonkey_Management folder and select “Convert to Application.” Under “Application Pool,” select the pool created in Step 2.3. Click OK. 2.5 In the Connections pane of IIS Manager, select the DisplayMonkey_Management application created in step 2.4 In the /DisplayMonkey_Management Home pane, in the IIS section, open the Authentication feature. Set “Anonymous Authentication” to disabled. Set “Windows Authentication” to enabled. Leave “ASP.NET Impersonation” and “Forms Authentication as disabled. The default settings for /DisplayMonkey authentication should be enabled for Anonymous and Forms, and disabled for ASP.NET and Windows.

Step 3: Create Database 3.1 Launch “SQL Server 2014 Management Studio.” (SSMS) 3.2 Log in to SSMS using Windows Authentication. Click Connect. 3.3 In the Object Explorer panel, under the default \SQLEXPRESS instance logged in as the Windows user, right-click “Databases” and select “New Database.” 3.4 Enter “DisplayMonkey” for Database name. Use all other default settings. Click OK. 3.5 Create a new login (not a new “user”). In the Object Explorer panel, under Security| Logins (do NOT select Databases| DisplayMonkey| Security| Users), right-click Logins and select New Login. 3.6 Enter DisplayMonkey for login name. Select SQL Server authentication. Enter a password. Disable the options for Enforce password expiration, Enforce password policy, and User must change password at next login. Set default database to DisplayMonkey (created in step 3.4). 3.7 Select the “User Mapping” page. In the “Users mapped to this login” pane, select the DisplayMonkey account created in step 3.6. In the “Database role membership for DisplayMonkey” pane, check “db_owner.” The “public” option will remain on. Click OK. 3.8 In the unzipped installation folder (step 1.1), locate the SQL folder. In the is a install.sql script. Note: The script is hard-coded to expect the database name to be “DisplayMonkey.” If you have used a different name, change the “use” statement in the first script line to reflect your database name. 3.9 From the SMMS main menu, select File|Open. Navigate to the location of the install.sql file and select it. In SMMS, with the file selected, click “Execute!” 3.10 To install the demo data, use the same process to run the demo_data.sql script.

Step 4: Configure Database Access 4.1 In Windows Explorer, navigate to the root folder of the Display Monkey application directory you created in step 1.2. This would be C:\inetpub\wwwroot\DisplayMonkey if you have used the defaults in this guide. 4.2 Using a text editor, open the file web.config in that folder. 4.3 Change the entry “Data Source=(local)” to the SQL server name and instance where you created the Display Monkey database in step 3.3. The string should be formatted as SERVER\INSTANCE. If you’re using the default instance of SQLEXPRESS on a host named KE71DM, the Data Source string will look like “KE71DM\SQLEXPRESS” without the quotes. Do not lead the server name with \. If the database is on the same machine, use localhost\SQL 4.4 In the same entry, change the entries for User ID and Password to reflect the values you set in step 3.6. 4.5 In the same entry, change the value for “Initial Catalog” to be the name of the database created in step 3.4.

This should allow the application to run. If it doesn’t and the web page displays the error: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list, do the following: It turns out that this is because ASP.Net was not completely installed with IIS. Execute the following command at the command prompt: %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i If I had been on a 32 bit system, it would have looked like the following: %windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe –i

_Originally posted by @rhummel in https://github.com/fuel9/DisplayMonkey/issues/104#issuecomment-477692806_
r3ptar commented 4 years ago

I followed the above instructions to the T and am still getting an invalid xml when trying to browse to the page. I installed sql 2014 express on the server so it's using a local database. This is the error I'm getting with the credentials edited.

 <connectionStrings>
       <add name="DisplayMonkeyDB" connectionString="Data Source=localhost\sql;Initial Catalog=DisplayMonkey;DisplayMonkey&quot;;Persist Security Info=True;User ID=DisplayMonkey;Password=fEyHK&&y6%7U" providerName="System.Data.SqlClient" />
       </connectionStrings>

Is there something I'm missing? I've tried every variation of the sql server\instance name possible and still nothing. I've tried loggin in with that user to the sql server and it worked no problem.

r3ptar commented 4 years ago

I was doing some more troubleshooting and noticed that if i used the stock web.config file and only changed the sql server to localhost that I was actually seeing failed logins to my sql server.

I made a new user named DS with the credentials that are in the file and it connected successfully. As soon as I changed the username and password to the DisplayMonkey db user I created originally I stopped seeing login attempts and kept getting the error about the config being invalid. Doesn't make sense I made both users the exact same way