Description:
Update README.rdoc Fix some typo about database name. add number to each step
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r727:8cef8d08de9b - - 1 file changed: 11 inserted, 9 deleted

@@ -1,115 +1,117
1 == Installation
1 == Installation
2
2
3 Installing cafe-grader can be done in the following steps.
3 Installing cafe-grader can be done in the following steps.
4
4
5 1. Set up database. We need MySQL 5 database name, username and password.
5 1. Set up database. We need MySQL 5 database name, username and password.
6 2. Install RVM. cafe-grader runs on Ruby on Rails and the best way to install it is to use RVM.
6 2. Install RVM. cafe-grader runs on Ruby on Rails and the best way to install it is to use RVM.
7 3. Install necessary package for the system
7 3. Install necessary package for the system
8 4. Install cafe-grader from github
8 4. Install cafe-grader from github
9 5. Deploy cafe-grader on apache with Phusion Passenger
9 5. Deploy cafe-grader on apache with Phusion Passenger
10
10
11 + Very important!!! All commands should be run from a normal user.
12 +
11 The detail of each step are provided as follows.
13 The detail of each step are provided as follows.
12
14
13 - === Install MySQL 5
15 + === 1. Install MySQL 5
14
16
15 Install MySQL server for the server.
17 Install MySQL server for the server.
16
18
17 cafe@grader:~$ sudo apt install mysql-server
19 cafe@grader:~$ sudo apt install mysql-server
18
20
19 - Next, we will connect to mysql as root and set up the database. You can choose your DATABASENAME, USERNAME and PASSWORD.
21 + Next, we will connect to mysql as root and set up the database. You can choose your DATABASENAME, USERNAME and PASSWORD as you wish.
20
22
21 cafe@grader:~$ sudo mysql -u root
23 cafe@grader:~$ sudo mysql -u root
22
24
23 mysql> create database DATABASENAME;
25 mysql> create database DATABASENAME;
24 Query OK, 1 row affected (0.00 sec)
26 Query OK, 1 row affected (0.00 sec)
25
27
26 - mysql> grant all privileges on grader.* to USERNAME@localhost identified by 'PASSWORD';
28 + mysql> grant all privileges on DATABASENAME.* to USERNAME@localhost identified by 'PASSWORD';
27 Query OK, 0 rows affected, 1 warning (0.00 sec)
29 Query OK, 0 rows affected, 1 warning (0.00 sec)
28
30
29 mysql> flush privileges;
31 mysql> flush privileges;
30 Query OK, 0 rows affected (0.00 sec)
32 Query OK, 0 rows affected (0.00 sec)
31
33
32 - === Install RVM
34 + === 2. Install RVM
33
35
34 Since Ubuntu has dedicated package for RVM we will use that. Just follow instruction given in https://github.com/rvm/ubuntu_rvm. For your convenience, the step are reproduced here.
36 Since Ubuntu has dedicated package for RVM we will use that. Just follow instruction given in https://github.com/rvm/ubuntu_rvm. For your convenience, the step are reproduced here.
35
37
36 First, we install necessary package for installing RVM.
38 First, we install necessary package for installing RVM.
37
39
38 cafe@grader:~$ sudo apt install software-properties-common
40 cafe@grader:~$ sudo apt install software-properties-common
39
41
40 Second, we add the custom PPA, update the system and install RVM.
42 Second, we add the custom PPA, update the system and install RVM.
41
43
42 cafe@grader:~$ sudo apt-add-repository -y ppa:rael-gc/rvm
44 cafe@grader:~$ sudo apt-add-repository -y ppa:rael-gc/rvm
43 cafe@grader:~$ sudo apt-get update
45 cafe@grader:~$ sudo apt-get update
44 cafe@grader:~$ sudo apt-get install rvm
46 cafe@grader:~$ sudo apt-get install rvm
45
47
46 This is very important. You have to logout and login again since RVM change a lots of system.
48 This is very important. You have to logout and login again since RVM change a lots of system.
47
49
48 If you are using GUI version of Ubuntu, be sure to have Gnome Terminal (or any other terminal you are using) perform login every time. This can be done by mark the check box "Run command as a login shell" in Gnome terminal or by adding --login to bash.
50 If you are using GUI version of Ubuntu, be sure to have Gnome Terminal (or any other terminal you are using) perform login every time. This can be done by mark the check box "Run command as a login shell" in Gnome terminal or by adding --login to bash.
49
51
50 - === Install necessary package
52 + === 3. Install necessary package
51
53
52 cafe@grader:~$ sudo apt install libmysqlclient-dev default-jdk unzip nodejs php7.2-cli apache2 dirmngr gnupg apache2-dev
54 cafe@grader:~$ sudo apt install libmysqlclient-dev default-jdk unzip nodejs php7.2-cli apache2 dirmngr gnupg apache2-dev
53
55
54 curl build-essential
56 curl build-essential
55
57
56 - === Install cafe-grader
58 + === 4. Install cafe-grader
57
59
58 First, ensure that RVM is installed correctly.
60 First, ensure that RVM is installed correctly.
59
61
60 cafe@grader:~$ rvm
62 cafe@grader:~$ rvm
61
63
62 If you get a result similar to this.
64 If you get a result similar to this.
63
65
64 Command 'rvm' not found, but there are 21 similar ones.
66 Command 'rvm' not found, but there are 21 similar ones.
65
67
66 It is very likely that you have not re-login or you are using bash without --login. Please do so and re-read the installation of RVM on Ubuntu https://github.com/rvm/ubuntu_rvm again.
68 It is very likely that you have not re-login or you are using bash without --login. Please do so and re-read the installation of RVM on Ubuntu https://github.com/rvm/ubuntu_rvm again.
67
69
68 Next, we will let the install script do the work of installing cafe-grader. Please prepare the DATABASENAME, USERNAME and PASSWORD as the script will ask for that. Make sure that you run the script from the home directory of the user.
70 Next, we will let the install script do the work of installing cafe-grader. Please prepare the DATABASENAME, USERNAME and PASSWORD as the script will ask for that. Make sure that you run the script from the home directory of the user.
69
71
70 cafe@grader:~$ wget https://github.com/cafe-grader-team/cafe-grader-judge-scripts/raw/master/installer/install.sh
72 cafe@grader:~$ wget https://github.com/cafe-grader-team/cafe-grader-judge-scripts/raw/master/installer/install.sh
71 cafe@grader:~$ . ./install.sh
73 cafe@grader:~$ . ./install.sh
72
74
73 After installation is finished, grader is ready to run in development mode via WEBrick. We will try that by the following command which will start a grader accessible via http://localhost:3000/. You can try logging in to the system and verify that it is actually work.
75 After installation is finished, grader is ready to run in development mode via WEBrick. We will try that by the following command which will start a grader accessible via http://localhost:3000/. You can try logging in to the system and verify that it is actually work.
74
76
75 cafe@grader:~/cafe_grader/web$ rails s
77 cafe@grader:~/cafe_grader/web$ rails s
76
78
77 If Everything is OK, stop the WEBrick by Ctrl-C.
79 If Everything is OK, stop the WEBrick by Ctrl-C.
78
80
79 We are almost done. The last step is to set up apache and Phusion so that cafe-grader is served by apache.
81 We are almost done. The last step is to set up apache and Phusion so that cafe-grader is served by apache.
80
82
81 - === Deploy cafe-grader on Phusion passenger via apache
83 + === 5. Deploy cafe-grader on Phusion passenger via apache
82
84
83 This will install a Passenger mod for apache. You can start by visiting https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/apache/oss/install_passenger_main.html and fllow through the guide. We have reproduce the step here for Ubuntu 18.04. For other version, please select the appropriate one on the previous link.
85 This will install a Passenger mod for apache. You can start by visiting https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/apache/oss/install_passenger_main.html and fllow through the guide. We have reproduce the step here for Ubuntu 18.04. For other version, please select the appropriate one on the previous link.
84
86
85 The deploy is divided into two parts: Installing Passenger and deploying the app.
87 The deploy is divided into two parts: Installing Passenger and deploying the app.
86
88
87 - 1. Installing Passenger as a mod for apache via PPA and enable it.
89 + ==== 5.1. Installing Passenger as a mod for apache via PPA and enable it.
88
90
89 cafe@grader:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
91 cafe@grader:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
90 cafe@grader:~$ sudo apt-get install -y apt-transport-https ca-certificates
92 cafe@grader:~$ sudo apt-get install -y apt-transport-https ca-certificates
91 cafe@grader:~$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list'
93 cafe@grader:~$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list'
92 cafe@grader:~$ sudo apt-get update
94 cafe@grader:~$ sudo apt-get update
93 cafe@grader:~$ sudo apt-get install -y libapache2-mod-passenger
95 cafe@grader:~$ sudo apt-get install -y libapache2-mod-passenger
94 cafe@grader:~$ sudo a2enmod passenger
96 cafe@grader:~$ sudo a2enmod passenger
95
97
96
98
97 cafe@grader:~$ sudo apache2ctl restart
99 cafe@grader:~$ sudo apache2ctl restart
98
100
99 Finally, we should check that passenger is installed correctly. Run the following command and fix anything as suggested by the command.
101 Finally, we should check that passenger is installed correctly. Run the following command and fix anything as suggested by the command.
100
102
101 cafe@grader:~$ sudo /usr/bin/passenger-config validate-install
103 cafe@grader:~$ sudo /usr/bin/passenger-config validate-install
102
104
103 - 2. Deploying the app. First, we determine the exact location of our ruby that is installed via RVM.
105 + ==== 5.2. Deploying the app. First, we determine the exact location of our ruby that is installed via RVM.
104
106
105 cafe@grader:~$ passenger-config about ruby-command
107 cafe@grader:~$ passenger-config about ruby-command
106 passenger-config was invoked through the following Ruby interpreter:
108 passenger-config was invoked through the following Ruby interpreter:
107 Command: /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby
109 Command: /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby
108 Version: ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-linux]
110 Version: ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-linux]
109 To use in Apache: PassengerRuby /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby
111 To use in Apache: PassengerRuby /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby
110 To use in Nginx : passenger_ruby /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby
112 To use in Nginx : passenger_ruby /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby
111 To use with Standalone: /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby /usr/bin/passenger start
113 To use with Standalone: /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby /usr/bin/passenger start
112
114
113 Then, take note of the path after "Command". For this guide, it is /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby
115 Then, take note of the path after "Command". For this guide, it is /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby
114
116
115 Assuming that cafe-grader is installed at /home/cafe/cafe_grader, we will edit the Apache's site config file /etc/apache2/site-enabled/000-default.conf as follow.
117 Assuming that cafe-grader is installed at /home/cafe/cafe_grader, we will edit the Apache's site config file /etc/apache2/site-enabled/000-default.conf as follow.
You need to be logged in to leave comments. Login now