IIS shows 500 Internal server error on everything - windows-server-2008

I have a shared Windows hosting account with IIS7.5 and Plesk 10.4 .
Now, when I try to visit every page, an aspx page, some php pages, or even a jpg file, it shows This error:
Server Error
500 - Internal server error. There is a problem with the resource you
are looking for, and it cannot be displayed.
This is last lines of log file: (which plesk shows for me)
2012-03-01 18:25:59 W3SVC100 H105 208.67.23.51 GET /15iya/31.jpg - 80
109.162.226.165 HTTP/1.1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/535.7+(KHTML,+like+Gecko)+Chrome/16.0.912.63+Safari/535.7 jsuid=1735775291;+_cfduid=dcb02ca5c638c5a33cf10003ae6ac2c561326405625;+_utma=117785567.65259312.1326369096.1330372520.1330376628.15;+_utmz=117785567.1327165762.11.5.utmcsr=2barnamenevis.com|utmccn=(referral)|utmcmd=referral|utmcct=/
ghiasi.net 500 19 13 1380 627 531 2012-03-01 18:26:13 W3SVC100 H105 208.67.23.51 GET / - 80 - 109.162.226.165 HTTP/1.1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/535.7+(KHTML,+like+Gecko)+Chrome/16.0.912.63+Safari/535.7 jsuid=1735775291;+_cfduid=dcb02ca5c638c5a33cf10003ae6ac2c561326405625;+_utma=117785567.65259312.1326369096.1330372520.1330376628.15;+_utmz=117785567.1327165762.11.5.utmcsr=2barnamenevis.com|utmccn=(referral)|utmcmd=referral|utmcct=/
ghiasi.net 500 19 13 1380 615 515

try check with your asp.net version enable properly in plesk
https://www.motherhost.com/help/plesk-windows-hosting/iis-shows-500-internal-server-error-on-everything/
To configure ASP.NET Settings for a site:
If you are subscribed to several hosting packages and have access to several webspaces associated with your account, in the Subscription menu at the top of the screen, select the required webspace.
Go to the Websites & Domains tab and click your website's domain name.
Click ASP.NET Settings.
Set up the strings that determine database connection data for ASP.NET applications that use databases. This option is available only for ASP.NET 2.0.x.
When you open the ASP.NET configuration screen for the first time, sample connection parameters with common constructions are displayed. You can delete them and specify your own strings.
To add a string, enter the required data into the Name and Connection Parameters input fields and click next to them.
To remove a string, click next to it.
Set up custom error messages that will be returned by ASP.NET applications in the Custom Error Settings field:
To set the custom error messages mode, select an appropriate option from the Custom error mode menu:
On - custom error messages are enabled.
Off - custom error messages are disabled and detailed errors are to be shown.
RemoteOnly - custom error messages are displayed only to remote clients, and ASP.NET errors are shown to the local host users.
To add a new custom error message (which will be applied unless the Off mode was selected), enter the values in the Status Code and Redirect URL fields, and click .
Status Code defines the HTTP status code resulting in redirection to the error page.
Redirect URL defines the web address of the error page presenting information about the error to the client.
Due to possible conflicts, you cannot add a new custom error message with an error code that already exists, but you can redefine the URL for the existing code.
To remove a custom error message from the list, click next to it.
Configure compilation settings in the Compilation and Debugging field:
To determine the programming language to be used as default in dynamic compilation files, choose an entry from Default web page language list.
To enable compiling retail binaries, leave the Switch on debugging checkbox empty.
To enable compiling debug binaries, select the Switch on debugging checkbox. In this case, the source code fragments containing error will be shown in a diagnostic page message.
Note. When running applications in debug mode, a memory and/or performance overhead occurs. It is recommended to use debugging when testing an application and to disable it before deploying the application into production scenario.
Configure encoding settings for ASP.NET applications in the Globalization Settings section:
To set an adopted encoding of all incoming requests, enter an encoding value into the Request encoding field (default is utf-8).
To set an adopted encoding of all responses, enter an encoding value into the Response encoding field (default is utf-8).
To set an encoding which must be used by default for parsing of .aspx, .asmx, and .asax files, enter an encoding value into the File encoding field (default is Windows-1252).
To set a culture which must be used by default for processing incoming web requests, select an appropriate item from the Culture list.
To set a culture which must be used by default when processing searches for a locale-dependent resource, select an appropriate item from the UI Culture list.
Set a code access security trust level for ASP.NET applications in the Code Access Security field.
CAS trust level is a security zone to which applications execution is assigned, defining what server resources the applications will have access to.
Important: When an assembly is assigned a trust level that is too low, it does not function correctly. For more information on the permissions levels see http://msdn.microsoft.com/library/en-us/dnnetsec/html/THCMCh09.asp?frame=true#c09618429_010.
Enable the usage of the auxiliary scripts in the Script Library Settings field. Specifying the script library settings is necessary if the validation web controls are used on your web site. This option is available only for ASP.NET 1.1.x.
If you need to use auxiliary scripts (specifically, scripts implementing objects for validating input data), provide the settings for .NET framework script library. To do so, enter the path beginning with the domain root directory preceded by the forward slash into the Path to Microsoft script library field, or click the folder icon next to the Path to Microsoft script library field and browse for the required location.
To initiate the auto-installation of files containing the scripts to the specified location, select the Install checkbox. If the files already exist there, they will be rewritten.
Set client session parameters in the Session Settings field:
To set up the default authentication mode for applications, select an appropriate item from the Authentication mode list. Windows authentication mode should be selected if any form of IIS authentication is used.
To set up time that a session can remain idle, type the number of minutes into the Session timeout box.
Click OK to apply all changes.
windows hosting india

