iis: applicationhost.config in iis express - iis-express

I am using iis express 7.5. I ran the following to create a new website:
& 'C:\Program Files\IIS Express\appcmd.exe' add site /name:comm-app /id:2 /bindings:http/*:80:comm-app.local /physicalPath:C:\G_Drive\code\iis\www\CommunicationApp\public
I found this config was added to the config file in my documents folder here:
C:\Users\me\Documents\IISExpress\config\applicationhost.config
Then I decided to install the IIS console on my box and use that instead, but after installing and open the IIS console I can't see my new website. When look at the configuration editor I in the console I can see it is using the config file in the windows\system32\inetsrv.. directory:
Which config file is iis express actually using and how can I edit it with the console?

I should have mentioned before that immediately after installing iis express I install Zend server 6 (which I believe makes some config changes).
It appears my iis express is using the config file in the system folder and is working correctly.
If anyone else is using iis express with zend server maybe this will be helpful info.

Related

Debugging Laravel 4.2 with PHPStorm 9 and XAMPP

I am using Laravel 4.2, with the public directory being /htdocs and the logic files are kept in /htdocs/../soft. I am using PHPStorm 9 to debug this app. I've set the interpreter to php.exe from the XAMPP package, and in the Deployment stettings I've added a Local or mounted folder deployment with Upload/download project files set to C:\xampp\htdocs. I've added the htdocs/../soft into the Directories of the project in PHPStorm.
Debugging does work for /htdocs/index.php when debugging the file itself debug index.php, but not when debugging using the browser. How do I configure PHPStorm to debug this directory structure "in browser". I got xdebug installed and the JBeans extension as well.

Xdebug + XAMPP + Netbeans = fail. Cannot get debugger to work in Netbeans

I've read other questions regarding this topic. The listed solutions haven't worked.
Installed:
XAMPP 1.7.7
Netbeans 7.1.1
XDebug 2.1.4
phpinfo() shows that Xdebug is installed with all the correct parameters:
zend_extension = C:\xampp\php\ext\php_xdebug-2.1.4-5.3-vc9.dll
xdebug.remote_enable = on
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000
However, when I start a Netbeans debug session, it cycles for awhile with no effect. When I stop it, I get the Info box informing me that "No connection from xdebug was detected with in nn seconds. The reasons could be that xdebug is not installed or not properly configured. (their emphasis).
As far as I can tell, I configured everything correctly, restarted the Apache server and it still doesn't work. I'm at a total loss on how to proceed. Any help is appreciated.
Can you believe it!? After spending literally HOURS researching this problem, I finally found the cause which I can only classify as a bug. Now, how do I report a bug? That's the next question.
Here's a summary:
create PHP project and setup NetBeans project site root to subfolder.
(In order to not register for Apache new test site for any new task I
put every new task into subfolder under my local test domain, e.g.
http://test.my/project3/ ). NetBeans will not start debugging session
automatically in this case. You will see a ‘waiting for connection’
message from the image below. Do not worry. Left it as it is. Go to
your browser. I use FireFox 4. And call the script you wish to debug
with additional parameter, e.g.
http://test.my/project3/index.php?XDEBUG_SESSION_START=netbeans-xdebug
When you return to NetBeans you will see that connection with xdebug
is established successfully. To stop XDebug session manually call any
script from the same subdirectory with this parameter
?XDEBUG_SESSION_STOP_NO_EXEC=netbeans-xdebug
The complete solution can be found on my newest hero's blog NetBeans 7.0 for PHP Waiting for Connection to XDebug
Edit: Know what I just discovered? I removed index.php as the index file of my run configuration. Works like a charm without having to manually insert the xdebug section of the url.
I just ran into this with Netbeans 8 and while your answer worked around my problem I think I found the solution that will fix it forever.
Project Properties => Run Configuration => Advanced ...
Ensure that the following entry is selected
Debug URL: 'Default: YOUR URL'
Mine was set to "Do Not Open Web Browser" .....
Now it works as it used to work many months ago :)
I am a .Net programmer and very new to PHP. Recently I was trying to host an open source PHP application on my machine(Windows). After the Struggle for 5-6 days I will list the steps which worked for me.
I uninstalled every previous installations of XAMPP and NetBeans and proceeded with fresh installations.
This might not be the solution for everyone but it worked for me and I hope it helps someone.
install XAMPP
install netbeans for PHP.
Open IIS and stop it. It is running on port 80 by default.(I am running XAMPP on port 80 i.e. default, Running on other port might need additional configuration settings)
Open XAMPP control panel and start Apache. If port 80 is free no problem should arise.
Open localhost in browser in should display XAMPP home page.
open phpinfo() link on the left pane and copy all the contents on page. Go to: http://xdebug.org/wizard.php and paste all the content in TextBox and click Analyze my phpinfo output. It will diplay you the Xdebug file suitable for your configuration.
Download the given Xdebug dll and copy it in C:\xampp\php\ext (Xampp being the default Xampp installation directory)
Goto XAMPP control panel, click on Config button in front of Apache and select php.in,
Find line similar or exacly like,
;zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
(Semicolon means it is commented)
Remove the semicolon and replace the path with the path of dll you just copied like:
zend_extension = "C:\xampp\php\ext\php_xdebug-2.3.2-5.4-vc9.dll"
Similarly find lines
;xdebug.remote_enable = 0 ;xdebug.remote_handler = "dbgp"
remove semicolons in front of both lines and make remote_enable = 1
xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp"
Restart Apache server.
Copy your website code under C:/XAMPP/htdocs/(your_website)/ that means your index.php should be at C:/XAMPP/htdocs/(your_website)/index.php
Open Netbeans select New project -> PHP -> PHP project from existing source and select the folder you just copied in htdocs folder. Set it to run on Local web server.
Set a breakpoint on first line of index.php and debug.
That's it.
Additional settings were suggested on various different posts but above mentioned steps worked perfectly for me.
I think what you might be missing is
xdebug.idekey=netbeans-xdebug
this is the settings I use in my php.ini
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1 # Not safe for production servers
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.remote_autostart=false
Read the installation of XAMPP 1.7.7 & Netbeans 7.1 with edditing
the php.ini file as suggested:
http://netbeans.org/kb/docs/php/configure-php-environment-windows.html
Create your PHP project in the local XAMPP directory, c:\xammp\htdocs\*yourproject*
Debug the index.php, you will see that your browser will start with additional parameters:
http://*yourproject*/index.php?XDEBUG_SESSION_START=netbeans-xdebug
Go to your Netbeans, your debugger will be started.

