Home Blog Page 324

Launch your Ecommerce Business for Free with Open Source Solutions

By Cédric Geffroy

At present, there are a lot of saas ecommerce software used to launch an ecommerce business. Softwares like Shopify, Volusion or BigCommerce are often seen as the best choice because they are easier to use and quicker to deploy. However, these assumptions are wrong, especially when you need custom development for your ecommerce site or when you want to add some advanced functions that will help your business grow. This is because these softwares do not allow you to customize your website just the way you want it.

By using open source solutions you are sure to have unlimited potential building your ecommerce site just the way you want it. It offers you a cost-effective solution that can be deployed within a short time.

For this tutorial I have made use of the worldwide used solution that offers flexibility with large community of users. Here are the suggested options:

Prestashop 1.6: This is currently the most stable and advanced open source ecommerce solution with a community of more than one million members, one thousand contributors and 250 agencies (just in case you need a little help…). The 1.6 version has been replaced by the completely revamped 1.7 version which includes Symfony framework. However, I still recommend using the 1.6 version as the 1.7 will probably need a few more releases to be as stable and as efficient as the 1.6.

Linux LEMP on 16.04 + MariaDB: On distribution, LEMP (Linux, Nginx, Mysql and PHP) is the best option when combined with MariaDb in place of Mysql. I also recommend using a cloud hosting company like Digital Ocean, because they have a strong community with well written tutorials and available support. They offer a one click LEMP installation, just like other hosting companies.

After installing your one-click LEMP, log in to your server and check if all your services are up to date.

  • apt-get update

  • apt-get upgrade

I also recommend installing this useful extract tool which will be able to “Do the Right eXtraction” (DTRX) for any archive.

  • apt-get install dtrx

Uninstall Mysql (to install MariaDB)

  • apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.7

  • mysql-client-core-5.7

  • rm -rf /etc/mysql /var/lib/mysql

  • apt-get autoremove

  • apt-get autoclean

Install MariaDb

  • apt-get update

  • apt-get install mariadb-server

Launch MariaDB configuration

  • mysql_secure_installation

  • Enter current password for root: No current password so press Enter

  • Set root password : Y

  • Remove anonymous users: Y

  • Disallow root login remotely: Y

  • Remove test database and access to it: Y

  • Reload privilege tables now: Y

Install phpMyAdmin – your database administration tool

  • apt-get install phpmyadmin

  • select apache2

  • Configure database for phpmyadmin with dbconfig-common : YES

  • type a new password

  • ln -s /usr/share/phpmyadmin/ /var/www/html/XXXXXXXXX

Replace XXXXXXXXX by a non-obvious name that will allow you to access your phpMyAdmin web page. http://ip_server/XXXXXXXXXX

  • service nginx restart

Modify privileges of phpMyAdmin user

Connect to mysql

  • mysql -u root -p

Type password chosen during mysql installation.

  • GRANT ALL PRIVILEGES ON *.* TO ‘phpmyadmin’@’localhost’ WITH GRANT OPTION;

  • FLUSH PRIVILEGES;

CTRL+C to exit mysql.

Secure phpMyAdmin

We will add password authentication on the phpMyAdmin page to add a layer of security. Execute next command, type a new password and copy the key returned

  • openssl passwd

Create a directory to store this login and password

  • mkdir /etc/nginx/passwd

Create file to store login and key of password with command

  • nano /etc/nginx/passwd/pma_pass

Your file should contain your login and key like that:

  • login:key_returned

(Use something less obvious than “login”)

Save and close by using CTRL+X and typing “Y” + ENTER

Modify your default vhost to access your phpMyAdmin page

  • nano /etc/nginx/sites-available/digitalocean

After:

  • location / { ……….. }

Add:

  • location /XXXXXXXXXX {

auth_basic “Private”;

auth_basic_user_file /etc/nginx/passwd/pma_pass;

}

Replace XXXXXXXXXX by the name used to access your phpMyAdmin page.

Save and close by using CTRL+X and typing “Y” + ENTER

  • service nginx restart

Create a new vhost for your ecommerce website

  • mkdir -p /var/www/example.com/

  • cd /var/www/example.com/

Download PrestaShop (last 1.6 version) and extract

  • wgethttps://download.prestashop.com/download/releases/prestashop_1.6.1.20.zip

  • dtrx prestashop_1.6.1.20.zip

Remove zip archive and move prestashop main directory

  • rm prestashop_1.6.1.20.zip

  • mv /var/www/example.com/prestashop_1.6.1.20/prestashop/ /var/www/example.com/html

  • rm -r prestashop_1.6.1.20/

Modify group/user of directory

  • chown -R www-data:www-data /var/www/example.com/html

