IIS - Share pages among sites - iis

I have a couple of applications/sites running on different ports on my IIS server. I need to publish pages that are common between these sites. What is the easiest way to do this?
I can't redirect.

You can create a virtual directory in all your sites that share the same folder.
when you change the page on the "base" folder, it will reflect on all the sites.

Related

Issues deploying an Orchard based website on a virtual/app sub directory

I have an issue deploying my Orchard based web site on my web hosting.
I need to run 2 Orchard web sites on my web hosting. To do so, I have created 2 sub-directories that are set-up as both application & virtual directories of their own rights :
~/site1
~/site2
Finally I have set-up two domain names :
mysite1.com pointing to my host's vdir ~/site1
mysite2.com pointing to my host's vdir ~/site2
My page works when I go to mysite1.com main page, or mysite1.com/Admin (hard path ?!).
But they don't work when the page slurp points to Orchard dynamic pages/content.
It then gives me lots of :
HTTP 404. The resource cannot be found
Do you have any ideas what could be happening please ?
ps: I have also posted more details on the Orchard forum
They don't just need to be vdirs, they need to be full IIS applications, under a ASP.NET 4.0 integrated pipeline app pool, with full trust. (please don't cross post)

sharepoint and other localhost sites, on port 80

i'm running sharepoint 2010 foundation, on win7. since installing SP2010, none of my other localhost websites load in the browser. i'm either prompted for a login, or it just returns blank pages. i've tried putting my other websites within the SP-80 directory in iis7, which allowed the pages to load, but required a login. i tried various combinations of windows authentication on different iis7 directories, but nothing worked. i'm left with the impression that iis7 requires a single port 80 directory, rather than distinct, named directors, with separate permissions. the issue could be complicated by having my other sites mapped to a virtual directory, requiring my admin creds, to allow iis access to the files.
my question is, is it possible to host public, unprotected, port 80, web sites, along with SP2010? i'm not very experienced with IIS, so please forgive me if i'm overlooking the obvious.
sure it is possible. While creating WebApplications in SharePoint you're able to specify the port, the WebApplication will run on.
You should have a look at your Site Settings within IIS. SharePoint is by default not running on anonymous authentication mode.
Please analyze if you do have site collections created under Web Application using Powershell or from Central Admin
If you have Web Application created but no Site Collections, then you will get same issue
Sandeep
If you want other sites on IIS on the same port on the same machine, you'll need to declare IIS host headers. When you create a new Site in IIS, there is a bindings section (IIS 7.5 - in IIS6, I believe it's just called Host Headers) - set your bindings to be myotherwebsite.com or myotherwebsite.local. Make sure the names you use in your bindings match DNS names that are pointing to that machine, either through public DNS (if it's a public site) or through your local hosts file (\windows\system32\drivers\etc\hosts) if it's only for your local use.
Going the host headers route, you bypass the sharepoint execution stream completely - set your site up just as you would any other.

Restricting access to files within a folder to webservice IIS6/7

I am looking for a way to restrict direct access to a certain folder or folders on our website which is hosted in IIS7 in our second dev environment, IIS6 in our first dev environment and IIS6 on production.
Basically we should be able to link to these files from our website i.e.:
http://www.domain.com/stuff/survey.pdf
But if someone tries to link to this from a blog post, etc. it should not serve the content. Is there any way to do this in a web config or is that beyond the abilities of IIS?
What I ended up doing was writing a PHP script which served content from outside of the web root, but only if the user was logged in and had a valid site cookie.
Then I created folders to replace all the content we were currently serving (.pdf, .png, etc.) since there was not that much that we wanted secured. I name the folder the same as the original document, i.e.: /webroot/survey.pdf/ and then placed the index.php inside of the survey.pdf folder.
This worked, and now we can use the script to link to content that we want secured.

How to configure multiple intranet website on server 2003?

I have two intranet website but they are as folders under default website so I would access as //server-internal/websitedirectory1/ adn //server-internal/websitedirectory2. Users don't like this. They want to access with some meaningful name like website1.intranet.com and website2.intranet.com. How can I achieve this? Thanks a lot.
You will have a problem if these two "sites" share session information. Test this by setting up two virtual folders.
You need to add multiple Web Sites in IIS and set them to respond to different Host headers (in Properties)
You'll also need to set up DNS.

Sharepoint - how to enable caching w/o server access?

I am using WSS 3.0 in a hosted/shared (read: can make no server-side changes) environment. Unfortunately, between SP and IIS, almost nothing is getting cached, so page loads can be terribly slow.
We have a bunch of custom image, JS, CSS, etc files that are currently just in a /img, /js, and /css directories, all of which are grabbed each and every time the page loads (server is returning "Cache-Control private,max-age=0").
Since I can't do anything with IIS, and can't enable any caching server-side on SP, do I have any other options? I've read in a few places that if your files are located in the layouts directory that they will be cached, but using SP Designer I don't seem to have access to the /___layouts directory, unless I'm missing something....
Thoughts?? Thank you!
Since you are running in a hosted/shared environment I would work directly with the ISP on this one. There are many ways to cache things and the ISP could very well prevent you from doing most of them.
Ask them the following questions...
Have you set output caching on the Page Layouts directory for anon and or authenticated profiles, or at the Site level or at the Site Collection level (overview on how to here)? If not, can you?
Do you have IIS set to compress static files (its not caching, but, will help)?
How much RAM is available to me in this shared environment?
If you have enough RAM, look into caching your custom web parts.
You could also host your custom images, css, javascript etc on a 3rd party CDN (Akami, Amazon Web Services), that doesn't help with your theme and core js/css files.
_layouts is the "repository" for application pages, i.e. pages deployed by sharepoint for performing maintenance etc. through the web UI. It is very well possilbe you don't have access to that folder, it will also not show up in SharePoint designer. You have a couple of options:
If you have a Publishing site, you can enable caching through the site settings.
What you could also do is add the #OutputCache directive to a page you create through SharePoint Designer (Outputcache on MSDN
deploy your site through a solution, which does allow deploying in the _layouts folder

Resources