I'm running an Apache HTTP Server on IBM i and I'm currently facing a problem accessing web services from a virtual host.
I've been playing around with the configurations of the server a while, tried lots of things, however I can't make it work. A GET
-Request throws an 405 Method Not Allowed error immediately. The static content of the app stored in the sub-directory of the root directory is getting showed.
This is my httpd.conf
file:
LoadModule mod_ibm_lwi /QSYS.LIB/QHTTPSVR.LIB/QLWIIHSMOD.SRVPGM
HotBackup Off
KeepAlive Off
DocumentRoot /www/server/htdocs
AddLanguage en .en
LogMaint logs/error_log 7 0
LogFormat "%h %T %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
Listen *:10123
<Location />
Require all granted
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST,GET,OPTIONS,DELETE,PUT"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, Origin, Authorization, accept, client-security-token"
Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location"
Header always set Access-Control-Max-Age "3600"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
</Location>
LoadModule was_ap20_module /QSYS.LIB/QHTTPSVR.LIB/QSVTAP24.SRVPGM
WebSpherePluginConfig /www/server/conf/ias-plugin-cfg.xml
<LwiProfile server>
LwiAutostartOption StartEnd
</LwiProfile>
<VirtualHost app:10123>
ServerName www.server.app.com
DocumentRoot /www/server/htdocs/app
<Directory /www/server/htdocs/app>
AllowOverride None
Require all granted
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location"
Header always set Access-Control-Max-Age "3600"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
</Directory>
</VirtualHost>
<VirtualHost app-2:10123>
ServerName www.server.app-2.com
DocumentRoot /www/server/htdocs/app-2
</VirtualHost>
HTTPSubsystemDesc QHTTPSVR/QHTTPSVR
HTTPStartJobDesc QGPL/QDFTSVR
HTTPStartJobQueue QHTTPSVR/QZHBHTTP
HTTPRoutingData HTTPWWW
I can't simply figure it out why it's not working. Any help would be highly appreciated.
UPDATE: I've also followed the directions given in the comments below and changed the configuration multiple times, however the api still doesn't get fired.
Many thanks in advance.