After converting the Apache [.htaccess] file to an IIS compatible [web.config] file I got [500 - Internal server error.]
Turns out I needed to install the URL Rewrite module from: https://www.iis.net/downloads/microsoft/url-rewrite
After that I created the following web.config file using [Import Rules] option in IIS URL Rewrite with the .htaccess file from the root of my Trongate application. Here's the result...
I changed database.php config to the use IP address instead of localhost to get the XAMPP server.
database.php.
...and updated config.php for the BASE_URL, changing localhost to ip_addr:port.
At this point the site was returning error:
Thought to look at php.ini for settings related to MySQL, but didn't see anything there... does Trongate is PDO_MYSQL or MYSQLI? I'm pretty sure it's mysqli.
I thought to try phpMyAdmin from remote machine, which returned 403 Forbidden.
Changed in C:\xampp\phpMyAdmin\config.inc localhost to the IP address of XAMPP host:
Then the phpMyAdmin is giving same error when launching on the localhost as Trongate does on IIS.
From this I realize that 'root' user is only allowed to access from localhost. So I created a trongate user in the SQL server and finally the Trongate show up in my browser. However, it's not looking right. It should be showing the Haircut design template, but it's showing the default public template and there is an error.
Based on that error I'm guessing the URL rewriting isn't working properly. Not sure what to do at this point.
Publishing Trongate site to Microsoft IIS server
4 years ago
4 years ago
#1
4 years ago
#2
I think your error is in the permissions of mysql.
4 years ago
#3
Turns out that it was working. Came back with fresh eyes and noticed my index function was pointing to public instead of haircut. Was looking at the wrong instance of VS Code yesterday.
My original post is helpful for how to get Trongate working on IIS. The public template works and doesn't give any error after adding code suggested by DaFa from another post: https://trongate.io/help_bar/thread/KJjQ5tq9QcBW
This also works.
Now how do I mark this post answered by myself? ¯\_(ツ)_/¯
My original post is helpful for how to get Trongate working on IIS. The public template works and doesn't give any error after adding code suggested by DaFa from another post: https://trongate.io/help_bar/thread/KJjQ5tq9QcBW
This also works.
Now how do I mark this post answered by myself? ¯\_(ツ)_/¯
4 years ago
#4
Award to Dan for his effort to help ??
Or me, for giving the answer ? or just delete the thread.
The takeaway from this error is; that whenever you see 'view file doesn't exist...', the framework needs a bit of help. So it's always good practice to include
The same happens with custom routes.
Or me, for giving the answer ? or just delete the thread.
The takeaway from this error is; that whenever you see 'view file doesn't exist...', the framework needs a bit of help. So it's always good practice to include
The same happens with custom routes.
4 years ago
#5
Ran into a new issue with IIS.
Using XAMPP I'm able to change the root path so my new Trongate app is the root of my website by editing httpd.conf and adjusting the base_url in config.php. When I do this I can add /welcome or other /module_name to the URL and it works.
In ISS when I make the Trongatge app folder the root of the website and edit my config.php accordingly then only the main page works and any calls to modules in the URL results in 404 errors.
Using XAMPP I'm able to change the root path so my new Trongate app is the root of my website by editing httpd.conf and adjusting the base_url in config.php. When I do this I can add /welcome or other /module_name to the URL and it works.
In ISS when I make the Trongatge app folder the root of the website and edit my config.php accordingly then only the main page works and any calls to modules in the URL results in 404 errors.
4 years ago
#6
Not sure why you would want to point to the app and not the localhost.
I think that it is not working becasue of your URL segments.
Can you post your URL when you get the error.
Dan
I think that it is not working becasue of your URL segments.
Can you post your URL when you get the error.
Dan
4 years ago
#7
There's other issues too Dan, IIS needs a different install of PHP, non-thread safe vs Xampp which uses a thread safe version but I won't bother going into all that stuff.
4 years ago
#8
Dan,
The issue is when the app_name is no longer in the URL. Normally it is segment(1) after creating a new app. After changing the server's home folder to start in the app_name folder then it displays the index function in the Welcome module properly. However, adding module/function in URL results in error.
IIS - http://intranet:8070/welcome/hello - Results in 404 not found
XAMPP - http://vm1/welcome/hello - Results in 'Hello World'
Why do I want to do this? If I call my app 'intranet' then the URL will be, http://intranet/intranet, which doesn't look good. If I have to use app_name in segment(1) then I'll call my app 'main' and it will be http://intranet/main.
The issue is when the app_name is no longer in the URL. Normally it is segment(1) after creating a new app. After changing the server's home folder to start in the app_name folder then it displays the index function in the Welcome module properly. However, adding module/function in URL results in error.
IIS - http://intranet:8070/welcome/hello - Results in 404 not found
XAMPP - http://vm1/welcome/hello - Results in 'Hello World'
Why do I want to do this? If I call my app 'intranet' then the URL will be, http://intranet/intranet, which doesn't look good. If I have to use app_name in segment(1) then I'll call my app 'main' and it will be http://intranet/main.
4 years ago
#9
Did some more testing... went back to my first site that I got working on IIS, which is just the 'Haircut' design template. It turns out IIS won't execute module/method there either.
Both of these URL return a 404 not found.
While this URL displays the haircut template.
Both of these URL return a 404 not found.
While this URL displays the haircut template.
3 years ago
#10
Hey guys. I am running into this same issue but I see the web.config file was never posted here. Any ideas on how to setup the web.config file for an IIS host? Thanks for any help!
Edit: Only need a web.config file in your app root. The one in public doesn't seem to be necessary -
Edit 2: I was still having a couple css issues and it took me days of bashing my head to figure out how to make all the routing logic work seamlessly. You can thank me later but maybe someone has a better way as well. Same as above, no extra web.config needed in the public folder, just put this web.config in your app root -
Cheers
Edit 3: Was STILL having some issues. Spent more hours tweaking the file and everything is working much better now. Please in your app root directory -
Edit: Only need a web.config file in your app root. The one in public doesn't seem to be necessary -
Edit 2: I was still having a couple css issues and it took me days of bashing my head to figure out how to make all the routing logic work seamlessly. You can thank me later but maybe someone has a better way as well. Same as above, no extra web.config needed in the public folder, just put this web.config in your app root -
Cheers
Edit 3: Was STILL having some issues. Spent more hours tweaking the file and everything is working much better now. Please in your app root directory -