Make sure directories are set to 755 and files to 644

  • find. -type d -print0 | xargs -0 chmod 0755

  • find. -type f -print0 | xargs -0 chmod 0644

Now, we have to create the NGINX vhost for our Prestashop 1.6. You can use this example which has been modified to work on an https PrestaShop website. It might need some tuning depending on your needs.

See attached file

Create your vhost file and paste the vhost example (don’t forget to replace example.com by your domain)

  • nano /etc/nginx/sites-available/example.com

Activate the vhost

  • ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

  • service nginx restart

Tune the PHP configuration

Open the php.ini file and change parameters to match those values

  • nano /etc/php/7.0/fpm/php.ini

  • memory_limit = 256M

  • post_max_size=32M;

  • max_input_vars=10000

max_input_vars is probably commented, remove the “;” at the beginning of the line.

You can use CTRL+W to search in the file.  

Save and close by using CTRL+X and typing “Y” + ENTER

Reload the configuration:

  • service php7.0-fpm reload

Install Postfix

Next, we would love to send emails from our shop, therefore we need to install a mail solution used as a send only tool like Postfix.

  • apt-get install mailutils

  • Choose: Internet Site

  • Type domain: example.com

Next, tune the Postfix configuration:

  • Sudo nano /etc/postfix/main.cf

  • Modify this line:

inet_interfaces = all

  • To this:

inet_interfaces = loopback-only

  • Modify this line:

mydestination = $myhostname, example.com, localhost.com, , localhost

  • To this:

mydestination = $myhostname, localhost.$mydomain, $mydomain

Save and close by using CTRL+X and typing “Y” + ENTER

Restart Postfix

  • systemctl restart postfix

Create a database for your PrestaShop

Access your phpMyAdmin interface with this url http://ip_server/XXXXXXXXXX

XXXXXXXXXX is what you chose previously.

You will be prompted with a popup login form, type your login and password chosen for the extra security layer step earlier. On the phpMyAdmin login page type “phpmyadmin” as login and the password chosen during phpMyAdmin installation process.

To add a new database and its user:

  • Click “New” on the left hand side menu.

  • Type and select in dropdown menu.

  • Click

  • On page loaded click on

  • Click on “Add user account”

  • Username: choose username for your database

  • Host name: localhost

  • Password: choose your password

  • Check the checkbox “Grant all privileges on database “XXXXXX”.”

  • Click OK on bottom of page

  • On next page click OK on bottom of page.

Install Prestashop

Go to your website URL: http://www.example.com

  • Choose language and click Next

  • Accept License Agreements and click Next

  • Fill out form and click Next

  • On Database configuration page:

  • Database server address: localhost

  • Database name: the name you picked

  • Database login: username you picked

  • Database password:password you picked

  • Tables prefix: leave “_ps”

  • Click on “Test your database connection now!”

  • Click on Next

Congrats, “Your installation is finished!”

Click on the back office button on this page and bookmark the URL

Remove the install folder with command:

  • rm -r /var/www/example.com/html/install

Now you should be able to access your store with the url: http://www.example.com

Install the SSL certificate

  • apt-get update

  • apt-get install software-properties-common

  • add-apt-repository ppa:certbot/certbot

  • apt-get update

  • apt-get install python-certbot-nginx

  • certbot –nginx

  • Type your email

  • Agree terms: A

  • Share email or not (it’s up to you)

  • Which names would you like to activate HTTPS for?

Hit enter for both with and without www

  • Redirect HTTP traffic to HTTPS website

Select: 2

Use this command to automatically renew your certificates:

  • certbot renew –dry-run

Configure your PrestaShop to work with https.

  • Login to your PrestaShop backoffice

  • Preferences > General

  • Enable SSL: YES

  • Click Save at the bottom of page

After reloading

  • Enable SSL on all pages: YES

  • Click Save at the bottom of page

BOOM, you can now access your store through HTTPS.

References

This article was written based on my years of experience and other tutorials, articles I found on the web in the last few years of my constant research. Notable among this sites are

Many StackOverflow or AskUbuntu answers:

Top 10 Reasons to Join the Premier European Open Source Event of the Year | Register Now to Save $150

See why you need to be at Open Source Summit Europe and Embedded Linux Conference + OpenIoT Summit Europe next month! Hurry — space is going quickly. Secure your spot and register by September 22 to save $150.

