How to restrict the debug mode to a specific domain in Symfony? - symfony

In order to set your app or website in debug mode you can define the following variable in your .env file in Symfony:
APP_ENV=dev
# Is it possible to define a domain rule?
Is it possible to define a domain rule? If you have a multi domain web project it would be very helpful to restrict the debug mode to a specific domain.

Since you tagged this question with contao, I assume you are running the Contao Managed Edition? If yes, you can enable the debug mode via a button in the top right in the back end (when logged in as an administrator). You can also enable the debug mode via the Contao Manager under Maintenance. Either of these options will enable the debug mode only for you (via a Cookie).

Related

Site with both Window and Anonymous authentication on IIS

I want to host an application on IIS with both windows and anonymous modes. I know it is not possible to run website with both modes on as when I enable anonymous mode, window authentication do not work. What are other alternates by which I can run application in both modes with preference to windows.
P.S I can run two websites but their physical path should be same. Also the original website has binding to server default address, any virtual directory converted to default application by default ask for window authentication. e.g.
172.16.128.190;www.xYZ.com binds to path E:/applications/XYZ
172.16.128.190/MS in default application is mapped to E:applications/MS
Now if I disable window authentication on later application it by default picks authentication from first application (inheritance)
In other scenario I can make another site but same physical path
172.16.128.190;www.xYZ.com binds to path E:/applications/XYZ (Window)
www.xYZipad.com binds to path E:/applications/XYZ (Anonymous)
Please provide possible solutions.
it is not possible to enable both authentications for the same site. if you still host the same folder as an application then it is also not possible because that folder uses the same web.config file.
Your best option is to create a folder where all your secured stuff goes and enable windows authentication on that folder. Keep your public bits in other folders and the root.
You could refer below link:
IIS Mixed Anonymous and Windows Authentication

How can I host a sub domain

Hello I have a website hosted on remote desktop. ("mywebsite.com")
I want to host another web app with domain "app.mywebsite.com". I created a website in IIS but its not working. What's the configuration setting I need to do make this working ?
(I use IIS7) first app(mywebsite.com) is hosted before. I downt know anything about.
I just created an app and want to host it in same remote desktop with "app.mywebsite.com" alias.
there is an warrning seem on basic settings > Test settings pane
Error message is : "The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path. Then test these settings again."
How can I fix this ?
Thanks for help
You'll need to add a binding:
Open IIS Manager.
In the Connections pane, expand the Sites node in the tree, and then click to select the site for which you want to add a binding.
In the Actions pane, click Bindings.
In the Site Bindings dialog box, click Add.
In the Add Site Binding dialog box, add the binding information and then click OK.

How to set up a asp.net application on IIS

I've copied a whole folder which keeps a website inside from a web server to another computer.From the original server I can easily run the web application. Now I need to know what exactly I have to do in order to be able to run the application on the second computer too. I think there are some special considerations with IIS. What and how do I have to set up in IIS?
Follow these steps.
create a new site from left menu By right clicking and add new website.
Give physical path to that folder
Map with the site url
Give permissions to Directory as (like everyone)
Set up the default page if (index page is not present in the directory)
Set framework which ever you are using.
Install the IIS Windows component for whatever version of Windows you're using.
Create a new site in IIS
Point this new site to your web root
Configure DNS for the site (maybe using your hosts file)
There are some considerations to make depending on which version of IIS you are using. It would be helpful to know if you are using 6 or 7.
If you are under 7, you need to copy the site to your IIS directory (typically wwwroot) and then setup the basic settings in IIS by choosing your application pool and such. Application pools are typically (but not always) setup by .Net Framework. You may need to setup your default page and set it as an application. There are many blogs and sites out there that will tell you how to setup this basic functionality but are specific to your application.
For configuring IIS
1. Firstly, in Programs and features go to Turn on and off windows features...in that tick everything under IIS..go to sub folder and tick everything everywhere
Go to Internet Explorer> Setting> Internet Options> Advanced> untick Show friendly http error messages option
Go to IIS manager
a. In default application pool> advanced settings > Set true enable 32-bit program option
b. Go to Asp> setting> expand debugging properties> there will an option of error messages some 2nd last or last option that would be false...set it to true..apply changes
Run vbscript and asp only in Internet Explorer (edge 10 in developer options for pop ups)

WIndows Authentication not working

Newly installed IIS on a clean windows Server 2008 R2. Installed all security option. Then for the default web site authentication, enabled windows authentication and disabled all others. Then when access the default page iisstart.htm, it should give me a popup for authentication message.
but when I access the test page like: http://localhost/iisstart.htm, there is no popup. same as enabled Anonymous Authentication.
How to fix it?
I think your webservice is accessing files via your app pool identity, remove this user from the security access list on the file.
If you go to "localhost", then IE will see this as part of the "Intranet Zone". In the "Intranet Zone", IE will by default automatically send your current credentials to sites that use "Windows Authentication".
The result is that everything is probably working correctly.
First of all make sure you check if the app pool user can access the files of the website (NTFS security settings). See: IIS7 Permissions Overview - ApplicationPoolIdentity
After that (and double checking that only Windows Authentication is enabled in IIS) take into account that your URL must not contain dots! You can make an extra binding (see: https://technet.microsoft.com/en-us/library/cc731692(v=ws.10).aspx) that contains only letters and numbers and then add that binding to your local hosts file (open a text editor as administrator and then edit the file hosts in C:\Windows\System32\drivers\etc) to check.

Use windows authentication with ASP.Net AJAX

I'm working on my first application using ASP.Net with web services and I'm having an authentication issue. At least I think that's the issue.
When I run the application locally in debug mode it works fine. It even works when I run it out of debug mode (through IIS) in IE 7. But when I have a coworker run it (from my IIS) on their box, it doesn't work. When querying active directory to look up users it gives this error:
Sys.Net.WebServiceFailedException: The server method 'GetCurrentUser' failed with the following error: System.Runtime.InteropServices.COMException - An operations error has occurred.
What do I need to do to get this working remotely?
Ensure IE is correctly identifying the zone as the Intranet so it will automatically send the username for it. If its not, you'll need to manually add the URL to the Intranet Zone in the IE settings.
That should resolve it, and depending on your config you may need to add to your web.config
What is your web.config for the webservice
What is the authentication setting for the website in IIS? Unless it is set to Integrated Windows authentication it is not likely a permissions issue. If you want to rule out authentication, change the authentication method to Anonymous access and have your coworker try again.
Also, if you specify a user to impersonation in your web.config and you use a different user name in your active directory connection string it can cause an error but it is unclear if that is causing your issue.

Resources