Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Norm Scherer
RE: mysql with a password [ reply ]  
2012-08-15 00:16
Passenger is an add on module for apache2. It allows you to define a virtual host which will run a rails application. As an example I have defined on one of my hosts (in /etc/hosts)
127.0.0.1 localhost server OCtest
and then in /etc/apache2/sites-available have the following virtual host defined in a file named OCtest:
<VirtualHost *:80>
<Directory "/home/nsche/OCtest">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ServerName OCtest
RailsEnv development
DocumentRoot "/home/nsche/OCtest/public"
PassengerRestartDir tmp
LogLevel warn
</VirtualHost>

Now from a system that knows about OCtest (from hosts, I don't bother with dns in my local env) I just go to http://OCtest and there is my rails system. I can define as many of these virtual hosts as needed (within the resources of the server). Google 'phusion passenger' for details.

By: Mark Clayton
RE: mysql with a password [ reply ]  
2012-08-14 22:56
Thanks Norm,

I applied the changes you posted and reset the db. It's up and running now. Thanks again.

Thanks also for the pointer. I'm just evaluating right now but will probably try to roll my own cloud eventually. I was a C & linux/unix programmer for 13 years. I know html and PHP well too. I have no experience with Ruby/Rails. I've used Apache for a long time but have never heard of passenger? Can you briefly tell me what it is and how it fits into the system?

Thanks,
Mark Clayton

By: Norm Scherer
RE: mysql with a password [ reply ]  
2012-08-14 18:11
Just a little more info. I use ubuntu boxes for my development and testing (and for the cloud also). I did package some scripts that will work to start the system automaticly on boot but I find using apache2 and passenger with virtual hosts gives me a system requiring minimal support. I recommend passenger with either apache2 or nginx for running the system.

Good luck
Norm

By: Norm Scherer
RE: mysql with a password [ reply ]  
2012-08-12 18:13
Look in config for database.yml. That file has a section like this:

defaults: &defaults
adapter: mysql
encoding: utf8
reconnect: false
pool: 5
username: root
password:
host: localhost

Just edit it to put in the username and password that work for you. You should be able to then do a 'rake db:reset' or 'RAILS_ENV=production rake db:reset' and you will be good to go.

Enjoy
Norm

By: Mark Clayton
mysql with a password [ reply ]  
2012-08-10 20:01

I'm trying to install OC on an Ubuntu box. I was able to run the unit test scripts and start up the server script. However, my mysql was installed with a password so it dumps on not being able to access the database. What do I need to do to oc run it with a mysql password?

Thanks,
Mark