diff --git a/README.rdoc b/README.rdoc --- a/README.rdoc +++ b/README.rdoc @@ -14,11 +14,11 @@ Install MySQL server for the server. - $ sudo apt install mysql-server + cafe@grader:~$ sudo apt install mysql-server Next, we will connect to mysql as root and set up the database. You can choose your DATABASENAME, USERNAME and PASSWORD. - sudo mysql -u root + cafe@grader:~$ sudo mysql -u root mysql> create database DATABASENAME; Query OK, 1 row affected (0.00 sec) @@ -35,47 +35,58 @@ First, we install necessary package for installing RVM. - $ sudo apt install software-properties-common + cafe@grader:~$ sudo apt install software-properties-common Second, we add the custom PPA, update the system and install RVM. - $ sudo apt-add-repository -y ppa:rael-gc/rvm - $ sudo apt-get update - $ sudo apt-get install rvm + cafe@grader:~$ sudo apt-add-repository -y ppa:rael-gc/rvm + cafe@grader:~$ sudo apt-get update + cafe@grader:~$ sudo apt-get install rvm This is very important. You have to logout and login again since RVM change a lots of system. +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. + === Install necessary package - $ sudo apt install libmysql-dev default-jdk unzip nodejs php7.2-cli apache2 dirmngr gnupg apache2-dev - + cafe@grader:~$ sudo apt install libmysqlclient-dev default-jdk unzip nodejs php7.2-cli apache2 dirmngr gnupg apache2-dev curl build-essential - === Install cafe-grader First, ensure that RVM is installed correctly. -If instead of this you get the following error, it is very likely that you have not use bash --login. + cafe@grader:~$ rvm + +If you get a result similar to this. + + Command 'rvm' not found, but there are 21 similar ones. + +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. 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. - cafe@grader:~$ wget https://github.com/cafe-grader-team/cafe-grader-judge-scripts/raw/master/installer/install-ubuntu-18.04.sh - cafe@grader:~$ . ./install-ubuntu-18.04.sh + cafe@grader:~$ wget https://github.com/cafe-grader-team/cafe-grader-judge-scripts/raw/master/installer/install.sh + cafe@grader:~$ . ./install.sh -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 should try logging in to the system and verify that it is actually work. +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. cafe@grader:~/cafe_grader/web$ rails s +If Everything is OK, stop the WEBrick by Ctrl-C. + We are almost done. The last step is to set up apache and Phusion so that cafe-grader is served by apache. === Deploy cafe-grader on Phusion passenger via apache -Basically, we will follow the instructions given in https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/apache/oss/bionic/install_passenger.html, which devided into two parts: Installing Passenger and deploying the app. + +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. -Installing Passenger as a mod for apache and enable it. +The deploy is divided into two parts: Installing Passenger and deploying the app. -cafe@grader:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7 +1. Installing Passenger as a mod for apache via PPA and enable it. + + cafe@grader:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7 cafe@grader:~$ sudo apt-get install -y apt-transport-https ca-certificates cafe@grader:~$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list' cafe@grader:~$ sudo apt-get update @@ -89,8 +100,6 @@ cafe@grader:~$ sudo /usr/bin/passenger-config validate-install - - Deploying the app. First, we determine the exact location of our ruby that is installed via RVM. cafe@grader:~$ passenger-config about ruby-command @@ -103,7 +112,7 @@ Then, take note of the path after "Command". For this guide, it is /home/cafe/.rvm/gems/ruby-2.3.7/wrappers/ruby -Assuming that cafe-grader is installed at /home/cafe/cafe_grader, we will edit the site config file of the apache as follow. +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. #ServerName www.example.com @@ -131,4 +140,6 @@ As the last step, we restart apache again and the site is ready to be used. cafe@grader:~$ sudo apache2ctl restart + + Now it is done, you can login to the grader with user 'root' and password 'ioionrails'