Related

making errors more generic in october cms

I am new to coding. I am trying to create a project in october cms.
My question is regarding the error handling. The errors seem to be too informative, and telling about the file name.
For example
error example
I just want to show the error and not the file. How can this be achieved. So users won't be able to see the file names.
In order to achieve this you need to set debug inside config/app.php to false. This will render a generic page when either a 404 or 500 is hit.
These templates can then be overridden by creating a /500 (server error) and /404 (page not found) in the CMS.
From the docs:
Debug mode
The debug setting is found in the config/app.php configuration file with the debug parameter and is enabled by default.
When enabled, this setting will show detailed error messages when they occur along with other debugging features. While useful during development, debug mode should always be disabled when used in a live production site. This prevents potentially sensitive information from being displayed to the end-user.
The debug mode uses the following features when enabled:
Detailed error pages are displayed.
Failed user authentication provides a specific reason.
Combined assets are not minified by default.
Safe mode is disabled by default.
Important: Always set the app.debug setting to false for production environments.
Source: https://octobercms.com/docs/setup/configuration#debug-mode

how to add db directory to web.xml

I have a java web app configured with apache v9.0 and eclipse IDE. What I need is to keep my database in C:\db so It cannot be access directly from outside and should be away from my webapp project directory. What I don't is how to let my web app know that if a user request for a file it should go and check it in my C:\db and reply back with the file.
Based in my research, some was saying to specify my directory in my webapp web.xml file and others was saying I need to specify it in my tomcat/conf/server.xml file.
I'd really appreciate if somebody tell me what to do?
Try adding your database path C:\db as JVM argument and accessing it in application. you may try this as two ways either set as system property and access when it required or set as JVM argument and access it.
SetSystemProperties
System.setProperty("database", "C:\\db");
.
.
access it as and when required
String databasepath= System.getProperty("database");
Setting as JVM Arguments.
Double Click on your tomcat server on which your web application is present.
Click on "Open launch configuration" link and go to Arguments Tab.
in vmArguments apend the entry like below.
-Ddatabase="C:\db"
A -D is placed in front of each system property that we are passing in as a VM argument, and following this is an equal sign followed by the value of that system property.
And access it in your project where its required like below.
String databasepath= System.getProperty("database");

