I''ve tried a bunch of things trying to get ruby/apache2 and php working together. I looked over my earlier post and followed the instructions on ezra''s website to install lighttpd on debian. I''ve gotten really far but I think there is one bit missing: 1. I got apache2 and php working together 2. I got lighttpd working on port 3000 and my rails app launches ok there So at this stage, both PHP and Ruby are on the same server except that ruby is on port 3000 while the rest is going on port 80. 3. I copied/pasted this vhost section into my apache2/sites-enabled folder in order to pass the sites that will be using ruby to lighttpd <VirtualHost *:80> ServerName example.com ServerAlias www.example.com #ProxyPreserveHost on #<-apache2 only ProxyPass / http://example.com:8000/ ProxyPassReverse / http://example.com:8000/ </VirtualHost> changing the example.com to my URL. 4. I got an error so I used a2enmod proxy. Stopped and restarted apache2 5. After doing that when I go to my URL I get a 403 error: Forbidden In fact, I can''t go to any IP/URL on that server without seeing a 403. So even the PHP stuff broke at that stage. It''s linked to the ProxyPass statements somehow. I''ve tried messing with proxy.conf in my apache2/mods-enabled folder but that didn''t seem to do anything. I also changed lighttpd.conf to run on port 8000 in case that was the error but that also didn''t change anything. So now I''m at the stage where if I keep the proxy module I get the 403 error and if I don''t I can get to my PHP stuff, but can''t get to my rails app. Is there some last step I''m missing? -- Posted via http://www.ruby-forum.com/.
On Dec 7, 2005, at 7:41 PM, Vince W. wrote:> > I''ve tried a bunch of things trying to get ruby/apache2 and php > working > together. I looked over my earlier post and followed the instructions > on ezra''s website to install lighttpd on debian. I''ve gotten > really far > but I think there is one bit missing: > > 1. I got apache2 and php working together > 2. I got lighttpd working on port 3000 and my rails app launches ok > there > > So at this stage, both PHP and Ruby are on the same server except that > ruby is on port 3000 while the rest is going on port 80. > > 3. I copied/pasted this vhost section into my apache2/sites-enabled > folder in order to pass the sites that will be using ruby to lighttpd > > <VirtualHost *:80> > ServerName example.com > ServerAlias www.example.com > #ProxyPreserveHost on #<-apache2 only > ProxyPass / http://example.com:8000/ > ProxyPassReverse / http://example.com:8000/ > </VirtualHost> >I use apache 1.3.x so the vhost was mainly for that version. But after taking a look to see what the preferred way to do this on apache2 is I cam up with this that is better for apache2: <VirtualHost *:80> ServerAdmin webmaster-AQhkE3IkomUVpVtQvJkt/w@public.gmane.org ServerName example.com:80 ProxyRequests Off ProxyPreserveHost On RewriteEngine On RewriteRule ^/(.*) http://127.0.0.1:3000/$1 [P,L] ProxyPassReverse / http://127.0.0.1:3000/ </VirtualHost> HTH- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
On 08/12/05, Ezra Zygmuntowicz <ezra-SD1UcFUIF7QjH4SCZfkgnw@public.gmane.org> wrote:> > <VirtualHost *:80> > > ServerName example.com > > ServerAlias www.example.com > > ProxyPass / http://example.com:8000/ > > ProxyPassReverse / http://example.com:8000/ > > </VirtualHost>> I use apache 1.3.x so the vhost was mainly for that version. But > after taking a look to see what the preferred way to do this on > apache2 is I cam up with this that is better for apache2:Sorry, how is that better? You''re just using mod_rewrite to do the same thing as the ''proxypass'' directive.> <VirtualHost *:80> > ServerAdmin webmaster-AQhkE3IkomUVpVtQvJkt/w@public.gmane.org > ServerName example.com:80 > ProxyRequests Off > ProxyPreserveHost On > RewriteEngine On > RewriteRule ^/(.*) http://127.0.0.1:3000/$1 [P,L] > ProxyPassReverse / http://127.0.0.1:3000/ > </VirtualHost>-- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
On Dec 9, 2005, at 4:23 AM, Dick Davies wrote:> On 08/12/05, Ezra Zygmuntowicz <ezra-SD1UcFUIF7QjH4SCZfkgnw@public.gmane.org> wrote: > >>> <VirtualHost *:80> >>> ServerName example.com >>> ServerAlias www.example.com >>> ProxyPass / http://example.com:8000/ >>> ProxyPassReverse / http://example.com:8000/ >>> </VirtualHost> > >> I use apache 1.3.x so the vhost was mainly for that version. But >> after taking a look to see what the preferred way to do this on >> apache2 is I cam up with this that is better for apache2: > > Sorry, how is that better? You''re just using mod_rewrite to do the > same thing as the ''proxypass'' directive. > >> <VirtualHost *:80> >> ServerAdmin webmaster-AQhkE3IkomUVpVtQvJkt/w@public.gmane.org >> ServerName example.com:80 >> ProxyRequests Off >> ProxyPreserveHost On >> RewriteEngine On >> RewriteRule ^/(.*) http://127.0.0.1:3000/$1 >> [P,L] >> ProxyPassReverse / http://127.0.0.1:3000/ >> </VirtualHost> >Well the only reason it is better is that it works while the old way doesn''t ;-) So thats good enough for me. Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org