Installing osCommerce 4 on Dedicated Server, Cloud Server or VPS: Difference between revisions

From osCommerce Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
(9 intermediate revisions by the same user not shown)
Line 7: Line 7:
=== '''1. Install PHP 7.4 and Apache 2.4''' ===
=== '''1. Install PHP 7.4 and Apache 2.4''' ===
Install PHP 7.4, Apache 2.4 and other software packages.
Install PHP 7.4, Apache 2.4 and other software packages.


<pre>apt install php7.4 php7.4-fpm php7.4-curl php7.4-gd php7.4-intl php7.4-
<pre>apt install php7.4 php7.4-fpm php7.4-curl php7.4-gd php7.4-intl php7.4-
Line 12: Line 13:
mbstring php7.4-mysql php7.4-soap php7.4-xml php7.4-xmlrpc php7.4-xsl
mbstring php7.4-mysql php7.4-soap php7.4-xml php7.4-xmlrpc php7.4-xsl


php7.4-zip apache2 libapache2-mod-fcgid zip python3-certbot-apache<pre>
php7.4-zip apache2 libapache2-mod-fcgid zip python3-certbot-apache</pre>


=== '''2. Configure Apache 2.4''' ===
=== '''2. Configure Apache 2.4''' ===
Line 19: Line 20:




<code>a2enmod expires fcgid headers http2 proxy_fcgi rewrite ssl</code>
<pre>a2enmod expires fcgid headers http2 proxy_fcgi rewrite ssl


<code>a2enconf php7.4-fpm</code>
a2enconf php7.4-fpm


<code>a2ensite default-ssl</code>
a2ensite default-ssl</pre>




Line 31: Line 32:




<code>vi /etc/apache2/sites-enabled/000-default.conf</code>
<pre>vi /etc/apache2/sites-enabled/000-default.conf


<code>vi /etc/apache2/sites-enabled/default-ssl.conf</code>
vi /etc/apache2/sites-enabled/default-ssl.conf


<code><Directory "/var/www/html"></code>
<Directory "/var/www/html">


<code>Options FollowSymLinks</code>
Options FollowSymLinks


<code>AllowOverride All</code>
AllowOverride All


<code>Require all granted</code>
Require all granted


<code></Directory></code>
</Directory></pre>


=== '''3. Restart PHP-FPM and Apache Services''' ===
=== '''3. Restart PHP-FPM and Apache Services''' ===
Line 49: Line 50:




<code>systemctl restart php7.4-fpm.service</code>
<pre>systemctl restart php7.4-fpm.service


<code>systemctl restart apache2.service</code>
systemctl restart apache2.service</pre>


=== '''4. Install MariaDB 10.5''' ===
=== '''4. Install MariaDB 10.5''' ===
Line 66: Line 67:




<code>mysql -e "create database domain_db; GRANT ALL PRIVILEGES ON domain_db.* TO</code>
<pre>mysql -e "create database domain_db; GRANT ALL PRIVILEGES ON domain_db.* TO


<code>domain_user@'localhost' IDENTIFIED BY 'Se6uReP@55w0rD';" -uroot</code>
domain_user@'localhost' IDENTIFIED BY 'Se6uReP@55w0rD';" -uroot</pre>


=== '''5. Install Postfix''' ===
=== '''5. Install Postfix''' ===
Line 86: Line 87:




<code>cd /var/www/html</code>
<pre>cd /var/www/html


<code>rm index.html</code>
rm index.html</pre>




Line 96: Line 97:




<code>vi /var/www/html/.user.ini</code>
<pre>vi /var/www/html/.user.ini


<code>expose_php = Off</code>
expose_php = Off


<code>max_execution_time = 600</code>
max_execution_time = 600


<code>max_input_time = 600</code>
max_input_time = 600


<code>max_input_vars = 10000</code>
max_input_vars = 10000


<code>memory_limit = 256M</code>
memory_limit = 256M


<code>post_max_size = 64M</code>
post_max_size = 64M


<code>upload_max_filesize = 64M</code>
upload_max_filesize = 64M


<code>max_file_uploads = 50</code>
max_file_uploads = 50


<code>session.gc_probability = 1</code>
session.gc_probability = 1


<code>session.gc_maxlifetime = 14400</code>
session.gc_maxlifetime = 14400</pre>





Revision as of 14:20, 27 September 2022

osCommerce is an open source Ecommerce platform produced by osCommerce Ltd in the UK and designed for global market. Based on the latest versions of PHP and MySQL/MariaDB, it is one of the fastest shopping cart solutions on the market. Oscommerce can be used by SMEs and global corporations, as it has features and simplicity to satisfy all users.

osCommerce 4 can be installed on the majority of the modern Linux-based Operating Systems without extra efforts or required, complicated server configuration. In this article we will describe several simple steps regarding installing Apache 2.4, PHP-FPM 7.4, MariaDB 10.5 and osCommerce on Debian 11.

We assume that you already have minimal Debian 11 installed (without Control Panel) on your Dedicated Server, Cloud Server or Virtual Private Server (VPS) and have root (server admin) privileges.

1. Install PHP 7.4 and Apache 2.4

Install PHP 7.4, Apache 2.4 and other software packages.


apt install php7.4 php7.4-fpm php7.4-curl php7.4-gd php7.4-intl php7.4-

mbstring php7.4-mysql php7.4-soap php7.4-xml php7.4-xmlrpc php7.4-xsl

php7.4-zip apache2 libapache2-mod-fcgid zip python3-certbot-apache

2. Configure Apache 2.4

1) Enable Apache modules and default SSL VirtualHost.


a2enmod expires fcgid headers http2 proxy_fcgi rewrite ssl

a2enconf php7.4-fpm

a2ensite default-ssl


2) Add the following code to VirtualHosts configuration files, into “VirtualHost” block.


vi /etc/apache2/sites-enabled/000-default.conf

vi /etc/apache2/sites-enabled/default-ssl.conf

<Directory "/var/www/html">

Options FollowSymLinks

AllowOverride All

Require all granted

</Directory>

3. Restart PHP-FPM and Apache Services

systemctl restart php7.4-fpm.service

systemctl restart apache2.service

4. Install MariaDB 10.5

1) Install mariadb-server and mariadb-client:


apt install mariadb-server mariadb-client


2) Create database and database user:


mysql -e "create database domain_db; GRANT ALL PRIVILEGES ON domain_db.* TO

domain_user@'localhost' IDENTIFIED BY 'Se6uReP@55w0rD';" -uroot

5. Install Postfix

To send notifications, contact emails and orders from the website we will install Postfix.


apt install postfix


Choose “Internet Site” on the Postfix configuration step.

6. Install osCommerce 4

1) Change to default Web root directory:


cd /var/www/html

rm index.html


2) Create file .user.ini in the Web root folder to adjust PHP options required by osCommerce 4:


vi /var/www/html/.user.ini

expose_php = Off

max_execution_time = 600

max_input_time = 600

max_input_vars = 10000

memory_limit = 256M

post_max_size = 64M

upload_max_filesize = 64M

max_file_uploads = 50

session.gc_probability = 1

session.gc_maxlifetime = 14400


3) Change owner for Web root directory to “www-data” recursively:


chown www-data: /var/www/html -R


4) Request Free Let's Encrypt Certificate for your domain using certbot utility. Otherwise the default self signed SSL certificate, generated by OS, will be used. Or install the valid SSL certificate.

5) Download osCommerce 4 and put the instillation pack into the default Web root directory /var/www/html

6) Open a web browser and request the domain name to be pointed to your server's IP address, or just server's IP address and follow the installation instructions.