XAMPPLITE / Web Application - auto install

Would like to hear comments from you if its possible to accomplish this with a single mouse click on a bat/exe file -> if its possible to accomplish the following two steps into one:
1: Install xampplite
2: Paste a web application into the htdocs folder. The web application has a file install.php. The install.php file will install the database and prepare the web application for further use.
Thanx,
Why should that not be possible? But installing xmapp on a computer with the generall installer asks you where you want to have the files.
An other idea could be by using the zip file. AFAIK you can unzip files from cmd (by invoking the zip function) to a destination you set, copy the webapplication to the htdocs folder, starting up apache and call an URL to your installer script.

How to build a deployment package in Visual Studio 2010 without ftpServer tag?

Everytime I right click in my Web project to build deployment package, it generates a zip file. This zip contains a file named:
- archive.xml
the problem is that when this file is generated, its content has this tag:
<ftpServer allowUTF8="true" MSDeploy.allowUTF8="1" serverAutoStart="true" MSDeploy.serverAutoStart="1" MSDeploy.MSDeployLinkName="ftpServer">
bla bla bla bla
</ftpServer>
actually when this tag is present, when I connect to a remote IIS using my IIS 7.5, I cannot import the package. I always need to remove the ftpServer to import the site with no errors.
Is there a way to generate my deployment package without ftpServer tag in archive.xml?
I see msdeploy version 2 is being used by Visual Studio:
"C:\Program Files (x86)\IIS\Microsoft Web Deploy V2\msdeploy.exe"
-source:archiveDir='D:\site\manifest'
-dest:manifest='D:\site\obj\DEV\Package.TempLocalDeployManifest.xml',IncludeAcls='False'
-verb:sync -disableRule:IISConfigFrom64To32
-enableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
-disableLink:FrameworkConfigExtension -replace:objectname='application',targetattributename='applicationPool',replace='MsBuild_Temp_5ED29B38-3E2D-4835-B2D8-8FDFBDF1D8B2'
The IIS environment you have linked to your web project probably has an FTP server running on it. If you remove that FTP server from IIS on localhost (presumably), the Web Deploy pipeline will stop trying to include its IIS settings as a part of the deployment package.
Alternatively, you could uncheck the "Include IIS settings as configured in IIS/IIS Express" checkbox on the Package/Publish Web tab of your web project - although that will mean that you will have to manage your IIS settings manually.

How do I set up Mercurial and hgweb on IIS?

