How to register WCF on a website other than Default Web Site with ServiceModelReg? - wcf

I am trying to fix a problem where my wCF services will not work on my live site which runs under it's own website instead of under Default Web Site.
I am trying to run ServiceModelReg -i but for my website, not the Default. If I put -h it says that "-s:" will recursively install the components for the particular path. However, when I run "ServiceModelReg -s:W3SVC/1/root" then it says "Error: No valid options were specified..." -s does the same thing, in short it does not seem to work.
I read here that I could run it for my website instead of Defafult Web Site by incrementing the number, but it does not seem to work even with just the s.
So the question is: How can I run this option with -s for my website (it is called pokerdiy.com in IIS and is a sibling of the Default Web Site).
The website is running on IIS 7.5.7600.16385 on Windows Server 2008 R2 Version 6.1 SP1 (64 bit) in an Integrated Application pool with .NET 4.0.

servicemodelreg.exe installs at machine level not at site level. If a .svc file is not served by the non-default site, the problem lies with the settings that should have been setup through running aspnet_regiis -i -s <your site path>

Related

Hosting blazor wasm asp.net core hosted app in kestrel

I am having troubles hosting the blazor wasm asp.net core hosted application.. The solution has 3 projects: Client, Shared, and Server.
when I run the command dotnet publish --configuration Release it publishes the libraries to their respective folders in solution like this:
WebWorkbench3\Client\bin\Release\net5.0\publish
WebWorkbench3\Server\bin\Release\net5.0\publish
...
I would assume that since the server project is referencing a client - then my steps to host the application are following:
Open WebWorkbench3\Server\bin\Release\net5.0\publish in powershell
Run command dotnet .\WebWorkbench3.Server.dll
Navigate to: https://localhost:5001/
Result:
Expected: client page opened
Actual: page is stuck at "Loading.." string. In the console we see that there was an error about _framework/blazor.webassembly.js not being loaded.
If we were to check the wwwroot folder contents in the server app we will see the following:
So this explains why the error is shown. However my question at this point - should the publishing process/configuration in project take care of copying client's wwwroot contents into the the server's app output directory? If we start a debugging session in the VisualStudio, then we use the server as the startup point, so the project should have some idea where to look up the blazor.webassembly.js file at..
So why doesn't the same process occurs during the publishing?
Note: I was able to fix the issue by manually copying the client's wwwroot directory and by placing the contents into the server's wwwroot directory... But I don't think that is is how serving is supposed to work?
EDIT: I have just tried to set-up the client blazor application in IIS. And it works. Kind of. The page is opened. But then when it tries to make a REST GET request to the server - it uses the same hostname:port combination. So if my app is hosted on mysite.local:50001 then the request to API will look like mysite.local:50001/data/loadall where data is the controller name and loadall is the action name.. So basically the client uses the same base address as the server.. The problem, is that I cannot start the server on the same port as the client! In attempt in doing so - you will see following output:
So basically I have the same question as before - how to host the wasm application that is split between client and the server? I am pretty sure that I can make it work by forcing the client to use the non-standard server port and serving the server part on that port.. However, I believe there should be a reason why current configuration (default configuration in the blazor wasm template) is configured in this way so it should be possible to run the project somehow without any additional changes at all..
Well this will be a self-answer.. Instead of publishing (dotnet publish --configuration Release) the application on solution level - do the publishing on project level..
before ..\repos\WebWorkbench3\WebWorkbench3
after ..\repos\WebWorkbench3\WebWorkbench3\Server
In 1 case the compiler does not copy the _framework folder (and possibly some other files) into the wwwroot.. Once you have published the Server correctly you can access the app by serving it with dotnet .\WebWorkbench3.Server.dll command.
Having the samie issue as explained above:
Before:
The solution file
had the same name
was in the same folder
as the server project
Resolved
I moved the solution to the project root (one level up).
Now, dotnet publish within the server project produced the __framework folder + content as expected.

Does file copy deployments work with CakePHP?

I have a legacy CakePHP(1.3.13) app, running on Ubuntu server 16.04, on apache. It is using php 5.6. I'm trying to migrate the app to a development server, also Ubuntu 16.04, but running php 7.2.
On the production machine, php file(s) are being executed even before line 1 of index.php in the app I'm trying to migrate. On the dev box, this isn't happening.
I've sudo tar'ed the entire web server tree, and sudo untar'ed it on the dev box. I've copied the apache site configs, and only edited them for hostnames.
I don't understand why apache is running one or many php files PRIOR to running index.php on the production box. It is apparently loading a custom configuration php file, that sets up some global variable, but for the life of me I can't figure out why this is happening. I'm sure I'm just missing something dumb.
Greg Schmidt nailed it. There was a second auto_prepend_file=MagicallyExecutingScript.php in the php.ini.

