Install Sharetribe Go on Ubuntu 16.04

Ref: https://github.com/sharetribe/sharetribe

Make sure ruby already installed.
Install Sphinx:
download it from http://sphinxsearch.com/ then extract it. Pls read: http://sphinxsearch.com/docs/sphinx3.html#getting-started-on-linux-and-macos
Here is the extracted path: /home/teddy/Documents/sphinx-3.1.1/
And the ‘program’ (searchd, indexer, etc) in ‘bin’ dir: /home/teddy/Documents/sphinx-3.1.1/bin
check :

NOTE: TO MAKE THE EXECUTABLE CAN RUN GLOBALLY, PLS DO:

THEN RUN FROM ANYWHERE

Creating ‘test’ database (no problem if the database is already exist)

I need to create the sphinx.conf file (read: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-sphinx-on-ubuntu-16-04#step-6-%E2%80%94-testing)
First I need to remove/move ‘sphinxdata’ dir in ‘bin’ dir because I got this message ‘No config file, using ‘sphinxdata’ folder.’ (read: https://stackoverflow.com/questions/50837676/sphinx-3-0-3-searchd-dont-see-my-config)
Create a new file ‘sphinx.conf’ in /home/teddy/Documents/sphinx-3.1.1/sphinxsearch/ dir:

RUN:

IF I GOT ‘bind() failed on 0.0.0.0, retrying’ THEN IT MEANS ‘searchd’ ALREADY RUNNING ON THE BACKGROUND (REF: http://sphinxsearch.com/forum/view.html?id=5542). CHECK

KILL THEM WITH ‘killall searchd’ THEN CHECK AGAIN:

RE RUN ‘searchd’

MODIFY sphinx.conf

BUT

OK. HERE IS THE WORKING sphinx.conf. USE ‘type=rt’ (READ: https://sphinxsearch.com/forum/view.html?id=16238)

PLS REMOVE ALL FILE IN /home/teddy/Documents/sphinx-3.1.1/sphinxsearch/data FIRST! ALSO RUN ‘killall searchd’ THEN

NO ERROR!

 

Imagemagick
Check

INSTALL SHARETRIBE

CURRENTLY HAVE TO USE ruby 2.6.2

SO USE rbenv TO INSTALL 2.6.2 AND MAKE IT DEFAULT WITH ‘global’

THEN CONTINUE WITH

Install node modules:

Create a database.yml file by copying the example database configuration:

Add your database configuration details to config/database.yml. You will probably only need to fill in the password for the database(s). Pls set the right config for ‘development’ and ‘test’:

Create a config.yml file by copying the example configuration file:

Create and initialize the database:

Run Sphinx index:

Output:

Start the Sphinx daemon:

Output:

Start the development server:

But Install ‘foreman’ FIRST (READ: https://github.com/ddollar/foreman)

But to run ‘foreman’, it need node js v10.15.3 and npm 6.4.1

current node version is v8.9.4

So use ‘nvm’ to install node v10.15.3

RE RUN ‘foreman’ BUT GOT ANOTHER ERROR ABOUT node-sass

 

Then open your browser: http://localhost:5000
The first time will go to http://localhost:5000/communities/new?locale=en
Setting:
admin email: advcha@yahoo.com
admin pass: Admin@123
Admin user first name: Satria
Admin user last name; Faestha
Marketplace name: Web Devs Service
Marketplace type: Service marketplace
Marketplace country: Australia
Marketplace language: English
Save
Then it’ll go to http://web-devs-service.lvh.me:3000/?auth=IETnn4GA1Nc
BUT I GOT

IT SHOULD OPEN http://localhost:5000ALSO OPEN ANOTHER TERMINAL THEN RUN:

ADMIN: http://localhost:5000/en/login
admin email: advcha@yahoo.com
admin pass: Admin@123

JS ERROR

I did : nvm alias default 10.15.3
also nvm use 10.15.3

also
npm -g uninstall node-sass
npm -g i node-sass

BUT STILL EXIST

npm install node-sass

teddy@teddy:~/Documents/ruby/sharetribe$ npm rebuild node-sass

> node-sass@4.12.0 install /home/teddy/Documents/ruby/sharetribe/node_modules/node-sass
> node scripts/install.js

node-sass build Binary found at /home/teddy/Documents/ruby/sharetribe/node_modules/node-sass/vendor/linux-x64-64/binding.node

> node-sass@4.12.0 postinstall /home/teddy/Documents/ruby/sharetribe/node_modules/node-sass
> node scripts/build.js

Binary found at /home/teddy/Documents/ruby/sharetribe/node_modules/node-sass/vendor/linux-x64-64/binding.node
Testing binary
Binary is fine
node-sass@4.12.0 /home/teddy/Documents/ruby/sharetribe/node_modules/node-sass

teddy@teddy:~/Documents/ruby/sharetribe$ npm ls node-sass
/home/teddy/Documents/ruby/sharetribe
└── node-sass@4.12.0
SOLUTION: REMOVE ‘node_modules’ DIR IN SHARETRIBE ROOT AND IN client/ DIR
THEN RUN IN SHARETRIBE ROOT ‘npm install –no-cache’
NO MORE ERROR!

Install Ruby, ROR and RBENV on Ubuntu 16.04

Ref:
https://gorails.com/setup/ubuntu/16.04

Install Ruby on Rails on Ubuntu 16.04


https://medium.com/@rgdev/how-to-install-ruby-rails-on-ubuntu-16-04-from-scratch-quickly-4da73c67daa3

I think I already installed many packages needed like curl, nodejs and yarn. so just install this:

Use rbenv to install ruby 2.6.3 at home:

output:

NOTE: Instal ruby 2.6.2 AND make it default:

CHECK:

Then install ‘bundler’

I already setup git, so no need to set it up again. check

Install Rails (v6.0.0.rc1)

If you’re using rbenv, you’ll need to run the following command to make the rails executable available:

check:

SETUP MYSQL
Install libmysqlclient-dev gives you the necessary files to compile the mysql2 gem which is what Rails will use to connect to MySQL when you setup your Rails app.

Let’s create your first Rails application (with mysql):

then modify /home/teddy/Documents/ruby/first-app-mysql/config/database.yml. Modify the database username, password and db name:
SORRY, ONLY ADMIN CAN SHOW THIS!
Create the database manually or run ‘rake db:create’

Then run ‘rails server’

Then open on your browser: http://localhost:3000/

Install Flarum on Ubuntu 16.04

Ref: https://flarum.org/
https://flarum.org/docs/install.html

Install via composer:

SETUP NGINX

NGINX SETUP:

CONTENT:

 

Enable file config

 

Register the host on my system

Like this:

 

CHECK THE NGINX SETTING AND RESTART IT:

Change the file permissions

CREATE A NEW DATABASE: flarum COLLATION utf8mb4_unicode_ci
Open it on your browser then install : http://flarum.test
Setting admin:
username: admin
password: Admin@123

User
username: teddy
password: teddy123

Install VTiger 7 Open Source On Ubuntu 16.04

Download from https://sourceforge.net/projects/vtigercrm/
Extract the downloaded file.

My environment: PHP 7.3 FPM, MySQL 5.7, Nginx

SETUP LOCAL WITH NGINX

content:

  • Enable file config
  • Register the host on my system

    Like this:
  • CHECK THE NGINX SETTING AND RESTART IT:


     
  • Set file permission and owner:

    CREATE A NEW DATABASE: vtigercrm COLLATION utf8mb4_general_ci

    Test: http://vtigercrm.test/ –> INSTALLATION WORKING. THE INSTALLATION TOOK SAME TIME

    Admin
    username: admin
    password: Admtiger

    BUT I GOT THIS ERROR:


    DEBUG STEP:
    /vtigercrm/languages/en_us/Install.php:

    /vtigercrm/modules/Install/models/Utils.php:

    SOLUTION: MODIFY THE MYSQL SETTING IN /etc/mysql/my.cnf

    MODIFY THE ‘sql_mode’ VALUES: –> PLS READ: https://www.percona.com/blog/2016/10/18/upgrading-to-mysql-5-7-beware-of-the-new-strict-mode/

    SAVE AND THE RESTART MYSQL SERVICE

     

Yii2

Ref: https://www.yiiframework.com/
https://www.yiiframework.com/doc/guide/2.0/en/start-installation

How to install Yii PHP Framework on Debian 9 and Ubuntu 18.04?

Create a Yii2 project ‘yii2-kickstart’ via composer:

Go to the project dir then modify composer.json to add ‘replace’ like this:

If I don’t do this, i’ll get this error:

Then run ‘composer update’
Then run ‘php yii serve’. it’ll use port 8080
If the port 8080 is already used, you can use another port like 888:

Then open it on your browser: http://localhost:8888/
BUT I GOT THIS ERROR ON THE PAGE

SO I REMOVE ‘replace’ AND THE VALUES IN {} IN composer.json
Then run ‘composer update’ again.
Start the server again: php yii serve –port=8888
Open it on the browser: http://localhost:8888/
NOW IT’S WORKING FINE!

WordPress and Woocommerce

WordPress and Woocommerce

Download the latest from wordpress.org. I got version 5.2.3

SETUP LOCAL WITH NGINX

content:

  • Enable file config
  • Register the host on my system

    Like this:
  • CHECK THE NGINX SETTING AND RESTART IT:

CREATE A NEW DATABASE: wp523_commerce COLLATION utf8_general_ci
Open it on your browser and install : http://wp523_commerce.test
setting:
username: admin
password: xA**EbXJ4UNw96u0wI

Download theme ‘futurio’ from https://futuriowp.com/free-woocommerce-theme/
then extract and put it in theme dir. install
Then download plugin futurio extra from https://wordpress.org/plugins/futurio-extra/
Then download plugin wordpress-importer from https://wordpress.org/plugins/wordpress-importer/
Then download plugin elementor from https://wordpress.org/plugins/elementor/
Then download plugin WooCommerce
from https://wordpress.org/plugins/woocommerce/
Then download plugin Ajax Search for WooCommerce
from https://wordpress.org/plugins/ajax-search-for-woocommerce/
extract and put these plugins into plugins dir then install

Then download the sample data from https://futuriowp.com/docs/futurio/importing-the-sample-data/. Follow the instructions to import the sample data. NOTE: I can’t import the data from the local site. I have to import it manually!

TEST: http://wp523_commerce.test
ADMIN: http://wp523_commerce.test/wp-admin
WOOCOMMERCE SHOP: http://wp523_commerce.test/shop

Laravel and Swoole

Ref: https://github.com/huang-yi/laravel-swoole-http
My setting:

 

Create a laravel project. I tried version 6.x but I can’t use ‘laravel-swoole-http’ so I installed version 5.6.x

Then go to the dir ‘laravel-swoole’ then install laravel-swoole-http’ with ‘composer require huang-yi/laravel-swoole-http’

then register/publish the swoole service

then start swoole server

open it on your browser: http://127.0.0.1:1215/
the setting in laravel-swoole/config/swoole.php like host (localhost), port (1215), etc
TO stop the swoole server:

ANOTHER ACTIVE LARAVEL SWOOLE (laravel-swooletw)
https://github.com/swooletw/laravel-swoole
PLS READ https://github.com/swooletw/laravel-swoole/wiki
Create a laravel project. I installed version 5.6.x

Then go to the dir ‘laravel-swooletw’ then install laravel-swoole’ with ‘composer require swooletw/laravel-swoole’

from https://github.com/swooletw/laravel-swoole/wiki/4.-Installation,I need to register the swoole service provider in config/app.php

Then need to publish the configuration

Then run the server :

open it on your browser: http://localhost:1215/

ANOTHER LARAVEL – SWOOLE IS
https://github.com/hhxsv5/laravel-s
I download for auction app from https://github.com/GallopYD/domain-spider
STEPS:

CREATE A .env file:

CREATE A NEW DATABASE ‘laravel_auction_swoole’ COLLATION : utf8mb4_unicode_ci
RUN

READ https://github.com/hhxsv5/laravel-s
PUBLISH

START SERVER

OPEN IT ON THE BROWSER : http://localhost:5200/

 

 

Swoolec Loader

Use PHP7.3
Install it if not exist

Use php7.3 as default php

Check

TO ENABLE PHP 7.3 ON NGINX SERVER, PLS DO (MAKE SURE APACHE2 IS STOPPED IF IT’S RUNNING AND START NGINX):

IMPORTANT! ALSO NEED TO INSTALL php7.3-dev. THIS IS NEEDED WHEN I NEED TO COMPILE swoole SOURCE

CHECK php-config SOULD POINT TO php7.3

THE NGINX MAIN CONFIG IN /etc/nginx/nginx.conf
THE DEFAULT VIRTUALHOST IN /etc/nginx/sites-available/default
EDIT IT TO ENABLE PARSING PHP FILE:

Use php7.3-fpm for fastcgi_pass

THEN CHANGE PHP7.3-FPM SETTING:

CHANGE THE CONTENT:

THEN RESTART PHP7.3-FPM SERVICE:

CHECK NGINX SYNTAX: sudo nginx -t
RESTART NGINX: sudo service nginx restart
OPEN IT: http://localhost:8080/phpinfo.php (NEED TO CLEAR THE BROWSER CACHE FIRST)

INSTALL swoole FOR PHP7.3
IF YOU ALREADY INSTALLED IT FOR PHP7.2, YOU NEED TO REMOVE/UNINSTALL IT.
NOTE: TO UNINSTAL IT, USE PHP7.2 VERSION ON TERMINAL NOT PHP7.3
FIRST COMMENT IT from the cli php.ini and php-fpm php.ini files.

THEN

THEN DO THE SAME FOR php-fpm php.ini file (sudo gedit /etc/php/7.2/fpm/php.ini).
USE pecl TO UNINSTALL IT

NOTE: IT’S ALSO IMPORTANT TO DELETE/REMOVE swoole.so FILE IN /usr/lib/php/20170718/swoole.so MANUALLY. BECAUSE PHP7.3 USE EXTENSION DIR IN /usr/lib/php/20180731, MAKE SURE IF ALREADY EXIST swoole.so IN IT. REMOVE IT MANUALLY AS WELL!
NOTE: I TRIED TO INSTALL swoole 4.4.5 FROM SOURCE & COMPILE IT (READ: https://github.com/swoole/swoole-src) BUT ALWAYS FAILED AND GOT THIS ERROR

I THINK THIS IS BECAUSE I MIXED THE INSTALLATION (FROM pecl AND FROM SOURCE) THEN FORGOT TO INSTALL php7.3-dev AND FORGOT TO REMOVE swoole.so MANUALLY IN /usr/lib/php/20180731/swoole.so

THEN INSTALL SWOOLE ON PHP7.3 TERMINAL
MAKE SURE THE PHP API VERSION FOR PHP7.3 IS ‘20180731’ NOT ‘20170718’

Then include the extension “extension=swoole.so” in php.ini file. For php-fpm, the php.ini file in “/etc/php/7.3/fpm/php.ini”

then add this new line:

Save then restart php7.3-fpm service

look it up phpinfo() result. It should show like this:THEN IN CLI

ADD loader73.so FILE.
Copy it manually (USE SUDO) TO php7.3 EXTENSION DIR (IN /usr/lib/php/20180731)

THEN ADD THE EXTENSION ‘loader73.so’ IN php.ini FILE. For php-fpm, the php.ini file in “/etc/php/7.3/fpm/php.ini”

THEN ADD:

PLS DO THE SAME IN php.ini FOR CLI IN /etc/php/7.3/cli/php.ini
THEN RESTART php7.3-fpm SERVICE

CHECK THE EXTENSION IN phpinfo (http://localhost:8080/phpinfo.php)
IT SHOULD SHOW LIKE THISCHECK IN CLI

WE ALSO NEED TO DISABLE xdebug EXTENSION. CHECK IF xdebug IS ENABLED

THEN I NEED TO DISABLE IT.

THEN DISABLE xdebug BY ADDING ‘;’ IN FRONT OF THE LINE LIKE THIS:

THEN RESTART php7.3-fpm SERVICE

MAKE THERE IS NO MORE WARNING ABOUT xdebug

SAMPLE FILES IN /home/teddy/Downloads/Ptcms_V4.2.8 DIR
IN THE DIR, COPY ‘env.example.php’ TO ‘env.php’ FILE
RUN FROM TERMINAL

THEN I GOT ERROR ABOUT MEMCACHE

MAKE SURE memcached SERVICE IS RUNNING

OR

ALSO CHECK IF memcached EXTENSION IS INSTALLED

IF THERE IS NO OUTPUT, THEN INSTALL IT (REF: https://serverpilot.io/docs/how-to-install-the-php-memcache-extension)

HERE IS THE PROCESS

THEN MODIFY /etc/php/7.3/fpm/php.ini AND /etc/php/7.3/cli/php.ini FILE THEN ADD THE EXTENSION extension=memcached.so
THEN RESTART THE SERVICES

 

Install Swoole on Ubuntu 16.04

Ref: https://github.com/swoole/swoole-docs/blob/master/get-started/installation.md
Install from pecl

Then include the extension “extension=swoole.so” in php.ini file. For php-fpm, the php.ini file in “/etc/php/7.2/fpm/php.ini”

then add this new line:

Save then restart php7.2-fpm service

look it up phpinfo() result. It should show like this:Pls do the same thing for php cli. the php.ini file for php cli in “/etc/php/7.2/cli/php.ini”. So edit the file and add a new line for the extension “extension=swoole.so”. Check the extension is loaded on the terminal:

Note: I tried to do this via terminal

But it didn’t work. The extension is not loaded so I put it manually in the php.ini for cli.
NOTE: IT NEED TO DISABLE ‘xdebug’ EXTENSION. CHECK IF xdebug IS ACTIVE/ENABLED:

IF IT IS ENABLED, THEN MODIFY ‘/etc/php/7.2/cli/conf.d/20-xdebug.ini’ FILE TO DISABLE xdebug BY ADDING ‘;’ IN FRONT OF THE LINE LIKE THIS:

IF xdebug IS ENABLED WHEN THE SERVER IS RUNNING, IT’D SPIT THIS WARNING:

TEST SWOOLE
ref: https://github.com/swoole/swoole-docs/blob/master/get-started/examples/tcp_server.md
Create a new file server.php

Run the php in a terminal

then open another terminal and type ‘telnet 127.0.0.1 9501’

The first terminal would print ‘Client : Connect’

You can connect with another new terminal.
To close the connection in the second terminal, press Ctrl + ] then type close in telnet>

The first terminal would give response like this:

Create web server
ref: https://github.com/swoole/swoole-docs/blob/master/get-started/examples/http_server.md
create a new file ‘http_server.php’

then run the server via terminal

Open it via web browser: http://127.0.0.1:9503/
It should show this message:

 

Install Microsoft Sql Server 2017 And The PHP Extension On Ubuntu 16.04

Ref: https://www.microsoft.com/en-us/sql-server/developer-get-started/php/ubuntu

1. Register the Microsoft Linux repositories and add their keys.
Note: it’d be better to use ‘sudo su’ first!

2. Install SQL Server.
NOTE: I USE ‘sudo apt-get install mssql-server=14.0.3192.2-2’ INSTEAD OF ‘sudo apt-get install mssql-server’ BECAUSE I GOT AN ERROR FOR SQLCMD ‘Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2746.’
REF: https://stackoverflow.com/questions/57265913/error-tcp-provider-error-code-0x2746-during-the-sql-setup-in-linux-through-te

3. Setup your SQL Server.
Note: I choose ‘Developer’ edition.

SORRY, ONLY ADMIN CAN SHOW THIS!
Check the mssql-server service status

NOTE: ERROR LOG IN /var/opt/mssql/log/error
MUST OPEN THE DIR WITH ‘sudo su’
4. Install the ODBC Driver and SQL Command Line Utility for SQL Server (SQLCMD)

After installing SQLCMD, you can connect to SQL Server using the following command: sqlcmd -S localhost -U sa -P Yourpassword
SORRY, ONLY ADMIN CAN SHOW THIS!

Install the PHP Driver for SQL Server

THEN

THEN

NOTE: IT’D COPY THE FILES ’20-sqlsrv.ini’ AND ’30-pdo_sqlsrv.ini’ TO DIR /etc/php/7.2/cli/conf.d/
THEN
MODIFY ‘php.ini’ file for php7.2 fpm and (cli NO NEED???)

THEN INSERT THESE TWO LINES:

NO NEED –>PLS DO THE SAME FOR ‘cli’: sudo gedit /etc/php/7.2/cli/php.ini

THEN COPY THE TWO INI FILES FROM ‘cli’ TO ‘fpm’

THEN RESTART PHP FPM

CHECK THEM IN phpinfo: http://localhost:8080/phpinfo.php

Create a database ‘SampleDB’ for your application

The DB will be exist in /var/opt/mssql/data/SampleDB.mdf and the log file.

Create a PHP app that connects to SQL Server and executes queries

Create a new file ‘connect.php’

RUN ON CLI:

NOTE: ON CLI I GOT THIS WARNING:

SOLUTION: REMOVE/COMMENT THE EXTENSIONS ‘sqlsvr’ AND ‘pdo_sqlsvr’ IN /etc/php/7.2/cli/php.ini FILES!
CHECK THE LOADED MODULE WITH: php -m
IT SHOULD BE ALREADY LOADED FOR CLI SO NO NEED TO INCLUDE THEM IN CLI php.ini BUT IT NEED TO INCLUDE FOR FPM php.ini !

ALSO RUN VIA WEB: http://localhost:8080/works/SqlServerSample/connect.php

 

UNINSTALL MS SQL SERVER
REF: https://dba.stackexchange.com/questions/174175/how-do-i-totally-remove-sql-server-2017-on-ubuntu

Uninstalling SQL Server on Ubuntu