I've been looking all over for decent instructions on how to get hgweb working on IIS but I haven't found much of worth.
There's this "step by step" on the Mercurial wiki, but it's not very good.
There's also this and this, but again, I can't find good steps to lead up to where those get started.
I just had to install a fresh Mercurial instance yesterday, here's updated instructions for 1.7:
Install Mercurial (these instructions were tested with 1.7)
Install Python (for Mercurial 1.7, you must use the x86 version of Python 2.6.6)
You will need to download the hgweb.cgi file from the Mercurial source. You can download the source by running: hg clone https://www.mercurial-scm.org/repo/hg/
Create a folder that will be your web application folder. You will need to copy three things into this folder:
The hgweb.cgi file
The contents of the Library.zip from your "C:\Program Files\Mercurial" folder
The Templates folder from your "C:\Program Files\Mercurial"
You will need to make sure you have Python set up in IIS.
Enable CGI via the following: Control Panel -> Turn Windows Features On or Off -> Roles -> Web Server (IIS) -> Add Role Services -> Check CGI
Create a new Web Site in IIS and make sure the physical path is the folder you created above
In the Handler Mappings for the new website, select "Add Script Map". Enter *.cgi for the request path, c:\Python26\python.exe -u "%s" for the Executable, and Python for the Name.
You will also need to create a file named "hgweb.config" with contents similar to below. The path within the file needs to be the location on your drive where you want to store the Mercurial repositories:
[collections]
c:\Mercurial\repos = c:\Mercurial\repos
Edit the hgweb.cgi file and change the line where it sets the path to your hgweb.config to something like the following (wherever the hgweb.config file is):
config = "C:\Mercurial\hgweb.config"
Now, open a browser and navigate to http://localhost/mercurial/hgweb.cgi (or whatever is the appropriate URL path you set up in IIS) and you should see the Mercurial Repositories page.
Also, check out Jeremy Skinners blog post . It's a little outdated, but has some extra nice steps like setting up URL re-writing for cleaner URL's.
It seems since Mercurial 1.5.2 was released, these tutorials don't work exactly right. For one thing, hgwebdir.cgi has been removed, and is now replaced with hgweb.cgi.
The instructions that worked best for me is at eworldui.net:
http://www.eworldui.net/blog/post/2010/04/08/Setting-up-Mercurial-server-in-IIS7-using-a-ISAPI-module.aspx
Those instructions are meant for IIS 7 or greater. If you're setting this up on IIS 6, I wrote up similar instructions geared toward Win2k3 and IIS 6.0:
http://partialclass.blogspot.com/2010/05/setting-up-mercurial-server-on-win2k3.html
UPDATE: Shortly after getting this working I learned that BitBucket changed their pricing scheme to offer free, unlimited, private hosting: https://bitbucket.org/. I would've opted for that in a heartbeat when I was originally working on this project.
Below are what I did after doing a fair amount of research for geting hgwebdir.cgi setup on IIS6 . It is based on the following sites:
http://python.markrowsoft.com/iiswse.asp
http://www.jeremyskinner.co.uk/mercurial-on-iis7/
You'll need to install the following on the server:
Mercurial (I used version 1.5)
Python 2.6. The version of Python depends on the version of Mercurial installed.
Mercurial 1.5 uses Python 2.6. Install x86 even if you are running x64.
The steps for me were:
Create a directory for the website. I used c:\inetpub\wwwroot\hg.
In IIS, right click on the folder for hg, select properties, select the Home Directory tab.
Click on the Create application button. Set the execute permissions to "scripts".
Still in the Home Directory tab, click on the Configuration button. In the "Application Configuration" popup, click the Add button to add an application extension. The Executable is c:\Python26\python.exe -u "%s" "%s". The extension is .cgi. Set the "verbs" to "limit to: GET,HEAD,POST". Check both Script engine and Verify that file exists.
In the Directory Security tab, click on the Edit button in the Authentication and access control section. Uncheck all authentication methods, and check the "Basic authenication" method. Set the Default domain if you like to your Active Directory domain.
In IIS, click on the Web Service Extensions folder on the left panel. Click on "Add a new Web service extension" link. Extension name should be Python, the required file is c:\Python26\python.exe -u "%s" "%s". Make sure the new extension is "Allowed".
Now is a good time to test that Python is working. Create a file in your new Hg folder called test.cgi. Paste the following python code:
print 'Status: 200 OK'
print 'Content-type: text/html'
print
print '<html><head>'
print ''
print '<h1>It works!</h1>'
print ''
print ''
Open the browser to your site, for instance, http://localhost/hg/test.cgi
You should see "It works!" in the browser.
Next let's get the hgwebdir working.
Delete test.cgi
clone the hg repo to a new directory: https://www.mercurial-scm.org/repo/hg/
copy hgwebdir.cgi to your web directory: c:\inetpub\wwwroot\hg\ from the cloned hg repo
Edit the file and change
application = hgwebdir('hgweb.config')
wsgicgi.launch(application)
to
application = hgwebdir('c:\inetpub\wwwroot\hg\hgweb.config')
wsgicgi.launch(application)
Unzip the Library.zip file in the Mercurial directory, c:\Program Files\Mercurial\, to your web directory, c:\inetpub\wwwroot\hg\
Copy the templates directory from c:\Program Files\Mercurial\templates\ to c:\inetpub\wwwroot\hg\templates\
Create a file called hgweb.config in your web directory.
Now is a good time to test it out. Go to the following URL in the browser, http://localhost/hg/hgwebdir.cgi
Edit hgweb.config, and paste the following:
[collections]
\\server\share$\Hg\ = \\server\share$\Hg\
[web]
allow_push = *
push_ssl = false
These are all my preferences, for instance we have our repos in subdirectories at \\server\share$\Hg. The web app will run under the permissions of the logged in user via the browser, so they'll need read/write permissions to the share.
The last step is to allow for long connections which can happen when you first clone a repo. Run the following command to increase the timeout to 50 minutes:
cd \inetpub\AdminScripts\
cscript adsutil.vbs GET /W3SVC/CGITimeout
cscript adsutil.vbs SET /W3SVC/CGITimeout 3000
Use mercurial to clone the mercurial repository:
hg clone https://www.mercurial-scm.org/repo/hg/
you will find hgwebdir.cgi at the top level. It should install
like any other cgi script.
I've been fighting with this setup for mercurial 1.7.2 for the past week or so, I had to do things slightly differently than the above articles do in order to get it working.
Posting here because google kept bringing me back here....
Full instructions posted here
I followed a combination of these instructions and these (in the source)
The main differences are that I had to do the "pure python" install of mercurial otherwise it would complain about missing dlls, and I found it was important to use the "python installers" for pywin and isapi-wsgi. (maybe this is obvious to experienced python developers, but I'm a python newbie so it was news to me)
Hope this helps somebody and I'm not just making stuff up (I might be, like i said, python newbie)
The hg red book contains some much better general instructions than I've seen in other places. They are not IIS specific, but they are quite good:
http://hgbook.red-bean.com/read/collaborating-with-other-people.html#sec:collab:cgi
I was running into a "...can not load module..." type error and after some reading, the key for me was to ignore the Library.zip file in the Mercurial folder, and instead use the one from C:\Program Files (x86)\TortoiseHg folder.
That tip I found as #6 in this guide:
http://www.endswithsaurus.com/2010/05/setting-up-and-configuring-mercurial-in.html
Hope this helps someone...
I know this is an old question, but I really struggled getting Hg installed on Server 2019 and IIS 10.
Here is what I did to get it working:
Install Python 2.7 which in my case was python-2.7.18.amd64.msi. I will assume it's installed in C:\Python27. Make sure python is added to your path and that pip is installed.
Install Mercurial as a module using pip at the command line:
pip install mercurial
Under Default Web Site add a new application called hg and point it to the directory you want to use to use.
Configure Python as CGI handler in IIS 10.0 for this new website (or the entire web server if you wish). You can do this manually or create/add the follwing to your web.config file:
<system.webServer>
<handlers accessPolicy="Read, Script">
<add name="Python 2.7" path="*.cgi" verb="*" modules="CgiModule" scriptProcessor="C:\Python27\python.exe -u "%s"" resourceType="File" />
</handlers>
</system.webServer>
In the 'hg' application folder create a hgweb.cgi that looks similar to the following:
#!/usr/bin/env python3
#
# An example hgweb CGI script, edit as necessary
# See also https://mercurial-scm.org/wiki/PublishingRepositories
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
# import sys; sys.path.insert(0, "/path/to/python/lib")
# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()
from mercurial import demandimport
demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)
In the 'hg' application folder create the hgweb.config file and point it at your repos like the following:
[collections]
C:\Web\www\hg\repos\ = C:\Web\www\hg\repos\
Navigate to http://localhost/hg/hgweb.cgi and enjoy!
You can try HgLab. This isn't exactly hgwebdir; rather it is a purely managed Mercurial implementation with push and pull server and repository browser.

Resources