Here are the Top 10 Reasons you’ll want to be at this event:

  1. Timely Cutting-edge Content: 300+ sessions on Linux development, embedded Linux systems, IoT, cloud native development, cloud infrastructure, AI, blockchain and open source program management & community leadership.
  2. Deep Dive Labs & Tutorials: An Introduction to Linux Control Groups (cgroups),  Building Kubernetes Native Apps with the Operator Framework, Resilient and Fast Persistent Container Storage Leveraging Linux’s Storage Functionalities,  and 10 Years of Linux Containers, are just some of the labs and tutorials included in one low registration price.
  3. 12 Co-located Events*: Come for OSS & ELC + OpenIoT Summit and stay for LF Energy Summit, Linux Security Summit, Cloud & Container Embedded Apprentice Linux Engineer tutorials, IoT Apprentice Linux Engineer tutorials, Hyperledger Scotland Meetup, Linux in Safety-Critical Systems Summit, and many more co-located events.  (*Some co-located events may require an additional registration fee.)
  4. Discover New Projects & Technologies: Over 30 sponsors will be showcasing new projects and technologies in the Sponsor Showcase throughout the event, joined by our Technical Showcase at the Onsite Attendee reception showcasing Free and Open Source Software (FOSS) projects from system developers and hardware makers.
  5. Social Activities & Evening Events: Take a break and go on a sightseeing bus tour, join the 5K fun run or morning meditation, and meet with fellow attendees through the networking app. Collaborate with fellow attendees at the attendee reception at the National Museum of Scotland and at the Onsite Attendee Reception & Sponsor + Technical Showcase.
  6. Diversity Empowerment Summit: Explore ways to advance diversity and inclusion in the community and across the technology industry.
  7. Women in Open Source Lunch &  Better Together Diversity Social: Women and non-binary members of the open source community are invited to network with each other at the lunch sponsored by Adobe, while all underrepresented minorities are welcome to attend the at the Better Together Diversity Social.
  8. Developer & Hallway Track Lounge: The highlight for many at this event is the ability to collaborate with the open source community. This dedicated lounge offers a space for developers to hack and collaborate throughout the event as well as plenty of seating for hallway track discussions.
  9. Networking Opportunities: Attend the Speed Networking & Mentoring event, OS Career Mixer, or use the networking appto expand your open source community connections by finding and meeting with attendees with similar interests.
  10. Hear from the Leading Technologists in Open Source: Keynote talks include a Linux Kernel update, a fireside chat with Linus Torvalds & Dirk Hohndel, a look at the future of AI and Deep Learning, a panel discussion on the future of energy with open source, a discussion on diversity & inclusion, a talk on the parallels between open source & video games, and insightful talks on how open source is changing banking, human rights and scientific collaboration

Sign up to receive updates on Open Source Summit Europe: 

VIEW THE FULL SCHEDULE »

REGISTER NOW »

This article originally appeared at The Linux Foundation

Why Python is So Popular with Developers: 3 Reasons the Language Has Exploded

Python is the fastest-growing programming language in the world, as it increasingly becomes used in a wide range of developer job roles and data science positions across industries. But how did it become the go-to coding language for so many tasks?

“Python is very popular because of its set of robust libraries that make it such a dynamic and a fast programming language,” said Kristen Sosulski, clinical associate professor of information, operations, and management sciences in the Leonard N. Stern School of Business at New York University, and author of Data Visualization Made Simple. “It’s object-oriented, and it really allows for everything from creating a website, to app development, to creating different types of data models.”

Python has the best claim to being the fastest-growing major programming language right now, said Stack Overflow data scientist Julia Silge. Developer Stack Overflow visits to Python have grown very quickly, she added: This year, it became the most visited programming language in the world on the site.

Read more at TechRepublic

Examining Partitions on Linux Systems

Linux systems provide many ways to look at disk partitions. Here’s a look at commands you can use to display useful information — each providing a different format and with a different focus.

Linux systems provide many ways to look at disk partitions. In this post, we’ll look at a series of commands, each which shows useful information but in a different format and with a different focus. Maybe one will make your favorites list.

lsblk

One of the most useful commands is the lsblk (list block devices) command that provides a very nicely formatted display of block devices and disk partitions. In the example below, we can see that the system has two disks (sda and sdb) and that sdb has both a very small (500M) partition and a large one (465.3G). Disks and partitions (part) are clearly labeled, and the relationship between the disks and partitions is quite obvious. We also see that the system has a cdrom (sr0).

Read more at NetworkWorld

18 Python Programming Books for Beginners and Veterans

Who knew there were so many helpful books out there for Python programmers? This curated list is just a drop in the bucket. As you may know, Python is soaring in popularity.

Let’s just say, it might be a good idea to get started learning more about Python soon or buffing up on your Python skills. So, I asked our writer community to share their top recommendations. Surprisingly, I only received one duplicate out of nineteen responses.