iis 6.2 using aspnet_compiler.exe to Precompile

I am using IIS 6.2 and able to pre-complie in place an application successfully using C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe using the parameters -p "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files" -v "/VirtualApplication"
it create the cache fold as expected, the issue is when I access the site from a browser iis does not use the existing cache folder it is making a new folder.
How do I Instruct IIS to use the precompiled version. on IIS 6.2 what is the best practice for Precompiling in place.
Precompile ASP.NET Website
The -p parameter is the path to your actual website which will be something like C:\InetPub\MySite
The -v parameter is the path the web browser will use which will be just a forward-slash if it is the root. IE:/ If your site is to be reached at stackoverflow.com then your virtualPath would be / but if your site was at stackoverflow.com/MySite then your virtualPath would be /mySite
aspnet_compiler will create compiled copies of your website's .NET libraries and save them somewhere on the system that you don't need to worry about because IIS will automatically use them instead of compiling new ones.

Tomcat8 The origin server did not find a current representation for the target resource or is not willing to disclose that one exists

my url is http://localhost:8080/guacamole it returns
HTTP Status 404 – Not Found
Type Status Report
Message /guacamole
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/8.5.30 (Ubuntu)
and for url localhost:8080 it shows
It works !
If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
This is the default Tomcat home page. It can be found on the local filesystem at: /var/lib/tomcat8/webapps/ROOT/index.html
Tomcat8 veterans might be pleased to learn that this system instance of Tomcat is installed with CATALINA_HOME in /usr/share/tomcat8 and CATALINA_BASE in /var/lib/tomcat8, following the rules from /usr/share/doc/tomcat8-common/RUNNING.txt.gz.
You might consider installing the following packages, if you haven't already done so:
tomcat8-docs: This package installs a web application that allows to browse the Tomcat 8 documentation locally. Once installed, you can access it by clicking here.
tomcat8-examples: This package installs a web application that allows to access the Tomcat 8 Servlet and JSP examples. Once installed, you can access it by clicking here.
tomcat8-admin: This package installs two web applications that can help managing this Tomcat instance. Once installed, you can access the manager webapp and the host-manager webapp.
NOTE: For security reasons, using the manager webapp is restricted to users with role "manager-gui". The host-manager webapp is restricted to users with role "admin-gui". Users are defined in /etc/tomcat8/tomcat-users.xml.
but i need apache tom server site

IIS7/Win7 - Make sure that the application pool identity has Read access to the physical path

I am running a localhost instance (so domains are not my issue!) on my laptop utilizing Win7 and IIS7. I am getting authentication errors on my website and my one virtual directory.
default website - localhost:80 c:\mydirectory\localhost
virtual directory - c:\mydirectory\weborb30
Please notice these are not under c:\inetpub\wwwroot!
Now, I did some googling/binging and discovered that I needed to add my [machinename$] to the ACLs. (Hope I said that right.) I did that, even though it is a domain thing. Nothing changed. I further read that IIS7 is now using ApplicationPoolIdentity and I tried finding that on my local machine - no luck there. So, I changed the App Pool to run under another built in account. Now, not only do I get the Authentication error I can no longer AttachProcess to W3WP.
How the heck do you PROPERLY setup VS2005, IIS7 on a WIN7 box to run locally???
I was having a similar problem and ended up fixing it by giving read permissions to the "IUSR" user and "IIS_IUSRS" group.
I'm not really sure why this works. It seems odd needing to give permissions to IUSR when I thought it would have been included in the IIS_IUSRS group. I think part of it relates to the account the application pool runs as (e.g. "IIS AppPool\Classic .NET AppPool" for a classic .NET application pool in IIS 7.5 / Windows 7), but I'm still unclear.
This StackOverflow question seems to be related.
Before you made changes to the app pools, all you probably needed to do was add read access to your physical directory for the "network service" account (that is the default account used by asp.net on vista & win7).
I think what you may be looking for at this point is this:
aspnet_regiis -ga <useraccount>
The -ga switch tells aspnet_regiis to configure all the security for asp.net. Usually you only need to do this stuff when you are using impersonation in your application, but if you are changing the default user for the application pools then you are effectivly doing the same thing IIS wide.
The best complete documentation I've found is on MSDN. It applies to the previous version of IIS, IIS 6, but it is pretty easy to apply it in IIS 7 environments
Just try to restart the IIS here: IIS Location to restart and don't use iisreset etc
if that doesn't work try to add it here first, and then Restart (right click again and restart through the interface.) then get it back to the correct permissions.. Restart again in the same way.
I hope it helps it solve most of the bugs for me in that subject..