Search…

X3 Photo Gallery Support Forums

Search…
 
cshetler
Topic Author
Posts: 21
Joined: 04 Feb 2008, 09:23

IIS 8 Installation

18 Nov 2014, 12:13

Has anyone successfully installed the X3 beta in a IIS7 or II8 environment?

If so what applications pool mode are you using and what other tweaks (if any) did you make?

Can't seem to get the site to run.

Cheers,

Chris S.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: IIS 8 Installation

18 Nov 2014, 12:18

Unfortunately, I have very little experience currently running this on specific local hosting environments, and especially windows ... May I ask what results you see? I imagine the issues may be related to the .htaccess file, which is used extensively in X3 with mod_rewrite. If for example mod_rewrite is not enabled, X3 would not work at all, although you should still see a broken menu tree without CSS applied.

I am including an X3 diagnostics app shortly, and that might help determine any problems.
 
cshetler
Topic Author
Posts: 21
Joined: 04 Feb 2008, 09:23

Re: IIS 8 Installation

18 Nov 2014, 14:16

May I ask what results you see?
No results :D

The application pool in IIS actually just terminates. Nothing of substance captured in the logs just a reference to a general application fault.
We'll do some troubleshooting from here with the IIS Debugger tool and report back if/when we come up with something.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: IIS 8 Installation

19 Nov 2014, 05:15

Please follow the instructions to upload the new X3 diagnostics check:
viewtopic.php?f=51&t=8336

This will tell you a lot about the requirements. First of all, it would of course need to run the basic diagnostics PHP script itself!
 
cshetler
Topic Author
Posts: 21
Joined: 04 Feb 2008, 09:23

Re: IIS 8 Installation

19 Nov 2014, 13:54

Karl:

I was able to get the basic site (index page) to load in my Windows server environment.
1. I set the application pool to 4.0 Integrated mode
2. I imported the re-write rules from the .htaccess file into IIS. (Screen shot attached)

Something seems still not to work with at least one of the re-write rules because when trying to navigate to the sample galleries the site sort of just hangs.

Also the Mod Rewrite test at the bottom of the diag page is not showing the image.

The diag file is installed http://x3.aaa-awards.com/diag


Cheers
Attachments
IIS url rewrite.jpg
IIS Rewrite Rules Import
IIS url rewrite.jpg (166.86 KiB) Viewed 5426 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: IIS 8 Installation

19 Nov 2014, 14:31

I am no expert on setting up servers, and certainly not a custom windows server unfortunately. All I can basically see, is that mod_rewrite does not seem to be working at all. If I was working on your server, the first thing I would do is try create a basic example of mod_rewrite regardless of X3 so that you know it's working, and most importantly: how its working.

In the .htaccess file in the diag/ folder, there is a very basic rewrite just to check that the feature is working
Code
RewriteEngine on

# Rewrite any file calls to the image directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !image/
RewriteRule ^(.+)$ image/$1 [L]
The above simply rewrites any file call to the image/ directory. For example diag/image.jpg basically will rewrite to diag/image/image.jpg, which is the physical location of the file.
 
cshetler
Topic Author
Posts: 21
Joined: 04 Feb 2008, 09:23

Re: IIS 8 Installation

19 Nov 2014, 15:13

After importing the diag re-write rule into IIS it appears that mod-rewrite is indeed working on the site per the diag image test.

What i did notice is that I cannot navigate to a specific gallery via the menu, eg. "Galleries > Test Gallery", the URL does not change but if I paste in the URL that it is supposed to go to eg http://x3.aaa-awards.com/galleries/Test/ the page loads.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: IIS 8 Installation

20 Nov 2014, 00:19

Yes it seems basic mod_rewrite is working, and we are definitely getting somewhere ... X3 is an ajax app, and needs to load pages in JSON format when links are clicked:
http://x3.aaa-awards.com/galleries/food/ WORKS
http://x3.aaa-awards.com/galleries/food.json 404 NOT FOUND

Should be:
https://www.photo.gallery/demo/x3/galleries/food.json

The htaccess rules that handle rewrite of the *.json request:
Code
# Rewrite any calls to *.html, *.json, *.xml, *.atom, *.rss, *.rdf or *.txt if a folder matching * exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !public/
RewriteCond %{DOCUMENT_ROOT}/public/$1.$2 !-f
RewriteRule (.+)\.(html|json|xml|atom|rss|rdf|txt)$ $1/ [L]
It is basically the 1st and 4th line you need to get working, the stuff with "public" on line 2+3 is not important ... Basically it checks if there is a file call to /anyfolder.json, and rewrites to anyfolder/ ... Then the app takes over from there.

If you can get that to work ...
 
cshetler
Topic Author
Posts: 21
Joined: 04 Feb 2008, 09:23

Re: IIS 8 Installation

20 Nov 2014, 10:11

Ok. I checked the re-write module rules, specifically the one pertaining to .json and have confirmed at least that part is working.