How to call Apache NMS from in a sandbox?

I'm trying to call Apache ActiveMQ NMS Version 1.6.0 from my code ('IntPub') that must run in a sandbox in a .NET 4.0 environment for security reasons. The program that creates the sandbox makes my code 'partially trusted' and therefore 'security-transparent' which seems to mean that it can't create a ConnectionFactory (see error log below) because NMS seems to be 'security-critical'. Here's the code that's causing this error:
connecturi = new Uri("tcp://my.server.com:61616");
var connectionFactory = new ConnectionFactory(connecturi);
I also tried this instead with similar results:
connecturi = new Uri("activemq:tcp://my.server.com:61616");
var connectionFactory = NMSConnectionFactory.CreateConnectionFactory(connecturi);
Since I can't change the security level of my assembly (the sandbox prevents it) is there a way to make NMS run as 'safe-critical' so it can be called by 'security-transparent' code? Would I have to recompile it to do so, or does NMS do some operation that would never be considered 'safe-critical?
I appreciate any help or suggestions...
Assembly 'IntPub, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6fa620743b8dc60a' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself. In order to access security critical code, this assembly must be fully trusted.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220956</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Unexpected exception from plug-in (Execute): Test.Client: System.MethodAccessException: Attempt by security transparent method 'Test.Client.Execute(System.IServiceProvider)' to access security critical method 'Apache.NMS.ActiveMQ.ConnectionFactory..ctor(System.Uri)' failed.
From the error message attributes, it looks like you're running a Dynamics CRM 2011 plugin in sandbox mode, which has some very specific rules about what you can and can't do. In particular, you're only allowed to make network connections via HTTP and HTTPS, so attempting raw TCP sockets will definitely fail.
Take a look at this MSDN page on Plug-in Isolation, Trusts, and Statistics. It looks like there may be a way to relax the network restrictions by modifying a system registry entry to include tcp, etc, in the regex value. Below is an excerpt from the page. Note: I have not done this myself, so can't say for sure it'll work.
Sandboxed plug-ins and custom workflow activities can access the
network through the HTTP and HTTPS protocols. This capability provides
support for accessing popular web resources like social sites, news
feeds, web services, and more. The following web access restrictions
apply to this sandbox capability.
Only the HTTP and HTTPS protocols are allowed.
Access to localhost (loopback) is not permitted.
IP addresses cannot be used. You must use a named web address that requires DNS name resolution.
Anonymous authentication is supported and recommended. There is no provision for prompting the logged on user for credentials or saving those credentials.
These default web access restrictions are defined in a registry key on
the server that is running the Microsoft.Crm.Sandbox.HostService.exe
process. The value of the registry key can be changed by the System
Administrator according to business and security needs. The registry
key path on the server is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\SandboxWorkerOutboundUriPattern
The key value is a regular expression string that defines the web access restrictions.
The default key value is:
"^http[s]?://(?!((localhost[:/])|([.])|([0-9]+[:/])|(0x[0-9a-f]+[:/])|(((([0-9]+)|(0x[0-9A-F]+)).){3}(([0-9]+)|(0x[0-9A-F]+))[:/]))).+";*
By changing this registry key value, you can change the web access for sandboxed plug-ins.

Web page button error

I have created a web page using VB 2010, i used Master page and i dont put any session, cookies or anything that can affect the website. But when i create a 'submit button' on any of the child page, i goes to an error stating the underline -
Server Error in '/EP-CMS' Application.
The state information is invalid for this page and might be corrupted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.
Source Error:
[No relevant source lines]
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ep-cms\ae3f1090\4636a7bf\App_Web_2wkxnfol.4.cs Line: 0
Stack Trace:
[FormatException: The input is not a valid Base-64 string as it contains a
non-base 64 character, more than two padding characters, or a
non-white space character among the padding characters. ]
.............................etc, etc.,
I dont know why, i have changed the submit button to image button, etc,. but after clicking the button it always points to this error. Linking page was fine but even if i dont write anything on the button events (simply putting button) it leads to this error.. Why
It looks like either you don't have permission to write in temp folder or your reference files are not located in your local machine.
Try following solution.
Check if you can open the location
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ep-cms
Also check %temp% is accessible and you have write permission for that folder and also can write permission from the user you are running the application..
If still not working Clean your solution and delete everything from
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ep-cms\ae3f1090\4636a7bf\
folder and then rebuild the solution.
Also check by re-registering your ASP.Net framework by running following command from command prompt with Administrative rights
aspnet_regiis -i
and re-perform the step 2.
Please feedback the same if you are able to solve using these methods or not. Try step 1 and 2 first.

