New to IIS, looking for a way to handle logs and sessions upon a deploy - iis

Deploying a ASP.Net application via Teamcity and a Nant scripts. Currently I am zipping up the directory from the local git repository (after building) and copying up to the test machine, Renaming the current web home directory and dropping in the new one. (with some scripts to get the web.config in place)
The question I have is how to handle the log and sessions directories. I want them in the current deployed directory but don't want to have to copy them from the old to new one. I was debated about having them stored in a different directory then the web home directory and just placing a shortcut pointing at that directory (would be in git so it would get deployed with everything else). In linux I have a link (ln) doing this very thing for me.
Is their a cleaner solution? Am I going about this the wrong way?

Instead of renaming the current web directory, copy it and then use NAnt's <delete /> task to delete the web directory excluding the log and session directories. Then simply unzip the new web application.
For example:
<delete>
<fileset basedir="${PublishLocation}">
<include name="**/*"/>
<exclude name="**/Logs/**/*" />
<exclude name="**/Sessions/**/*" />
</fileset>
</delete>

Related

Creating Virtual Directory on IIS for Coldfusion Lucee

I am trying to Move my Website on a local directory from Adobe Coldfusion to Lucee.
I was able to Install Lucee with the Windows Installer.
IIS is working fine.
When i Create a Virtual Directory from IIS to Map a Physical Path (C:/Website) outside the inetpub root folder (FOR IIS) or outside the Tomcat/webapps/ROOT folder (for Lucee), IIS doesn't load that physical folder. Instead it loads the inetpub root folder and i can't access files from the Physical Path Directory.
I am using //localhost/{The Alias} to call the Website but saying file not not found.
Obviously because it's calling from Inetpub file Directory, not the Physical path.
Are there any special configurations i need to make?
I have searched online and no post could help.
Note that i am using different computers.
Kindly Assist.
mod_cfml (the adapter that is used with Lucee/IIS along with the BonCode Connector) does not currently support virtual directories. You will need to configure those manually in the Tomcat context config, like so:
<Host name="lucee.org" appBase="/home/lucee/public_html">
<Context path="/vdir/" docBase="/home/other_user/public_html/some_other_directory/" />
<Alias>www.lucee.org</Alias>
</Host>

In Azure, What is the difference between wwwroot and repository?

I recently started to make my website and found interesting thing. I spent like 30 mins to modify my index page but it didn't change somehow. And then I found out index.jade is the one in wwwroot folder, not repository folder. I compared these two folders and it has no difference at all. They both have same jade files.
I wonder what is the purpose for each directory? What wwwroot directory for and what repository directory for?
When I tested, there is no change in "actual website" when I modify index.jade file in repository directory. But actual website changes when I modify index.jade file in wwwroot folder.
Thanks in advance.
When you provision a webapp in Azure appservice you will not have repository folder by default. When you enable deployments (like say Local Git Repository) then repository folder is created. wwwroot will be there by default and is the right location where the actual content is served by the webapp. Repository is where you can push your code (through git push) from local git repo to azure remote and will be first staged in "repository" directory and deployed to "wwwroot" but i don't think if you change/upload/ftp the files to repository it won't impact anything unless you either copy to wwwroot as well (or deploy code through git push to remote). so in short wwwroot is where the content is served by your web server and repository is where the code is managed/staged for fetch/push.
https://azure.microsoft.com/en-us/documentation/articles/app-service-deploy-local-git/

Can't access remote tomcat webapps

I've got tomcat running on a remote Linux box. We have one web app running on it okay,
/project1 (not root), with a "project1.war" auto deployed. I've now uploaded "project2.war" and I can see it's been extracted etc., but when I go to mysite/project2 I get a "not found" error.
I can't for the life of me see any references in server.xml, context.xml, web.xml for project1 to map its URL, so I'm really at a loss for how I'm supposed to get /project2 seeable. I'm very new to Linux, looking for some advice. Here's my server.xml entry:
<Host name="mysite.co.nz" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
Have to add it to apache 2 sites-available list

Tomcat webapp configuration on linux

I have a webapp (springmvc 3.0.5/java 1.6 based) that I'm deploying to a tomcat (6.0.32) web server on a linux machine. Currently I copy the war file out to the server and let tomcat unpack it for me.
relevant lines in server.xml:
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
<Context docBase="fooapp" path="/" reloadable="true" source="org.eclipse.jst.jee.server:Fooapp"/>
</Host>
I want the webapp context path to be "/" so I don't have to add /fooapp/ to every url. http://www.mydomain.com/index.html instead of http://www.mydomain.com/fooapp/index.html
The issue is that in my current configuration the webapp is served from BOTH "/" and from "/fooapp" context paths because tomcat unpacks the war twice. Once to the fooapp directory and another time to the ROOT directory.
I'd like the web application to be unpacked just once to the fooapp directory and still served from the "/" context path. Can this be done on linux and if so how?
Note: This works on windows exactly as I want so I'm hopeful that linux can do the same thing.
The simplest method:
Delete your Context tag from the server.xml,
delete webapp/fooapp and webapp/ROOT directories,
copy your fooapp.war to the webapp directory as ROOT.war.
You can find some other methods in the Tomcat's documentation.

Tomcat Configure To Serve Static Files is not working

I have linux machine, on which I have deployed my project. I have some static content which I have placed at /var/grt_dynamic_images on physical harddisk on linux. I am using it as /EchlonSurvey/images/dynamic/images. It is working fine on windows but not on linux.
Here is the server.xml file snapshot, where I am doing this configuration.
<Context docBase="/var/grt_dynamic_images" path="/EchelonSurvey/images/dynamic_images" />
<Context docBase="/var/grt_dynamic_images/category_images" path="/EchelonSurvey/images/dynamic_images/cat_images" />
<Context docBase="/var/grt_dynamic_images/profile_images" path="/EchelonSurvey/images/dynamic_images/prof_images" />
In webpage, I get 404 error. The path is same but the image are not coming from docBase. I have checked, there are all image which I need.
http://.../EchelonSurvey/images/dynamic_images/cat_images/277152_9449%20sml.png
image not available
one suggestion. if you have a ROOT webapp, you can create a symbolic link within it and point to the folder you want to serve. so something like
/tomcat/webapps/ROOT: ln -s /var/grt_dynamic_images /EchelonSurvey/images/dynamic_images
when i do this, it 'works' but only if i am specifying an actual resource on the url, like a .png file. i still get 404's if i just stop the url at a folder level. i'm sure there's some Tomcat setting for displaying a folder listing but haven't looked into it.

Resources