Description:
merge
Commit status:
[Not Reviewed]
References:
merge algo
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r737:d8bb239a84f8 - - 3 files changed: 13 inserted, 24 deleted

@@ -6,99 +6,97
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.
11 Very important!!! All commands should be run from a normal user.
12
12
13 The detail of each step are provided as follows.
13 The detail of each step are provided as follows.
14
14
15 === 1. Install MySQL 5
15 === 1. Install MySQL 5
16
16
17 Install MySQL server for the server.
17 Install MySQL server for the server.
18
18
19 cafe@grader:~$ sudo apt install mysql-server
19 cafe@grader:~$ sudo apt install mysql-server
20
20
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.
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.
22
22
23 cafe@grader:~$ sudo mysql -u root
23 cafe@grader:~$ sudo mysql -u root
24
24
25 mysql> create database DATABASENAME;
25 mysql> create database DATABASENAME;
26 Query OK, 1 row affected (0.00 sec)
26 Query OK, 1 row affected (0.00 sec)
27
27
28 mysql> grant all privileges on DATABASENAME.* to USERNAME@localhost identified by 'PASSWORD';
28 mysql> grant all privileges on DATABASENAME.* to USERNAME@localhost identified by 'PASSWORD';
29 Query OK, 0 rows affected, 1 warning (0.00 sec)
29 Query OK, 0 rows affected, 1 warning (0.00 sec)
30
30
31 mysql> flush privileges;
31 mysql> flush privileges;
32 Query OK, 0 rows affected (0.00 sec)
32 Query OK, 0 rows affected (0.00 sec)
33
33
34 === 2. Install RVM
34 === 2. Install RVM
35
35
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.
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.
37
37
38 First, we install necessary package for installing RVM.
38 First, we install necessary package for installing RVM.
39
39
40 cafe@grader:~$ sudo apt install software-properties-common
40 cafe@grader:~$ sudo apt install software-properties-common
41
41
42 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.
43
43
44 cafe@grader:~$ sudo apt-add-repository -y ppa:rael-gc/rvm
44 cafe@grader:~$ sudo apt-add-repository -y ppa:rael-gc/rvm
45 cafe@grader:~$ sudo apt-get update
45 cafe@grader:~$ sudo apt-get update
46 cafe@grader:~$ sudo apt-get install rvm
46 cafe@grader:~$ sudo apt-get install rvm
47
47
48 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.
49
49
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.
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.
51
51
52 === 3. Install necessary package
52 === 3. Install necessary package
53
53
54 - 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 php-cli apache2 dirmngr gnupg apache2-dev
55 -
56 - curl build-essential
57
55
58 === 4. Install cafe-grader
56 === 4. Install cafe-grader
59
57
60 First, ensure that RVM is installed correctly.
58 First, ensure that RVM is installed correctly.
61
59
62 cafe@grader:~$ rvm
60 cafe@grader:~$ rvm
63
61
64 If you get a result similar to this.
62 If you get a result similar to this.
65
63
66 Command 'rvm' not found, but there are 21 similar ones.
64 Command 'rvm' not found, but there are 21 similar ones.
67
65
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.
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.
69
67
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.
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.
71
69
72 cafe@grader:~$ wget https://github.com/cafe-grader-team/cafe-grader-judge-scripts/raw/master/installer/install.sh
70 cafe@grader:~$ wget https://github.com/cafe-grader-team/cafe-grader-judge-scripts/raw/master/installer/install.sh
73 cafe@grader:~$ . ./install.sh
71 cafe@grader:~$ . ./install.sh
74
72
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.
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.
76
74
77 cafe@grader:~/cafe_grader/web$ rails s
75 cafe@grader:~/cafe_grader/web$ rails s
78
76
79 If Everything is OK, stop the WEBrick by Ctrl-C.
77 If Everything is OK, stop the WEBrick by Ctrl-C.
80
78
81 We are almost done. The last step is to set up apache and Phusion so that cafe-grader is served by apache.
79 We are almost done. The last step is to set up apache and Phusion so that cafe-grader is served by apache.
82
80
83 === 5. Deploy cafe-grader on Phusion passenger via apache
81 === 5. Deploy cafe-grader on Phusion passenger via apache
84
82
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.
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.
86
84
87 The deploy is divided into two parts: Installing Passenger and deploying the app.
85 The deploy is divided into two parts: Installing Passenger and deploying the app.
88
86
89 ==== 5.1. Installing Passenger as a mod for apache via PPA and enable it.
87 ==== 5.1. Installing Passenger as a mod for apache via PPA and enable it.
90
88
91 cafe@grader:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
89 cafe@grader:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
92 cafe@grader:~$ sudo apt-get install -y apt-transport-https ca-certificates
90 cafe@grader:~$ sudo apt-get install -y apt-transport-https ca-certificates
93 cafe@grader:~$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list'
91 cafe@grader:~$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list'
94 cafe@grader:~$ sudo apt-get update
92 cafe@grader:~$ sudo apt-get update
95 cafe@grader:~$ sudo apt-get install -y libapache2-mod-passenger
93 cafe@grader:~$ sudo apt-get install -y libapache2-mod-passenger
96 cafe@grader:~$ sudo a2enmod passenger
94 cafe@grader:~$ sudo a2enmod passenger
97
95
98
96
99 cafe@grader:~$ sudo apache2ctl restart
97 cafe@grader:~$ sudo apache2ctl restart
100
98
101 Finally, we should check that passenger is installed correctly. Run the following command and fix anything as suggested by the command.
99 Finally, we should check that passenger is installed correctly. Run the following command and fix anything as suggested by the command.
102
100
103 cafe@grader:~$ sudo /usr/bin/passenger-config validate-install
101 cafe@grader:~$ sudo /usr/bin/passenger-config validate-install
104
102
@@ -1,35 +1,36
1 = user_title_bar(@user)
1 = user_title_bar(@user)
2
2
3 %h1 Your account settings
3 %h1 Your account settings
4
4
5 -#%p
5 -#%p
6 -#You can edit your alias and e-mails. Just click on the text and edit it.
6 -#You can edit your alias and e-mails. Just click on the text and edit it.
7
7
8 - %table.uinfo
8 + %table.table.table-bordered{:style => "width:30%"}
9 %tr
9 %tr
10 - %th.uinfo Login
10 + %th Login
11 - %td.uinfo= @user.login
11 + %td= @user.login
12 %tr
12 %tr
13 - %th.uinfo Full name
13 + %th Full name
14 - %td.uinfo= @user.full_name
14 + %td= @user.full_name
15 -#%tr
15 -#%tr
16 -#%th.uinfo Alias
16 -#%th.uinfo Alias
17 -#%td.uinfo= in_place_editor_field :user, 'alias_for_editing', {}, :rows => 1
17 -#%td.uinfo= in_place_editor_field :user, 'alias_for_editing', {}, :rows => 1
18 -#%tr
18 -#%tr
19 -#%th.uinfo E-mail
19 -#%th.uinfo E-mail
20 -#%td.uinfo= in_place_editor_field :user, 'email_for_editing', {}, :rows => 1
20 -#%td.uinfo= in_place_editor_field :user, 'email_for_editing', {}, :rows => 1
21 %tr
21 %tr
22 - %th.uinfo Password
22 + %th Password
23 - %td.uinfo
23 + %td
24 = form_tag :action => 'chg_passwd', :method => 'post' do
24 = form_tag :action => 'chg_passwd', :method => 'post' do
25 %table
25 %table
26 %tr
26 %tr
27 - %td= password_field_tag 'passwd'
27 + %td
28 + %input{:type => "password", :class => "form-control", :name => "passwd", :id => "passwd"}
28 %td (new)
29 %td (new)
29 %tr
30 %tr
30 - %td= password_field_tag 'passwd_verify'
31 + %td
32 + %input{:type => "password", :class => "form-control", :name => "passwd_verify", :id => "passwd_verify"}
31 %td (verify)
33 %td (verify)
32 %tr
34 %tr
33 %td{:colspan => "2"}
35 %td{:colspan => "2"}
34 - = submit_tag 'change password'
36 + %input{:type => "button", :class => "btn btn-default", :name => "commit", :value => "Change Password"}
35 -
You need to be logged in to leave comments. Login now