Installing osCommerce 4 on Dedicated Server, Cloud Server or VPS

From osCommerce Wiki
Revision as of 13:37, 2 September 2022 by Admin (talk | contribs)
Jump to navigation Jump to search

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.