Search broken in SharePoint 2010

Search in SharePoint throws an error, NullReferenceException, whether using the Search box on a normal page or even just loading the Advanced Search page.
I was originally getting System.ServiceModel.ServerTooBusyException and Round Robin Service Load Balancer EndpointFailure errors in the SharePoint ULS logs whenever I tried to search. I examined IIS and determined that the Web Apps existed. I stopped and started the Search Query and Site Settings Serviec on the server. That was the last I saw of the EndpointFailure and ServerTooBusyException errors.
However, a new error showed up. This time is was a System.NullReferenceException from SetPropertiesOnQueryReader() at CoreResultsWebPart.OnInit(). KB Article 976462 looked promising, until further research showed that it adds the AllowInsecureTransport property in the SecurityBindingElement class, and changes the value from its default of False to True. However, this property exists and is already set to True in my environment.
I found this same problem, however deleting the Search Service Apps and Proxies, recreating them and performing an IISRESET did not fix my problem.
When the Advanced Enterprise Search page is brought up, an error is returned to the screen: Object reference not set to an instance of an object.
This is the log entry out of the ULS:
CoreResultsWebPart::OnInit: Exception initializing: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.SetPropertiesOnQueryReader() at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.OnInit(EventArgs e)
Internal server error exception: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.SetPropertiesOnQueryReader() at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.OnInit(EventArgs e) System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.SetPropertiesOnQueryReader() at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.OnInit(EventArgs e)
Can you have a look at your search topology? Check the status of the following components:
Administration Component
Crawl Component
Query Component
It should be on-line. If it's not, click on Modify Topology and re-provision it.
Navigate to centraladmin:port/_admin/FarmServers.aspx, and check the status of your servers. It should say No action required for all servers - if it says Upgrade required, then run the product and configuration wizard on WFE and app servers depending upon your SP servers.
There may be some rogue entry in your config DB which may be causing this. As you have already re-provisioned search there may be some orphan DB causing the issue. Navigate to centraladmin:port/_admin/databaseStatus.aspx. If you don't see old orphan search DBs here, please delete the search service application, access the above URL again and check if its there. If it is then run the following PowerShell command to remove orphan DBs:
$orphanedDB = Get-SPDatabase | where{$_.Name -eq "MySearchDatabase"}
$orphanedDB.Delete()
I had a similar problem and following Vinod's answer noticed that the "Search Alert Status" in Search Administration was disabled (I intended it to be). Enabling it fixed the issue, meaning that the search pages now render. I was then able to disable the "Search Alert Status" again and the pages continue to work fine.
Hope this helps someone else before they reset / restart services as suggested elsewhere on the web.
I got the same error, restarting SharePoint server fixed my problem.
I just encountered the same problem, and fixed it by:
I verified that the SharePoint Web Services site existed in IIS, and that SecurityTokenServiceApplication existed as a virtual directory.
In my case, I found that the application pool that powered it was stopped due to bad creds. I fixed the creds, bounced the pool, and bounced the site.
That still didn't resolve the issue, so I moved into Sharepoint Central Admin, went to Application Management -> Manage Service Applications.
I clicked on Search Service Application and created a new crawl for my local sites, and did a full index.
Finally I clicked through all of the pieces in the search application topology, changed nothing, but applied topology changes when I was done.
That combination of things fixed it for me.