OFORK Installation
OFORK Installation (Linux)
Preparation: Disable SELinux
To disable SELinux for RHEL / CentOS / Fedora:
-
Configure SELINUX=disabled in the /etc/selinux/config file:
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
-
Restart your system. After the restart, confirm that the getenforce command returns "Disabled":
shell> getenforce Disabled
Step 1: Install OFORK using ofork-12.0.1.tar.gz
First download the source archive as .tar.gz - OFORK 12 Patch Level 1 tar.gz.
Extract the archive, for example with tar, into the /opt directory and rename the directory from ofork-12.0.1 to ofork as shown below.
shell> cd /opt shell> wget https://ftp.o-fork.de/ofork-12.0.1.tar.gz shell> tar xzf ofork-12.0.1.tar.gz shell> mv ofork-12.0.1 ofork
Step 2: Install additional Perl modules
Use the following script to get an overview of all installed and required CPAN modules.
shell> perl /opt/ofork/bin/ofork.CheckModules.pl o CGI..............................ok (v3.60) o Crypt::PasswdMD5.................ok (v1.3) o Crypt::SSLeay....................Not installed! (Optional - Required for Generic Interface SOAP SSL connections.) o CSS::Minifier....................ok (v0.01) o Date::Format.....................ok (v2.22) o Date::Pcalc......................ok (v1.2)
These modules are not explicitly checked by the script.
On some systems such as RHEL, you may need to install a Perl core package. Perl core packages are not installed by default.
To install missing Perl modules, you have the following options:
a) Install the packages through the package manager of your Linux distribution
-
For Red Hat, CentOS, Fedora or compatible systems
shell> yum install "perl(Digest::MD5)"
-
For SUSE Linux Enterprise Server, openSUSE or compatible systems:
First determine the name of the package that provides the module. Usually, the package for My::Module would be called "perl-My-Module".
shell> zypper search Digest::MD5
-
Then install:
shell> zypper install perl-Digest-MD5
-
For Debian, Ubuntu or compatible systems, first determine the name of the package that provides the module. Usually, the package for My::Module would be called "libmy-module-perl".
shell> apt-cache search Digest::MD5
-
Then install:
shell> apt-get install libdigest-md5-perl
-
Please note that you may not find all modules or the required versions in your distribution repository. In that case, you can install these modules through CPAN as described below.
b) Install the required modules through the CPAN shell
Please note that on Linux you should run CPAN as root because the modules are accessed by both OFORK and the web server.
shell> perl -MCPAN -e shell; ... install Digest::MD5 install Crypt::PasswdMD5 ...
cpan install Moo
cpan install Types::Standard
or
sudo apt-get install -y libtypes-path-tiny-perl
sudo apt-get install -y libmoo-perl
Step 3: Create the OFORK user
Create the user:
shell> useradd -d /opt/ofork -c 'OFORK user' ofork
Add the user to the web server group if the web server is not running as the OFORK user.
shell> usermod -G www ofork (SUSE=www, Red Hat/CentOS/Fedora=apache, Debian/Ubuntu=www-data)
Step 4: Check that all required modules are installed
shell> perl -cw /opt/ofork/bin/cgi-bin/index.pl /opt/ofork/bin/cgi-bin/index.pl syntax OK shell> perl -cw /opt/ofork/bin/cgi-bin/customer.pl /opt/ofork/bin/cgi-bin/customer.pl syntax OK shell> perl -cw /opt/ofork/bin/ofork.Console.pl /opt/ofork/bin/ofork.Console.pl syntax OK
Step 5: Configure the Apache web server
First, you should install the Apache2 web server and mod_perl. Usually, this is done through your system package manager.
The following commands show how to set up Apache for the most common Linux distributions.
# RHEL / CentOS: shell> yum install httpd mod_perl # SuSE: shell> zypper install apache2-mod_perl # Debian/Ubuntu: shell> apt-get install apache2 libapache2-mod-perl2
Most Apache installations have a conf.d directory.
On Linux systems, you usually find this directory under /etc/apache or /etc/apache2.
Log in as root, change to the conf.d directory and link the corresponding template
from /opt/ofork/scripts/apache2-httpd.include.conf to a file named zzz_ofork.conf in the Apache configuration directory to make sure it is loaded after the other configurations.
# Debian/Ubuntu: shell> ln -s /opt/ofork/scripts/apache2-httpd.include.conf /etc/apache2/sites-enabled/zzz_ofork.conf
OFORK requires several Apache modules to be active for optimal operation.
On most platforms, you can make sure they are active by using the a2enmod tool.
shell> a2enmod perl shell> a2enmod version shell> a2enmod deflate shell> a2enmod filter shell> a2enmod headers
You can now restart your web server to load the new configuration settings.
On most systems, you can do this with the command systemctl restart apache2.service.
Step 6: File permissions
Please run the following command as the root user to set the file and directory permissions for OFORK.
The script tries to detect the correct user and group settings required for your setup.
shell> cd /opt/ofork/ shell> bin/ofork.SetPermissions.pl
Step 7: Database setup and basic system configuration
Use the web installer at http://localhost/ofork/installer.pl. Replace "localhost" with your OFORK host name.
Use it to set up your database and basic system settings such as email accounts.
Please add the following lines to /etc/my.cnf in the [mysqld] section:
max_allowed_packet = 64M query_cache_size = 32M innodb_log_file_size = 256M
Step 8: First login
You can now log in to your system at http://localhost/ofork/index.pl using the credentials
you configured in the web installer (user: root @ localhost).
This completes the basic system setup.
Step 9: Start the OFORK daemon
The OFORK daemon is responsible for handling asynchronous and recurring tasks in OFORK.
The daemon also handles all GenericAgent jobs and must be started by the ofork user.
shell> /opt/ofork/bin/ofork.Daemon.pl start
Step 10: Cron jobs for the OFORK user
There are two default OFORK cron files in /opt/ofork/var/cron/*.dist. Their purpose is to make sure that the OFORK daemon is running.
They must be activated by copying them without the ".dist" file extension.
shell> cd /opt/ofork/var/cron shell> for foo in *.dist; do cp $foo `basename $foo .dist`; done
To activate these cron jobs on your system, you can use the Cron.sh script with the ofork user.
shell> /opt/ofork/bin/Cron.sh start
Stopping the cron jobs is also possible and useful for maintenance:
shell> /opt/ofork/bin/Cron.sh stop
Our professional services will be happy to help you implement OFORK faster and use OFORK optimally.