Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I config h5ai with IIS? #617

Open
lowprofileusername opened this issue Apr 8, 2017 · 13 comments
Open

Can I config h5ai with IIS? #617

lowprofileusername opened this issue Apr 8, 2017 · 13 comments

Comments

@lowprofileusername
Copy link

@lowprofileusername lowprofileusername commented Apr 8, 2017

If yes. any tuts? Thanks

I find nothing about h5ai with iis under windows.

Thanks

@Armstrong1992

This comment has been minimized.

Copy link

@Armstrong1992 Armstrong1992 commented Apr 27, 2017

Really simple:
Example web root: C:\inetpub\wwwroot

Copy _h5ai folder to web root.
You should have something like:
C:\inetpub\wwwroot\_h5ai\public
C:\inetpub\wwwroot\_h5ai\private
with few other files.
Add to "default documents" Name: _h5ai/public/index.php and move it to first place.
It works out of a box with PHP enabled.

@oranges13

This comment has been minimized.

Copy link

@oranges13 oranges13 commented Nov 28, 2017

I have this working on IIS, but unfortunately sub-directories do not work. Behind the scenes, a POST request is failing with a 405

@Armstrong1992

This comment has been minimized.

Copy link

@Armstrong1992 Armstrong1992 commented Nov 28, 2017

Do you have multiple handlers for POST/GET configured? It's often a reason for 405. And which version of a server?

@oranges13

This comment has been minimized.

Copy link

@oranges13 oranges13 commented Nov 28, 2017

It's pretty much the default configuration for PHP in IIS. I haven't customized any handlers for any verbs. And it's only an issue with subdirectories, it works in the root folder.

@Armstrong1992

This comment has been minimized.

Copy link

@Armstrong1992 Armstrong1992 commented Nov 28, 2017

Add rewrite rule:

 <rewrite>
            <rules>
                <rule name="RewriteAll" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="_h5ai/public/index.php" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
@oranges13

This comment has been minimized.

Copy link

@oranges13 oranges13 commented Nov 28, 2017

In the subdirectory or the root?

@Armstrong1992

This comment has been minimized.

Copy link

@Armstrong1992 Armstrong1992 commented Nov 28, 2017

Root Web.config

@oranges13

This comment has been minimized.

Copy link

@oranges13 oranges13 commented Nov 28, 2017

You did it! Thank you!

@Hakker

This comment has been minimized.

Copy link

@Hakker Hakker commented Feb 2, 2018

For some reason I cannot get it to work with subdirectories either yet the rewrite rule gives simply an error when I try to check the default document in IIS on the domain if I edit the web.config file. So it simply stays a 403.
This is on IIS 10.

It does work on the folder h5ai is installed in.

@Armstrong1992

This comment has been minimized.

Copy link

@Armstrong1992 Armstrong1992 commented Feb 4, 2018

Weird, 403 looks like permissions problem. Directory browsing without h5ai works?

@Hakker

This comment has been minimized.

Copy link

@Hakker Hakker commented Feb 4, 2018

when I turn on directory browsing yes, but in h5ai the subdirs although seen in h5ai show nothing although it has files. If I go there directly I get the iis listing.

Also your web.config is partially incomplete I believe. it needs

aswell because without it I couldn't even see the subdirs and the rewrite module needs to be installed which isn't by new IIS installations.

@Armstrong1992

This comment has been minimized.

Copy link

@Armstrong1992 Armstrong1992 commented Feb 5, 2018

I would say that this is only part of the web.config file that you should add to web.config instead of replacing it. Right now i can't test it for IIS 10 to confirm yours problem. But I think this configuration should also work on this version of IIS smoothly.

<configuration>
    <system.webServer>
    Paste here
    ... Other config options ....
    </system.webServer>
</configuration>
@Hakker

This comment has been minimized.

Copy link

@Hakker Hakker commented Feb 5, 2018

tried it as follows added _h5ai/public/index.php to the default documents (as last) also tried /h5ai... and ~/h5ai... else it will take over normal index behaviour and you don't want that in most cases.

then my web.config looks like this

<configuration>
    <system.webServer>
        <directoryBrowse enabled="True" />
	<rewrite>
            <rules>
                <rule name="RewriteAll" stopProcessing="true">
                    <match url="(.*[^/])$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
			<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="_h5ai/public/index.php" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
	</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.