In your example http://x3.aaa-awards.com/galleries/food.json is the food.json supposed to be physical file that is created by X3 or is sort of rendered on the fly.

I ask because I have no .json files on my site that correlate to the galleries.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: IIS 8 Installation

20 Nov 2014, 10:36

cshetler wrote:In your example http://x3.aaa-awards.com/galleries/food.json is the food.json supposed to be physical file that is created by X3 or is sort of rendered on the fly.

I ask because I have no .json files on my site that correlate to the galleries.
This is just a rewrite of the URL so that it looks nice ... The file does not exist, just like technically the folder x3.aaa-awards.com/galleries/food does not exist either ... Just like these URLs, the path is simply rewritten to the application index, which handles it from there. X3 then intercepts the call, notes the path (galleries/food/), notes the extension (json), and then generates an appropriate output from the application template files.

To me, it does not seem like the call is rewritten at all, because the error simply says "file not found", and then notes the physical location. If it was being rewritten (but still not working for some reason), it should give another error message or incorrect output ...

Unfortunately, this part of the application was not created from scratch by myself, just like many other aspects of X3, and therefore my explanation may be a bit vague. I might be able to do some more research tomorrow, but right now my pile of todo's if growing rapidly, and my knowledge of setting up a specific windows server is limited ...

I suggest this: Create an index.html file simply with text "hello" in the x3 root, and create a rewrite rule that rewrites call anyfolder/anyname.json to the root / ... Then you can at least get your rule working unrelated to X3 first.
 
cshetler
Topic Author
Posts: 21
Joined: 04 Feb 2008, 09:23

Re: IIS 8 Installation

20 Nov 2014, 11:30

I created the re-write rule as suggested http://x3.aaa-awards.com/anyfolder/anyfile.json and that part is working.
It appears to me the script that you mention is not running
notes the extension (json), and then generates an appropriate output from the application template files.
I can't imagine how big your list of "todo's" is, I'll wait patiently for some additional insight into this issue. I'm sure that I can't be the only one that will be running this in a Windows environment.

At your convenience please let me know if there is any additional information that you might need from me to facilitate getting this issue resolved.

Cheers,

Chris S.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: IIS 8 Installation

21 Nov 2014, 04:28

I beed doing some research into this today. First of all, the following code in htaccess
Code
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+)\.(html|json|xml|atom|rss|rdf|txt)$ $1/ [L]
All it does, is rewrite to the same path, but without the extension (which is still stored in the request headers). For example:

https://www.photo.gallery/demo/x3/galleries/food.xml will rewrite to:
https://www.photo.gallery/demo/x3/galleries/food/

Then there is a rule further down the htaccess, which rewrites this to the application:
https://www.photo.gallery/demo/x3/galleries/food/ will rewrite to:
https://www.photo.gallery/demo/x3/index.php?/galleries/food/

From here, the Imagevue application takes over. In the example above, the extension is set to XML, which will be ignored by X3 because it has no correlating template assigned. However, in the case of JSON, there is a template assigned so it will output differently. This even works on on your server, so this is not related to the X3 application:
http://x3.aaa-awards.com/index.php?/galleries/food.json
(in the json output above, it does output "404" in the json, but this is just an example to show that the call itself does render properly in the PHP)

The problem with your server, is that the rewrite we have been working on, does not work (although you got the example working). If it was working, you would be able to check the following link, and it would just render like the normal page:
http://x3.aaa-awards.com/galleries/food.xml
https://www.photo.gallery/demo/x3/galleries/food.xml (as in our demo gallery)

As pointed out earlier, the rewrite just cuts off the extension, and adds a trailing slash (its that simple). On your server, it doesnt ... or you have wrong order in your rules, or you have colliding rules somehow.

Fix
I am quite interested in this issue, because I understand from after launching the beta that the more we can make ourselves independent from htaccess rules, especially mod_rewrite, the better. As explained above, the rewrite is basically just to make URL's look "nice", while this is also important for SEO. However, for ajax json calls, it does not really matter if the link is website.com/nice/name.json or website.com/?/ugly/name.json. As explained above, the following link:
https://www.photo.gallery/demo/x3/galleries/food.json simply rewrites to:
https://www.photo.gallery/demo/x3/index.php/ ... /food.json which is independent from htaccess rules.

Please get the following updated file stacey.inc.php and replace it on your server /app/stacey.inc.php. It should work like the example above, and allow us to load the json/ajax without accessing it through an URL that has to be re-written. It will not fix your website, because I would need to fix a few more things, but if the /?/page.json call works on your server, I will perhaps change it ...

The above does not change the fact that there must still be some issue in your htaccess file or your server. I can clearly see that the example redirect you made is working, but the original rewrite from /folder/name.json was not rewriting to /folder/name/, or it would output something else at least ...

I wouldn't mind accessing your server if you can offer FTP, but please update the file above first anyway!