1)Install JDK
sudo apt install default-jdk
2)Install Netbeans
sudo snap install netbeans --classic
1)Install JDK
sudo apt install default-jdk
2)Install Netbeans
sudo snap install netbeans --classic
https://github.com/w3bdesign/laravel-vue
//guest checkout using payment gateway(stripe)
https://github.com/MostafaHamedAbdelmasoud/Instashop-multi-vendors-ecommerce
https://github.com/nishangupta/Mart
Prerequisites:
1) Create a Digital Ocean Account
2) ssh set up on your local computer
Steps:
1) Create a Droplet
- Using one click install LAMP .
- select standard → $5/month plan → enter ssh keys → enter host name → create droplet button
2) hit ip on the browser to see the site
-----------------------------------------------------------------------------------------------------------------------
To access the site from local machine:
-----------------------------------------------------------------------------------------------------------------------
1) In a new terminal login as the new user
$sshroot@IP_ADDRESS
2)Notemysql password from the locationmentioned during one click installation3) Generate ssh for the server using command
$ssh-keygen
To see the generated keyenter,
$cat .ssh/id_rsa.pub//to display the key
4)Add remote server ssh keyto github→settings→sshkey
-----------------------------------------------------------------------------------------------------------------------
To set up DB
-----------------------------------------------------------------------------------------------------------------------
$mysql -u root -p;$SELECT user,authentication_string,plugin,host FROM mysql.user;$ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY'password'; //passwort from ./root/digital ocean folder$FLUSH PRIVILEGES;to check:$SELECT user,authentication_string,plugin,host FROM mysql.user;$create databasenew_db$usenew_db$sourcepath/to/uploaded/sqlfile //to import the uploaded db to mysql$exit //mysql$sudo service mysql restart
-----------------------------------------------------------------------------------------------------------------------
To set up Project
-----------------------------------------------------------------------------------------------------------------------
1)git clone the folder tovar/wwwdirectory
2)
cd
/var/www
git clone https://github.com/ammezie/laravel-deploy-demo.git3)install composer4)runcomposer install5)set up all the missing extensions
sudo apt-get install -y php7.2-xml
sudo apt-get install -y php7.2-mbstring one by one like above or in one go as shown below:sudo apt install openssl php7.2-common php7.2-curl php7.2-json php7.2-mbstring php7.2-mysql php7.2-xml php7.2-zip
6)
cd laravel-deploy-demo
composer install7) For environment variablescp .env.example .env8) generate an app key usingphp artisan key:generate9) open .envnano.envMakethe followingchangesinto itSince weareon production, we set APP_DEBUG to false. Also, we set APP_URL to our domain name or server IP address (if no domain name has been set up). Remember to update YOUR_DATABASE_USERNAME and YOUR_DATABASE_PASSWORDAPP_NAME=laravel-deploy-demoAPP_ENV=productionAPP_DEBUG=falseAPP_URL=http://DOMAIN_NAME_OR_IP_ADDRESSDB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=laravel-deploy-demoDB_USERNAME=YOUR_DATABASE_USERNAMEDB_PASSWORD=YOUR_DATABASE_PASSWORD
$
sudo
chown -R www-data: storage
$
sudo
chmod -R 755 storage
-----------------------------------------------------------------------------------------------------------------------
To take the Project Live
-----------------------------------------------------------------------------------------------------------------------
17) Finally we need to point our server to the Laravel project public folder. We need to edit our Apache config
nano /etc/apache2/sites-enabled/000-default.conf
There are two lines in this config file that we need to updated
DocumentRoot
/var/www
<Directory /var/www>
We need to change them to point the public folder in our project public folder
DocumentRoot
/var/www/project/public
<Directory /var/www/project/public>
Also we need to add the following two lines inside of that same Directory tag
RewriteEngine
On
RewriteBase /var/www/project/public
Once that’s finished and saved enter
a2enmod rewrite
we
need to restart Apache
$ sudo service apache2 restart
In case of error:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
$sudo nano /etc/apache2/apache2.confadd to the end of fileServerName 64.xxx.xx.xxx
sudo systemctl restart apache2
References:
https://scotch.io/tutorials/deploying-laravel-to-digitalocean
----------------------------------------------------------------------------------------------------------------------
Additional things you may do:
------------------------------------------------------------------------------------------------------------------------
1)set up phpmyadmin
2) login to the server as non root user with admin prevelege for security.
from local computer enter the command to access server:
ssh root@IP_ADDRESS
then create a new user using command
addusernew_user
3) To give new user sabi admin preveleges
usermod
-aG sudo new_user
4)copy
public key to your new server
cat ~/.ssh/id_rsa.pub //run local to get public key5) In the server give the command assu -user6) we need to create a new directory called .ssh and restrict its permission:mkdir ~/.sshchmod 700 ~/.ssh7) Within the .ssh directory, create a new file called authorized_keys:touch ~/.ssh/authorized_keys8)open the file using cmdvim ~/.ssh/authorized_keys //paste ssh copied from local here9) esc shift :wq + enter10) restrict permissions of authorised file using the command:chmod 600 ~/.ssh/authorized_keys //restrict permissionexit //return to root10) hit ip address
1)After building your laravel project locally, create a new file 'Procfile'
using the command:
echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile
1) push all the files to github
2) Install Heroku on cli
snap install –classic heroku
3) login to the website using
username
pwd
heroku login
4) create app using the command heroku create <myappname>//https://montahacouture.herokuapp.com5) heroku buildpacks:set heroku/php//Changes to be made in the laravel app, before pushing to heroku
6) To get the app key run php artisan key:generate --show
7) set it to the config using the command heroku config:set APP_KEY=base64:tD5sha+/lhd11B5b0dd+apImCVp7dETAAhvoFbn6K9M=
8) We need to set the error log to Heroku error log.
To do that, go to config/app.php and
set "log"=>"errorlog".
9)To host on heroku run
git push heroku master --app <myappname>
Note: the part is --app <myappname>
only necessary if you have more than one app hosted on Heroku.
6) to launch the app from command line
heroku open --app <myappname>------------------------------------------------------------------------------------------------------------------------Integrating Steps to host mysql DB for free:
----------------------------------------------------------------------------------------------------------------------
1)
Go to resources , use Add ons : select
Cleardb with ignite free
or using the command line
heroku addons:create cleardb:ignite
2)To get the cleardb url run the command heroku config | grep CLEARDB
the resulting url is of the form
DATABASE_URL='mysql://username:password@hostname/database_name?reconnect=true
9)set config vars using the commandheroku config:set DATABASE_URL='mysql://username:password@hostname/database_name?reconnect=true'
10) export data from thelocalDB.
11)import it to heroku using the commandmysql -uYOUR_USERNAME -p YOUR_DATABASE --host=YOUR_HOST < path/local/export/db_dumps/db_2019-09-26.sqlpassword:YOUR_PASSWORD-----------------------------------------------------------------------------Other Changes made for pushing to Heroku:app/Providers/AppServiceProvider.php //addedif(config('app.env') ==='production') {\URL::forceScheme('https'); }modified: config/app.php //’log => ‘errorlog’deleted vendor foldermodified: config/database.php
Now
go to your config/database.php and comment as shown below and then copy the following.
// ‘mysql’ => [
// ‘driver’ =>
‘mysql’,
// ‘host’ => env(‘DB_HOST’,
‘127.0.0.1’),
// ‘port’ => env(‘DB_PORT’,
‘3306’),
// ‘database’ => env(‘DB_DATABASE’,
‘forge’),
// ‘username’ => env(‘DB_USERNAME’,
‘forge’),
// ‘password’ => env(‘DB_PASSWORD’,
‘’),
// ‘unix_socket’ => env(‘DB_SOCKET’, ‘’),
//
‘charset’ => ‘utf8mb4’,
// ‘collation’ =>
‘utf8mb4_unicode_ci’,
// ‘prefix’ => ‘’,
//
‘strict’ => false,
// ‘engine’ => null,
//
],
‘mysql’ => [
‘driver’ =>
‘mysql’,
‘host’ => ‘db4free.net’,
‘port’
=> ‘3306’,
‘database’ => dbname,
‘username’
=> dbusername,
‘password’ =>dbpassword,
‘charset’
=> ‘utf8mb4’,
‘collation’ =>
‘utf8mb4_unicode_ci’,
‘prefix’ => ‘’,
‘strict’
=> false,
‘engine’ =>
null,
‘modes’=>[
‘ONLY_FULL_GROUP_BY’,
‘STRICT_TRANS_TABLES’,
‘NO_ZERO_IN_DATE’,
‘NO_ZERO_DATE’,
‘ERROR_FOR_DIVISION_BY_ZERO’,
‘NO_ENGINE_SUBSTITUTION’,
],
There you have finished laravel hosting for free!!!
References:
1) https://dev.to/nedsoft/how-to-host-a-laravel-app-with-mysql-database-on-heroku-52np
2) https://medium.com/@segunemma2003/how-to-deploy-laravel-to-heroku-with-mysql-database-3b51bc50d95f
1) Run git clone or download zip
//if you don't find any files, then the clone is in a different branch
To see all the branches:
git branch -a
To go to that branch
git checkout branchName
2) Run composer install
3) cp .env.example .env
4) php artisan key:generate
5) php artisan migrate
//php artisan migrate --seed
6) php artisan serve
You will see your website up and running in localhost:8000
Virtual Host In windows can be created in just two steps:
Prerequisite: You have a project folder up and running inside var/www/html
1) C:\Windows\system32\drivers\etc\hosts
add ip address followed by host name(folder name: var/www/html/projectname.com)
127.0.0.1 example.com
2)C:\xampp\apache\conf\extra\httpd-vhosts.conf
remove # and edit the contents for each one
References:
https://medium.com/@ajtech.mubasheer/configure-a-virtual-host-for-laravel-project-in-xampp-for-windows-10-d3f0068e7e1b
Install/upgrade php switch between php versions
sudo a2dismod php8.0systemctl restart apache2
sudo a2enmod php7.4systemctl restart apache2
$ sudo update-alternatives --set php /usr/bin/php7.4
--------------------------if a2dismod php8.2 throws error : php8.2 module cannot be foundrun below command to install itsudo apt-get install libapache2-mod-php8.2Then a2dismod php8.2 will work
---------------------- References:https://www.cloudbooklet.com/how-to-upgrade-php-version-to-php-8-0-on-ubuntu/
sudo update-alternatives --set php /usr/bin/php8.2
sudo update-alternatives --set phar /usr/bin/phar8.2
sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.2
https://laravelarticle.com/laravel-barcode-tutorial
composer require milon/barcode:^5.0
(//ly dompdf to 0.8.5)
https://github.com/abedputra/Inventory-Stock-With-Scanner
https://www.zebra.com/us/en/support-downloads/printers.html
1. Take DB backup of integration and dev. Download those backup to your laptop.
2. Upload the dev DB backup to integration server. (upload to /tmp/ location as if has write permission.)
3. Git Clone integration server in your laptop.
4. Paste the app/code folder of dev into the cloned integration code.
5. Commit and push to the integration server.
6. Truncate the integration DB.
7. Import the dev DB backup (which is uploaded to /tmp/) into the integration database.
To fix cron check
https://meetanshi.com/blog/set-cron-in-magento-2/
https://support.magento.com/hc/en-us/articles/360033099451
To learn about different products
https://www.customerparadigm.com/six-types-of-magento-product-types/
Search 'Discs' In Ubuntu ,from applications, to get the name of the partition
sudo wipefs --all /dev/sdb Now, the filesystem has been wiped and the flash drive is completely clean. You can check that with:
sudo fdisk -l ou should see that the USB flash device has no partition. You need to create one. sudo cfdisk /dev/sdb sudo mkfs.vfat -n 'ALU' /dev/sdb1
Aimeos is a laravel ecommerce package. To Learn about their setup and installation,
https://github.com/aimeos/aimeos-laravel#setup
https://laravel.com/docs/6.x/authentication#included-authenticating
https://laravel-vuejs.com/aimeos-laravel-e-commerce-online-shops-b2b-and-gigacommerce/
https://websolutionstuff.com/post/how-to-generate-barcode-in-laravel
---------------------------------------------------------------------------Command to get collation for each columns of a table---------------------------------------------------------------------------- SELECT TABLE_SCHEMA
, TABLE_NAME
, COLUMN_NAME
, COLLATION_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 't_name';------------------------------------------------------------------------- Display table with a particular column name
--------------------------------------------------------------------------
SELECT
*
FROM
information_schema.columns
WHERE
column_name = 'column_name';ORSELECT
*
FROM
information_schema.columns
WHERE
column_name LIKE '%column_name%';