Hi all, I''m (STILL) plugging away trying to get rails to work under Apache2 Rails 0.9.5 Apache 2, OS Mandrake Linux 10.1 Apache is already running other stuff on /pluto/ and /localhost/ so I wish to install a new virtual host for rails to avoid upsetting anything. Added rails to my hosts file, and edited conf/Vhosts.conf to contain NameVirtualHost 192.168.0.254 <VirtualHost 192.168.0.254> ServerName pluto DocumentRoot /var/www/html </VirtualHost> <VirtualHost 192.168.0.254> ServerName rails DocumentRoot /var/www/rails/public ErrorLog /var/www/rails/log/apache.log <directory /var/www/rails/public/> Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi Order allow,deny Allow from all </Directory> </VirtualHost> I get the "congratulations you are on rails" message from http://rails/ But EVERYTHING else gives me a "not found" error. I strongly suspect the trouble is with Apache because when I run under weBrick, it all appears to work fine. There is nothing other than the WEBrick successes in the log files. What is going wrong? Where can I start to look? Regards Ian p.s In support of my thesis that it is Apache, I cannot get rails working in windows 2K either - also Apache2.
* Ian Hobson <ian.hobson-XZoyATsUNX5Wk0Htik3J/w@public.gmane.org> [0230 16:30]:> Hi all, > > I''m (STILL) plugging away trying to get rails to work under Apache2 > > Rails 0.9.5 Apache 2, OS Mandrake Linux 10.1 > Apache is already running other stuff on /pluto/ and /localhost/ so I wish > to install a new virtual host for rails to avoid upsetting anything. > > Added rails to my hosts file, and edited conf/Vhosts.conf to contain > > NameVirtualHost 192.168.0.254 > <VirtualHost 192.168.0.254> > ServerName pluto > DocumentRoot /var/www/html > </VirtualHost> > > <VirtualHost 192.168.0.254> > ServerName rails > DocumentRoot /var/www/rails/public > ErrorLog /var/www/rails/log/apache.log > <directory /var/www/rails/public/> > Options ExecCGI FollowSymLinks > AddHandler cgi-script .cgi > Order allow,deny > Allow from allStick ''AllowOverride All'' here> </Directory> > </VirtualHost> > > I get the "congratulations you are on rails" message from http://rails/ > > But EVERYTHING else gives me a "not found" error.-- ''The pie is ready. You guys like swarms of things, right?'' -- Bender Rasputin :: Jack of All Trades - Master of Nuns
On Sunday 13 Feb 2005 20:54, Dick Davies wrote:> * Ian Hobson <ian.hobson-XZoyATsUNX5Wk0Htik3J/w@public.gmane.org> [0230 16:30]: > > Hi all, > >> > > > <VirtualHost 192.168.0.254> > > ServerName rails > > DocumentRoot /var/www/rails/public > > ErrorLog /var/www/rails/log/apache.log > > <directory /var/www/rails/public/> > > Options ExecCGI FollowSymLinks > > AddHandler cgi-script .cgi > > Order allow,deny > > Allow from all > > Stick > > ''AllowOverride All'' > > here > > > </Directory> > > </VirtualHost> > >Thanks for that Dick. It has enabled me to make a little progress, I now have progressed to the point where I enter http://rails/recipe/new and get a reply that starts..... Errno::ENOENT in Recipe#new No such file or directory - /tmp/mysql.sock Show framework trace /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql411.rb:43:in `initialize'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql411.rb:43:in `new'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql411.rb:43:in `real_connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql.rb:91:in `initialize'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql.rb:1084:in `new'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql.rb:1084:in `real_connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/connection_adapters/mysql_adapter.rb:36:in `mysql_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/connection_adapters/abstract_adapter.rb:148:in `send'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/connection_adapters/abstract_adapter.rb:148:in `connection='' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/connection_adapters/abstract_adapter.rb:112:in `retrieve_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/base.rb:195:in `connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/base.rb:202:in `connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/base.rb:1163:in `attributes_from_column_definition'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/base.rb:782:in `initialize_without_callbacks'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/callbacks.rb:224:in `initialize'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/scaffolding.rb:118:in `new'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/scaffolding.rb:118:in `new'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:607:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:607:in `perform_action_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/filters.rb:294:in `perform_action_without_benchmark'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/benchmarking.rb:30:in `measure'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/rescue.rb:75:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:274:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:274:in `process'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:252:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-0.9.5/lib/dispatcher.rb:40:in `dispatch'' /var/www/rails/public/dispatch.cgi:10 Looking at the source, this appears to be when creating the UnixSocket to talk to the SQL Server. When I telnet to localhost port 3306 I get a prompt - so MySQL is there, reachable from localhost. What is happening? Regards Ian
On Sun, 13 Feb 2005 22:28:06 +0000, Ian Hobson <ian.hobson-XZoyATsUNX5Wk0Htik3J/w@public.gmane.org> wrote:> On Sunday 13 Feb 2005 20:54, Dick Davies wrote: > > * Ian Hobson <ian.hobson-XZoyATsUNX5Wk0Htik3J/w@public.gmane.org> [0230 16:30]: > > > Hi all, > > > > > > > > > > <VirtualHost 192.168.0.254> > > > ServerName rails > > > DocumentRoot /var/www/rails/public > > > ErrorLog /var/www/rails/log/apache.log > > > <directory /var/www/rails/public/> > > > Options ExecCGI FollowSymLinks > > > AddHandler cgi-script .cgi > > > Order allow,deny > > > Allow from all > > > > Stick > > > > ''AllowOverride All'' > > > > here > > > > > </Directory> > > > </VirtualHost> > > > > Thanks for that Dick. It has enabled me to make a little progress, > > I now have progressed to the point where I enter > > http://rails/recipe/new > > and get a reply that starts..... > > Errno::ENOENT in Recipe#new > > No such file or directory - /tmp/mysql.sockIf you''re in control of this server, the easiest fix is to add a symlink from /tmp/mysql.sock to the actual location of mysql.sock for your installation. If you''re not in control, try setting the hostname to your hostname rather than localhost so mysql uses TCP/IP to connect. I''m sure there''s some clever way to point to the correct location of mysql.sock but I don''t know it.> Show framework trace > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql411.rb:43:in > `initialize'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql411.rb:43:in > `new'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql411.rb:43:in > `real_connect'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql.rb:91:in > `initialize'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql.rb:1084:in > `new'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/vendor/mysql.rb:1084:in > `real_connect'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/connection_adapters/mysql_adapter.rb:36:in > `mysql_connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/connection_adapters/abstract_adapter.rb:148:in > `send'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/connection_adapters/abstract_adapter.rb:148:in > `connection='' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/connection_adapters/abstract_adapter.rb:112:in > `retrieve_connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/base.rb:195:in > `connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/base.rb:202:in > `connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/base.rb:1163:in > `attributes_from_column_definition'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/base.rb:782:in > `initialize_without_callbacks'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/callbacks.rb:224:in > `initialize'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/scaffolding.rb:118:in > `new'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/scaffolding.rb:118:in > `new'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:607:in > `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:607:in > `perform_action_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/filters.rb:294:in > `perform_action_without_benchmark'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/benchmarking.rb:30:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/benchmarking.rb:30:in > `measure'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/benchmarking.rb:30:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/rescue.rb:75:in > `perform_action'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:274:in > `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:274:in > `process'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/action_controller/base.rb:252:in > `process'' > /usr/lib/ruby/gems/1.8/gems/rails-0.9.5/lib/dispatcher.rb:40:in `dispatch'' > /var/www/rails/public/dispatch.cgi:10 > > Looking at the source, this appears to be when creating the UnixSocket to talk > to the SQL Server. > > When I telnet to localhost port 3306 I get a prompt - so MySQL is there, > reachable from localhost. > > What is happening? > > Regards > > Ian > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz
> I''m sure there''s some clever way to point to the correct location of > mysql.sock but I don''t know it.In your database.yml, add: socket: /path/to/mysql.socket To the original poster: Your cries for help would meet a warmer reception if it didn''t come riding on a trollish, calamitistic wave of bad will. Sounds like the majority of your problems relate to installing MySQL and Apache on your machine. I reckon starting with WEBrick for a zero-config server and possibly SQLite for the database. Then you can move onto Apache and MySQL when you''ve grown accustomed to the tools. -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://www.loudthinking.com/ -- Broadcasting Brain
Quoting Michael Koziarski <koziarski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> I''m sure there''s some clever way to point to the correct location of > mysql.sock but I don''t know it.In config/database.yml: development: adapter: mysql ... socket: /path/to/mysql.sock Tim. -- Tim Bates tim-kZbwfhiKUx26c6uEtOJ/EA@public.gmane.org
On Sunday 13 Feb 2005 22:56, Tim Bates wrote:> Quoting Michael Koziarski <koziarski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > I''m sure there''s some clever way to point to the correct location of > > mysql.sock but I don''t know it. > > In config/database.yml: > > development: > adapter: mysql > ... > socket: /path/to/mysql.sock >Thanks Tim, Dave I have now created the link - before this came through, and it does not cure the problem. Before I edit database.yml, should I remove the link, and how can I remove it? ln does not have an unlink option. Thanks Ian> Tim. > > -- > Tim Bates > tim-kZbwfhiKUx26c6uEtOJ/EA@public.gmane.org > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails