EIP Manager Guillaume Joye Technical Documentation 2011_TD1_EN_RESASYSTEM.docx FA/EIP/FR/ET/002 Version 2.0 Ept4 Sommaire Application diagram p.3 Flux diagram p.4 Interaction description p.5 Installation manual p.6 Bug references p.11 References .11 DB schema p.12 2 Application diagram Members Customers 3 Flux diagram Application flux are the same for every website of this kind, there is the connexion time, the analysis of the user’s rights and the différents actions possible thanks to this rights. 4 Interaction description Each users connects to be able to do search, he fill different things wich sort the ads posted by the owners. When rooms are find, the book is effective and with the grant of the owner, user pay for it. 5 Installation manual Windows package Folder description - MySQL contains the MySQL database server installer - PostgreSQL contains the PostgreSQL database server installer - Ruby contains the Ruby environment all required RubyGems all required DLLs for Ruby - resasystem contains ResaSystem Installation/Configuration MySQL Installation: - Launch the installer in the folder - when asked choose "Typical" installation type - Next/Install - On "Wizard Completed" screen check only "Configure the MySQL Server now" - configuration wizard opens - Choose "Detailed configuration" - Choose "Server Machine" - Choose "Multifunctional Database" - Choose InnoDB path (you can leave the default setting) - Choose "Decision Support" - Leave "TCP/IP Networking" and "Enable Strict Mode" checked - Choose "Manual Seelcted Default Character Set" and set it to "utf8" - Leave "Install As Windows Service" checked and check Include Bin Directory in Windows PATH" - set root password - Next/Execute/Finish Configuration: - In Windows "Start" menu, launch MySQL > MySQL Server > MySQL Command Line Client - Prompt window opens, type in the root password choosen during the installation - mysql prompt appears - to create 'resasystem' database and user 6 mysql> CREATE DATABASE resasystem; mysql> USE mysql; mysql> CREATE USER 'resasystem'@'localhost' IDENTIFIED BY 'choose_a_password'; mysql> GRANT SELECT, UPDATE, INSERT, DELETE, CREATE, DROP, ALTER, INDEX, TRIGGER -> ON resasystem.* TO 'resasystem'@'localhost'; if MySQL is already installed and you need to recover the root password - Stop your MySQL server completely. This can be done by accessing the Services window inside Windows XP and Windows Server 2003, where you can stop the MySQL service. - Open your MS-DOS command prompt using "cmd" inside the Run window. Inside it navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command. - Execute the following command in the command prompt: mysqld.exe -u root --skip-granttables - Leave the current MS-DOS command prompt as it is, and open a new MS-DOS command prompt window. - Navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command. - Enter "mysql" and press enter. - You should now have the MySQL command prompt working. Type "use mysql;" so that we switch to the "mysql" database. mysql> USE mysql; mysql> UPDATE user SET Password = PASSWORD('new password here') WHERE User = 'root'; - create 'resasystem' database and user if needed - Close both prompt windows, relaunch the MySQL service PostgreSQL Installation: - Launch the installer - Choose paths - set postgres account password - Choose the port if needed - Choose the locale if needed - Uncheck "Launch Stack Builder as exit" - Finish Configuration: - In Windows "Start" menu, launch PostgreSQL > pgAdmin - right click on localhost server on the left > "connect" - put in the postgres password - expand the server - right click on "Login Roles" > "New Login Role" Role Name : resasystem Choose password OK - right click on "Databases" > "New database" 7 Name : resasystem Owner: resasystem Encoding: UTF8 OK To recover postgres passwrord - edit pg_hba.conf (by default in C:\Program Files\PostgreSQL\8.3\data) change line "host all all 127.0.0.1/32 md5" to "host all all 127.0.0.1/32 trust" - in Start menu > PostgreSQL > Reload Configuration - in Start menu > PostgreSQL > pgAdmin - right click on the local server, connect, leave password field blank - right click on "postgres" in "Login Roles" > "Properties..." - change the password, "OK" - close pgAdmin - revert pg_hba.conf file - restart PostgreSQL server Ruby Launch the installer - Check Enable RubyGems - Choose path if needed - Finish the installation - In the "Start" menu, Ruby > RubyGems > RubyGems Package Manager - prompt window opens - with Internet connection Ruby> gem install rubygems-update Ruby> update_rubygems Ruby> gem update --system Ruby> gem update Ruby> gem install --no-ri --no-rdoc <gem_name> (when required, with -v=needed_version) gems to install: - rails 2.3.5 - mysql - ruby-postgres - sqlite3-ruby - rack 1.0.1 - without Internet Ruby> gem install --no-ri --no-rdoc "path to ResaSystem-Xwin32\Ruby\RS_win_rubygems_sysupdate\rubygems-update-1.3.6.gem" Ruby> update_rubygems Ruby> gem install --no-ri --no-rdoc "path to ResaSystem-Xwin32\Ruby\RS_win_rubygems_sysupdate\*.gem" Ruby> gem install --no-ri --no-rdoc "path to ResaSystem-Xwin32\Ruby\RS_win_rubygems\*.gem" 8 - Copy all the DLLs from ResaSystem-X-win32\Ruby\RS_win_rubydlls\ to C:\Ruby\bin ResaSystem - copy somewhere resasytem folder - go to resasystem\config - choose the database.dbtype.yml file depending on the database you are using - replace the original database.yml with yours - edit the database.yml - change the connection section accordingly to the configuration of the database - in windows command prompt prompt> cd "path to resasystem" resasystem> rake db:schema:load resasystem> "path to ruby.exe" script\server ruby.exe default path : C:\Ruby\bin server should start - in a web browser open http://localhost:3000 Debian package Folder description - Debian contains the necesseray packages - Ruby contains the necessary Ruby gems - resasystem contains ResaSystem Installation/Configuration MySQL To recover MySQL root password, as system root do the following in a terminal - stop the mysql daemon #/etc/init.d/mysql(d) stop - relaunch the daemon with new option #mysqld --skip-grant-tables & - launch mysql prompt #mysql mysql> USE mysql; mysql> UPDATE user SET Password = PASSWORD('new password here') WHERE User = 'root'; create 'resasystem' database and user if needed - relaunch the daemon #/etc/init.d/mysql(d) restart or #/etc/init.d/mysql(d) stop #/etc/init.d/mysql(d) start 9 PostgreSQL To recover PostgreSQL password, as root log in as postgres #su - postgres as postgres user, launch PosgreSQL prompt $psql -d template1 template1=# ALTER USER postgres WITH PASSWORD 'new password'; template1=# \q Ruby install as root #dpkg -i Debian/debs/*.deb #gem install --no-ri --no-rdoc rubygems-update.gem #/var/lib/gems/1.8/bin/update_rubygems #gem install --no-ri --no-rdoc Ruby/gems/*.gem ResaSystem - copy somewhere resasystem folder - go to resasystem\config - choose the database.dbtype.yml file depending on the database you are using - replace the original database.yml with yours - edit the database.yml - change the connection section accordingly to the configuration of the database - in a terminal, navigate to resasystem folder $ cd path/to/resasystem $ rake db:schema:load $ ruby script/server server should start - in a web browser open http://localhost:3000 10 Bugs references - Bug Gem « Devise » : - When user try to login in the member part of the website with a Customer account, if he select « log as member » the redirection target « after_sign_in_path_for » and then crash the application. Bug Gem « Paperclip » : This gem doesn’t work on Windows and there is a problem on the configuration file when using « imagemagick ». References - Official website of the ruby langage: http://www.ruby-lang.org/fr/. - Documentations of the Framework Ruby-on-Rails : http://rubyonrails.org/ . - Documentations of the développement manager application Github : http://help.github.com/ - Documentations of the hosting website for rails application Heroku: : http://docs.heroku.com/ - Official documentation of the web development environment Aptana : http://docs.aptana.com/docs/index.php/Main_Page - Website with many Podcast about Ruby-on-rails development : http://railscasts.com/ 11 DB Scheme 12