Description:
Update README.rdoc
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r860:ccb0988a4eaf - - 1 file changed: 15 inserted, 4 deleted
@@ -4,112 +4,123 | |||||
|
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. |
|
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> |
|
28 | + mysql> create user USERNAME@localhost identified by 'PASSWORD'; |
|
|
29 | + Query OK, 0 rows affected, 1 warning (0.00 sec) | ||
|
|
30 | + | ||
|
|
31 | + mysql> grant all privileges on DATABASENAME.* to USERNAME@localhost; | ||
|
29 | Query OK, 0 rows affected, 1 warning (0.00 sec) |
|
32 | Query OK, 0 rows affected, 1 warning (0.00 sec) |
|
30 |
|
33 | ||
|
31 | mysql> flush privileges; |
|
34 | mysql> flush privileges; |
|
32 | Query OK, 0 rows affected (0.00 sec) |
|
35 | Query OK, 0 rows affected (0.00 sec) |
|
33 |
|
36 | ||
|
34 | === 2. Install RVM |
|
37 | === 2. Install RVM |
|
35 |
|
38 | ||
|
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. |
|
39 | 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 |
|
40 | ||
|
38 | First, we install necessary package for installing RVM. |
|
41 | First, we install necessary package for installing RVM. |
|
39 |
|
42 | ||
|
40 | cafe@grader:~$ sudo apt install software-properties-common |
|
43 | cafe@grader:~$ sudo apt install software-properties-common |
|
41 |
|
44 | ||
|
42 | Second, we add the custom PPA, update the system and install RVM. |
|
45 | Second, we add the custom PPA, update the system and install RVM. |
|
43 |
|
46 | ||
|
44 | cafe@grader:~$ sudo apt-add-repository -y ppa:rael-gc/rvm |
|
47 | cafe@grader:~$ sudo apt-add-repository -y ppa:rael-gc/rvm |
|
45 | cafe@grader:~$ sudo apt-get update |
|
48 | cafe@grader:~$ sudo apt-get update |
|
46 | cafe@grader:~$ sudo apt-get install rvm |
|
49 | cafe@grader:~$ sudo apt-get install rvm |
|
47 |
|
50 | ||
|
48 | We also need to add our user to the rvm group |
|
51 | We also need to add our user to the rvm group |
|
49 |
|
52 | ||
|
50 | sudo usermod -a -G rvm $USER |
|
53 | sudo usermod -a -G rvm $USER |
|
51 |
|
54 | ||
|
52 | This is very important. |
|
55 | This is very important. |
|
53 | 1. You have to reboot since RVM change a lots of system. |
|
56 | 1. You have to reboot since RVM change a lots of system. |
|
54 | 2. 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. |
|
57 | 2. 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. |
|
55 |
|
58 | ||
|
56 | === 3. Install necessary package and nodejs |
|
59 | === 3. Install necessary package and nodejs |
|
57 |
|
60 | ||
|
|
61 | + | ||
|
58 | First, we install required package via apt. |
|
62 | First, we install required package via apt. |
|
59 |
|
63 | ||
|
60 | - cafe@grader:~$ sudo apt install libmysqlclient-dev default-jdk unzip php-cli apache2 dirmngr gnupg apache2-dev |
|
64 | + cafe@grader:~$ sudo apt install git libmysqlclient-dev default-jdk unzip php-cli apache2 dirmngr gnupg apache2-dev |
|
|
65 | + | ||
|
|
66 | + Next, we need nodejs. Depends on your ubuntu version, the step to install correct version of nodejs differs. | ||
|
|
67 | + | ||
|
|
68 | + ==== 3.1 Install nodejs on Ubuntu 18.04 | ||
|
61 |
|
69 | ||
|
62 | Since nodejs that comes with ubuntu 18.04 is very outdated, we need to install it manually. This follow the method outlined in https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04 under *Installing Node.js with Apt Using a NodeSource PPA* |
|
70 | Since nodejs that comes with ubuntu 18.04 is very outdated, we need to install it manually. This follow the method outlined in https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04 under *Installing Node.js with Apt Using a NodeSource PPA* |
|
63 |
|
71 | ||
|
64 | cd ~ |
|
72 | cd ~ |
|
65 | curl -sL https://deb.nodesource.com/setup_17.x -o nodesource_setup.sh |
|
73 | curl -sL https://deb.nodesource.com/setup_17.x -o nodesource_setup.sh |
|
66 | sudo bash nodesource_setup.sh |
|
74 | sudo bash nodesource_setup.sh |
|
67 | sudo apt install nodejs |
|
75 | sudo apt install nodejs |
|
68 |
|
76 | ||
|
|
77 | + ==== 3.2 Install nodejs on Ubuntu 20.04 or newer | ||
|
|
78 | + | ||
|
|
79 | + cafe@grader:~$ sudo apt install nodejs | ||
|
69 |
|
80 | ||
|
70 | === 4. Install cafe-grader |
|
81 | === 4. Install cafe-grader |
|
71 |
|
82 | ||
|
72 | First, ensure that RVM is installed correctly. |
|
83 | First, ensure that RVM is installed correctly. |
|
73 |
|
84 | ||
|
74 | cafe@grader:~$ rvm |
|
85 | cafe@grader:~$ rvm |
|
75 |
|
86 | ||
|
76 | If you get a result similar to this. |
|
87 | If you get a result similar to this. |
|
77 |
|
88 | ||
|
78 | Command 'rvm' not found, but there are 21 similar ones. |
|
89 | Command 'rvm' not found, but there are 21 similar ones. |
|
79 |
|
90 | ||
|
80 | 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. |
|
91 | 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. |
|
81 |
|
92 | ||
|
82 | 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. |
|
93 | 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. |
|
83 |
|
94 | ||
|
84 | cafe@grader:~$ wget https://github.com/cafe-grader-team/cafe-grader-judge-scripts/raw/master/installer/install.sh |
|
95 | cafe@grader:~$ wget https://github.com/cafe-grader-team/cafe-grader-judge-scripts/raw/master/installer/install.sh |
|
85 | cafe@grader:~$ . ./install.sh |
|
96 | cafe@grader:~$ . ./install.sh |
|
86 |
|
97 | ||
|
87 |
- After installation is finished, grader is ready to run in development mode via |
|
98 | + After installation is finished, grader is ready to run in development mode via Puma. 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. |
|
88 |
|
99 | ||
|
89 | cafe@grader:~/cafe_grader/web$ rails s |
|
100 | cafe@grader:~/cafe_grader/web$ rails s |
|
90 |
|
101 | ||
|
91 |
- If Everything is OK, stop the |
|
102 | + If Everything is OK, stop the Puma by Ctrl-C. |
|
92 |
|
103 | ||
|
93 | We are almost done. The last step is to set up apache and Phusion so that cafe-grader is served by apache. |
|
104 | We are almost done. The last step is to set up apache and Phusion so that cafe-grader is served by apache. |
|
94 |
|
105 | ||
|
95 | === 5. Deploy cafe-grader on Phusion passenger via apache |
|
106 | === 5. Deploy cafe-grader on Phusion passenger via apache |
|
96 |
|
107 | ||
|
97 | 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. |
|
108 | 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. |
|
98 |
|
109 | ||
|
99 | The deploy is divided into two parts: Installing Passenger and deploying the app. |
|
110 | The deploy is divided into two parts: Installing Passenger and deploying the app. |
|
100 |
|
111 | ||
|
101 | ==== 5.1. Installing Passenger as a mod for apache via PPA and enable it. |
|
112 | ==== 5.1. Installing Passenger as a mod for apache via PPA and enable it. |
|
102 |
|
113 | ||
|
103 | cafe@grader:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7 |
|
114 | cafe@grader:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7 |
|
104 | cafe@grader:~$ sudo apt-get install -y apt-transport-https ca-certificates |
|
115 | cafe@grader:~$ sudo apt-get install -y apt-transport-https ca-certificates |
|
105 | cafe@grader:~$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list' |
|
116 | cafe@grader:~$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list' |
|
106 | cafe@grader:~$ sudo apt-get update |
|
117 | cafe@grader:~$ sudo apt-get update |
|
107 | cafe@grader:~$ sudo apt-get install -y libapache2-mod-passenger |
|
118 | cafe@grader:~$ sudo apt-get install -y libapache2-mod-passenger |
|
108 | cafe@grader:~$ sudo a2enmod passenger |
|
119 | cafe@grader:~$ sudo a2enmod passenger |
|
109 |
|
120 | ||
|
110 |
|
121 | ||
|
111 | cafe@grader:~$ sudo apache2ctl restart |
|
122 | cafe@grader:~$ sudo apache2ctl restart |
|
112 |
|
123 | ||
|
113 | Finally, we should check that passenger is installed correctly. Run the following command and fix anything as suggested by the command. |
|
124 | Finally, we should check that passenger is installed correctly. Run the following command and fix anything as suggested by the command. |
|
114 |
|
125 | ||
|
115 | cafe@grader:~$ sudo /usr/bin/passenger-config validate-install |
|
126 | cafe@grader:~$ sudo /usr/bin/passenger-config validate-install |
You need to be logged in to leave comments.
Login now