Request routing for apache and iis server - php

I am running my website(www.example.com) using IIS server. Now my requirement is to run website (www.example.com) from Apache Server for PHP and www.example.com/XYZ url from IIS server for ASP .NET.
is this routing possible?

Do you mean on the same Windows Server? On port 80?
I think it's not possible to run two services on one port. The server has to process an incoming request on port 80 before deciding which service it is routed to, and then each service has to accept the request before resolving the domain name. The server and services and no way of knowing which process the request is meant for before it's too late.
If you don't mind running one of the web services on a non-standard port, it should work. Have you tried?

You can use the reverse proxy function on apache.
a2enmod proxy proxy_http
and then route /XYZ to the IIS server (or IIS port) in the apache config
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ProxyPass /XYZ http://old.iis.server/
ProxyPassReverse /XYZ http://old.iis.server/
</VirtualHost>
restart apache and it should work fine.
Edit:
If it has to be on the same physical machine, IIS must be "moved" to another port. Both services can't bind to port 80(HTTP)/443(HTTPS). This is simply impossible. One port - one service.
So, change the port of the IIS-Server to e.g. 8080 (HTTP) and 8443 (HTTPS)
and use
ProxyPass /XYZ http://localhost:8080/
ProxyPassReverse /XYZ http://localhost:8080/

Related

how to access virtual host set in vagrant

I am having debian vagrant. I have done virtual host configuration in its apache as servername https:local-dev02.sitename.com. And used in my windows machine host file 127.0.0.1 local-dev02.sitename.com.
I can access my site in windows' browser as https://local-dev02.sitename.com:8443/.
But I am unable to do
ping https://local-dev02.sitename.com
OR
curl https://local-dev02.sitename.com
OR
wget https://local-dev02.sitename.com
It is only possible to ping a hostname or IP address, but not an URL. So you need to put off the protocol like so
ping local-dev02.sitename.com
To reach your hosts via the hostnames, please add the IPs and hostnames to the /etc/hosts file.

How to change bitnami redmine default URL

Hi I have installed bitnami redmine to use agile.when ever I am writing localhost/ or 127.0.01/ it is accessing bitnami home page to link for redmine.
I want to change it so that it can be used with proper port number , for example i am thinking to give port 1234, so that localhost:1234 will be my address for it.
I have seen and tried {HOME}/apps/redmineplusagileconf/httpd-prefix , to change the access for redmine , but still not able to change the access with custome port.
Any suggestion would help me.
HTTP Port
Under the default configuration, Apache will wait for requests on port 80. Change that by editing the httpd.conf file and modifying the value specified in the Port directive. For example:
Listen 1234
ServerName localhost:1234
Also change the port in installdir/apache2/conf/bitnami/bitnami.conf in the VirtualHost directive:
<VirtualHost _default_:1234>
HTTPS Port
Apache waits for HTTPS requests on port 443. Change that by editing the installdir/apache2/conf/bitnami/bitnami.conf file and modifying the value specified in the Port directive. For example:
Listen 8443
<VirtualHost _default_:8443>
In both cases, restart the Apache server for the change to take effect:
sudo installdir/ctlscript.sh restart apache
NOTE: On Linux and OS X platforms, install the stack as the root user
to use a port number under 1024.

PhpStorm - Debugger not listening with proxy

I'm using Mac OSX.
I have a docker machine on IP 192.168.99.100 which listening to port 8080 and forward to traffic to my Ubuntu container.
The Ubuntu container has Apache and PHP installed in it.
When i'm adding a break point to my php file, a cookie with debug session to my request and set the listening to debug session in my PhpStorm to work - browsing to 192.168.99.100:8080/my/path/to/php/file trigger a breakpoint.
I add a forwarding in my apache vhost config file so I could browse to:
localhost:8080/my/path/to/php/file
browsing works perfectly, but the debugging is not being triggered.
Running:
var_dump($_COOKIE);
shows that the cookie was forward during the apache proxy process.
This is my apache config:
<VirtualHost *:8080>
ProxyPass / http://192.168.99.100:8080/
ProxyPassReverse / http://192.168.99.100:8080/
ProxyPassReverseCookiePath / http://192.168.99.100:8080/
</VirtualHost>
Listen 8080
Listen 127.0.0.1:8080
What am I doing wrong?

Virtual Host for wamp server running in port 85

We have dedicated windows server where IIS running in :80 and Wamp running in :85.
I successfully created a Virtual Host for wamp server which is running in :85.
NameVirtualHost *:85
<VirtualHost *:85>
ServerName www.my.tv
ServerAlias my.tv
DocumentRoot C:/wamp/www/alpha
ErrorLog "C:/wamp/www/alpha/logs/error.log"
CustomLog "C:/wamp/www/alpha/logs/access.log" common
</VirtualHost>
yes the above code is working & site is running only when i hit www.my.tv:85 but not in www.my.tv
can someone advice on the above where i could configure to make the site run at www.my.tv
If you configure Apache to serve your site on port 85 then the browser (which will default to port 80) won't find it unless you give it the port number it needs.
If you need to see the site on port 80 then you need to configure it on that port. Since you have another server running on that port it's not an option.
One possibility is that you create a virtual site on your IIS server for www.my.tv, but have it redirect to the site on port 85. You can do this in the properties box, on the Home Directory tab.

Ubuntu Xampp access localhost from other pc

I am trying to access my localhost from another computer using the local IP(192.168...)
The problem is that I get access forbidden.
I changed the httpd-xampp-conf and it looks like the following:
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-st$ver- status|server-info))">
Order deny,allow
Allow from all
Allow from ::1 127.0.0.0/8 \
fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
fe80::/10 169.254.0.0/16
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
But still no luck...Any ideas..??
Whenever people on a linux system mention pre-packaged development environments I scream "ARRRRGHHHHHHH" at them and tell them that their computer is capable of running the same environment as production. Why are you running anything else?
sudo apt-get install php5 apache2 mysql
XAMPP is pretty terrible for dev environments. Set up an actual environment for your code; the experience is worth it.
Regardless, your issue is that XAMPP is bound to localhost, or 127.0.0.1. Change Listen 127.0.0.1:80 to Listen 80.
You could also try forwarding traffic, but that is a little bit overkill.
Also, your internal network (192.168.0.0/16) is only as secure as your router. If you feel comfortable allowing it, just bind XAMPP to your internal network address instead of 127.0.0.1 and allow everything globally. It'll save you a headache if you use different machines regularly.

Categories