sabkaraja wrote:In my ideal world, xampp should be on some other port (or subdomain), where as php and rails on the 80 port.
But that is impossible, you have a wrong understanding of the software architecture of xampp:
a) xampp is nothing, only an abbreveation for a software collection
b) php is an interpreter running in a webserver
c) xampp delivers Apache and PHP, where Apache is the webserver
d) Apache is running on certain ports and triggers PHP scripts. PHP is *not* running on certain ports.
Therefore, you cannot run "xampp" (you obviously mean Apache) on some port, and php on another port. PHP runs beyond Apache.
If you succeed to run rails without mongrel, instead under Apache, there will be no problem to run all the tools together on the same port 80 (which is the default port for HTTP Protocoll).
If you need mongrel for rails and want to run PHP on Port 80, you must
a) run mongrel on a different port than 80 (for example 8080, or just viceverse as you did, run mongrel under port 3000).
b) create a virtualhost in apache (for example rails.mydomain.com)
c) configure a Reverse Proxy for that Virtualhost, which eveluates all requests on the mongrel server. This may look similar to that:
- Code: Select all
<VirtualHost ...>
ServerName rails.mydomain.com
...
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
...
</VirtualHost>
In that environment, Apache is acting like a proxy for the request to rails.
Instead of creating a VirtulHost, you also may create a ReverseProxy for a certain folder, for example ./rails. Then simply create the proxy for your standard domain, only for /rails folder:
- Code: Select all
ProxyPass /rails/ http://localhost:3000/
ProxyPassReverse /rails/ http://localhost:3000/
The rails server will then be accessed via
http://www.youdomain.com/rails/