I didn’t break this list down into beginner books and advanced books because I recently listened to an insightful podcast about how the more experienced in a task or subject we become the more likely we are to believe we know everything about it. Yet, refreshing ourselves on the basics and performing simple acts like running through a checklist is important for all of us, for the beginner and advanced user alike.

Or, maybe you prefer to start out in the deep end. Either way, let’s dive in.

Read more at OpenSource.com

Create and View Custom Trace Data in User Node.js Code

Tracing is a convenient way for developers to monitor and analyze application performance at runtime. Node.js offers a few options to generate and diagnose custom trace data in JavaScript applications.

The built-in trace mechanism supports centralized tracing for not only V8 and Node.js core, but also userspace code. For the userspace tracing, Node provides the async_hooks and embedder API to trace async resources. Additionally the developers can produce trace data for their own code segments which is not formally documented.

In this tutorial, follow the steps to define a new trace category, generate custom trace data into the standard Node trace log file, and visualize trace data for centralized performance analysis.

Learning objectives

After completing this guide you will know how to:

  • Define, enable, and disable a trace category in a Node application.
  • Add custom trace events and parameters into a Node application.
  • View the custom trace data generated by a Node application.

Read more at IBM Developer

A Hitchhiker’s Guide to Deploying Hyperledger Fabric on Kubernetes

Deploying a multi-component system like Hyperledger Fabric to production is challenging. Join us Wednesday, September 26, 2018 9:00 a.m. Pacific for an introductory webinar, presented by Alejandro (Sasha) Vicente Grabovetsky and Nicola Paoli of AID:Tech.

Why should you care?

Hyperledger Fabric is rather awesome, but deploying a distributed network has been known to give headaches and even migraines. In this talk, we will not be providing you with a guillotine that forever gets rid of these headaches, but instead we will talk you through some tools that can help you deploy a functioning, production-ready Hyperledger Fabric network on a Kubernetes cluster.

Who should attend?

Ideally, you are a Dev, an Ops or a DevOps interested in learning more about how to deploy Hyperledger Fabric to Kubernetes.

You might know a little bit about Hyperledger Fabric and about Docker containers and Kubernetes. We assume limited knowledge and will do our best to as possible and explain and demystify all the components along the way.

Read more at The Linux Foundation

 

Support for a LoRaWAN Subsystem

Sometimes kernel developers find themselves competing with each other to get their version of a particular feature into the kernel. But sometimes developers discover they’ve been working along very similar lines, and the only reason they hadn’t been working together was that they just didn’t know each other existed.

Recently, Jian-Hong Pan asked if there was any interest in a LoRaWAN subsystem he’d been working on. LoRaWAN is a commercial networking protocol implementing a low-power wide-area network (LPWAN) allowing relatively slow communications between things, generally phone sensors and other internet of things devices. Jian-Hong posted a link to the work he’d done so far:https://github.com/starnight/LoRa/tree/lorawan-ndo/LoRaWAN.

He specifically wanted to know “should we add the definitions into corresponding kernel header files now, if LoRaWAN will be accepted as a subsystem in Linux?” The reason he was asking was that each definition had its own number. Adding them into the kernel would mean the numbers associated with any future LoRaWAN subsystem would stay the same during development.

However, Marcel Holtmann explained the process:

Read more at Linux Journal

Agile Project Management: A Comprehensive Guide

Geared toward continuous improvement, the agile methodology can greatly increase your project’s prospects for success. Here is everything you need to know about agile project management, from certification to training to software and more.

What is agile?

Agile is a project management methodology that uses short development cycles called “sprints” to focus on continuous improvement in the development of a product or service.

Although incremental software development methods go as far back as 1957, agile was first discussed in depth in the 1970s by William Royce who published a paper on the development of large software systems. Later in 2001, the Agile Manifesto, a “formal proclamation of four key values and 12 principles to guide an iterative and people-centric approach to software development,” was published by 17 software developers. These developers gathered together to discuss lightweight development methods based on their combined experience.

Read more at CIO.com

2 Ways to Re-Run Last Executed Commands in Linux

One of the greatest features of Bash is the command history, which stores all commands a user runs, in a history file within his/her home directory (typically /home/$USER/.bash_history). This allows the user to easily recall, edit and rerun previous commands.

In this article, we will demonstrate how to re-execute a specific command from the history of commands entered to a shell. This is useful to avoid typing the same commands over and over again.

Normally, to get a command you recently run, you can use the Up arrow keys to retrieve a previous command. Pressing it constantly takes you through multiple commands in history, so you can find the one you want. Use the Down arrow to move in the reverse direction.

However, the history file may contain a lot of entries, to re-execute a specific command from the history of commands, you can run the history command.

Read more at Tecmint