{"id":17565,"date":"2015-09-04T12:06:32","date_gmt":"2015-09-04T17:06:32","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=17565"},"modified":"2022-12-08T11:01:39","modified_gmt":"2022-12-08T17:01:39","slug":"how-to-install-hackpad-on-a-centos-7-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-hackpad-on-a-centos-7-vps\/","title":{"rendered":"How to install Hackpad on CentOS 7"},"content":{"rendered":"
In this tutorial, we will explain how to install Hackpad on a Centos 7 VPS with nginx as a reverse proxy. Hackpad is a web-based real-time wiki, based on the open source EtherPad collaborative editor. This guide should work on other Linux VPS<\/a> systems as well but was tested and written for a Centos 7 VPS<\/a>. Create a new user for the Hackpad:<\/p>\n Hackpad requires JDK 7. Use the command below to download the latest Oracle JDK 7 from the command line using wget:<\/p>\n Once the rpm package is downloaded, install it with:<\/p>\n To check if JAVA has been properly installed on your CentOS box run To download and install the latest scala version from the official website, run:<\/p>\n Once the rpm package is downloaded, install it with:<\/p>\n Now if you run MariaDB 5.5 is shipped in the default CentOS 7 repository, to install it just run:<\/p>\n To start the MariaDB service and enable it to start on boot, execute the following commands:<\/p>\n Run the following command to secure your installation:<\/p>\n The following commands are run as hackpad user. To switch to hackpad user run:<\/p>\n Clone the Hackpad source code to the Edit the file and run:<\/p>\n To create a database for our Hackpad instance, run:<\/p>\n And enter MySQL root password when prompted.<\/p>\n Copy the default settings configuration file Start hackpad for the first time:<\/p>\n If there are no errors, you may continue with the next step.<\/p>\n To create a new systemd service for Hackpad, open your editor of choice as a root or sudo user and create a new file:<\/p>\n and add the following code lines:<\/p>\n Start the Hackpad service and set it to start automatically on boot:<\/p>\n To verify the unit started, run Nginx is not available by default in CentOS 7 so we will use the official Nginx repository:<\/p>\n Next, create a new Nginx server block:<\/p>\n Activate the server block by restarting Nginx:<\/p>\n That’s it. You have successfully installed your Hackpad. To access it, open <\/p>\n Update:<\/strong><\/p>\n Hackpad was acquired by Dropbox and it seems that the project is not maintanined anymore. Since Hackpad is based on the EtherPad collaborative document editor, our recommendation is to install and use Etherpad as described at https:\/\/www.rosehosting.com\/blog\/install-etherpad-on-a-centos-7-vps\/<\/p>\n Of course you don\u2019t have to do any of this if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.<\/p>\n PS<\/span><\/strong>. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this tutorial, we will explain how to install Hackpad on a Centos 7 VPS with nginx as a reverse … <\/p>\n
\n<\/p>\nLogin to your VPS via SSH<\/h4>\n
ssh root@vps<\/pre>\n
Update the system and install necessary packages<\/h4>\n
[root]$ yum -y update\r\n[root]$ yum install git wget<\/pre>\n
Create a new system user<\/h4>\n
[root]$ adduser \\\r\n --comment 'Hackpad User' \\\r\n --home-dir \/home\/hackpad \\\r\n hackpad<\/pre>\n
Install Oracle JDK 7<\/h4>\n
[root]$ wget --no-cookies \\\r\n --no-check-certificate \\\r\n --header \"Cookie: oraclelicense=accept-securebackup-cookie\" \\\r\n \"http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/7u80-b15\/jdk-7u80-linux-x64.rpm\" \\\r\n -O jdk-7u80-linux-x64.rpm<\/pre>\n
[root]$ yum install jdk-7u80-linux-x64.rpm<\/pre>\n
java -version<\/code>, and the output should be similar to the following:<\/p>\n
[root]$ java -version\r\njava version \"1.7.0_80\"\r\nJava(TM) SE Runtime Environment (build 1.7.0_80-b15)\r\nJava HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)<\/pre>\n
Install Scala<\/h4>\n
[root]$ wget http:\/\/downloads.typesafe.com\/scala\/2.11.7\/scala-2.11.7.rpm<\/pre>\n
[root]$ yum install scala-2.11.7.rpm<\/pre>\n
scalac -version<\/code>, you should get something like this:<\/p>\n
[root]$ scalac -version\r\nScala compiler version 2.11.7 -- Copyright 2002-2013, LAMP\/EPFL<\/pre>\n
Install MariaDB<\/h4>\n
[root]$ yum install mariadb-server<\/pre>\n
[root]$ systemctl start mariadb.service\r\n[root]$ systemctl enable mariadb.service<\/pre>\n
[root]$ mysql_secure_installation<\/pre>\n
Install Hackpad<\/h4>\n
[root]$ sudo su - hackpad<\/pre>\n
\/home\/hackpad\/hackpad<\/code> directory.<\/p>\n
[hackpad]$ git clone https:\/\/github.com\/dropbox\/hackpad.git ~\/hackpad<\/pre>\n
~\/hackpad\/bin\/exports.sh<\/code> as follows:<\/p>\n
...\r\nexport SCALA_HOME=\"\/usr\/share\/scala\/\"\r\nexport SCALA=\"$SCALA_HOME\/bin\/scala\"\r\nexport SCALA_LIBRARY_JAR=\"$SCALA_HOME\/lib\/scala-library.jar\"\r\n...\r\nexport JAVA_HOME=\"\/usr\/java\/jdk1.7.0_80\"\r\nexport JAVA=\"\/usr\/bin\/java\"\r\n...\r\nexport MYSQL_CONNECTOR_JAR=\"\/home\/hackpad\/hackpad\/lib\/mysql-connector-java-5.1.34-bin.jar\"\r\n...\r\n<\/pre>\n
[hackpad]$ cd ~\/hackpad\r\n[hackpad]$ bin\/build.sh<\/pre>\n
[hackpad]$ contrib\/scripts\/setup-mysql-db.sh<\/pre>\n
etherpad\/etc\/etherpad.localdev-default.properties<\/code> to
etherpad\/etc\/etherpad.local.properties<\/code> and set the etherpad.superUserEmailAddresses and topdomains, for example:<\/p>\n
etherpad.isProduction = true\r\netherpad.superUserEmailAddresses = name1@example.com,name2@example.com\r\ntopdomains = yourdomainname.com,localhost<\/pre>\n
[hackpad]$ bin\/run.sh<\/pre>\n
Create a systemd service<\/h4>\n
[root]$ vim \/etc\/systemd\/system\/hackpad.service<\/pre>\n
[Unit]\r\nDescription=Hackpad\r\nAfter=syslog.target network.target\r\n\r\n[Service]\r\nType=simple\r\nUser=hackpad\r\nGroup=hackpad\r\nExecStart=\/home\/hackpad\/hackpad\/bin\/run.sh\r\nRestart=always\r\n\r\n[Install]\r\nWantedBy=multi-user.target<\/pre>\n
[root]$ systemctl enable hackpad.service\r\n[root]$ systemctl start hackpad.service\r\n<\/pre>\n
journalctl -f -u hackpad.service<\/code> and you should see something like below:<\/p>\n
[root]$ journalctl -f -u hackpad.service\r\nAug 22 10:42:09 vps run.sh[3080]: dropbox: 2015-08-22 10:42:09.375-0500 Starting dropbox sync\r\nAug 22 10:42:09 vps run.sh[3080]: dropbox: 2015-08-22 10:42:09.382-0500 Done with dropbox sync\r\n<\/pre>\n
Install and configure Nginx<\/h4>\n
[root]$ wget http:\/\/nginx.org\/packages\/centos\/7\/noarch\/RPMS\/nginx-release-centos-7-0.el7.ngx.noarch.rpm\r\n[root]$ yum install nginx-release-centos-7-0.el7.ngx.noarch.rpm\r\n<\/pre>\n
[root]$ yum install nginx<\/pre>\n
[root]$ vim \/etc\/nginx\/sites-available\/yourdomainname.com.conf<\/pre>\n
map $http_upgrade $connection_upgrade {\r\n default upgrade;\r\n '' close;\r\n}\r\n\r\nserver {\r\n server_name yourdomainname.com;\r\n\r\n location \/ {\r\n proxy_set_header X-Real-IP $remote_addr;\r\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n proxy_set_header Host $host;\r\n proxy_redirect off;\r\n proxy_read_timeout 300;\r\n proxy_pass http:\/\/localhost:9000\/;\r\n proxy_set_header Upgrade $http_upgrade;\r\n proxy_set_header Connection $connection_upgrade;\r\n }\r\n}\r\n<\/pre>\n
[user]$ systemctl restart nginx<\/pre>\n
http:\/\/yourdomainname.com\/<\/code> in your browser. For more information about Hackpad, please refer to the official Hackpad<\/a> website.<\/p>\n
\n