OFORK Installation (Linux)
Preparation: Disable SELinux
Note: If your system uses SELinux, you should disable it. Otherwise OFORK will not work correctly.
To disable SELinux on 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
-
Reboot the system. After reboot, confirm that the command getenforce returns Disabled:
-
shell> getenforce
Disabled
Step 1: Install OFORK using ofork-12.0.1.tar.gz
First download the source archive as a .tar.gz file –
OFORK 12 Patch Level 1 tar.gz.
Extract the archive into /opt and rename the directory from ofork-12.0.1 to ofork.
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)
Note: OFORK requires a working Perl installation with all core modules available.
These core modules are not explicitly checked by the script.
On some systems such as RHEL, you may need to install an additional Perl core package.
To install missing Perl modules, you have the following options:
a) Install packages using your Linux distribution package manager
-
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 package name that contains the module. Usually a module like My::Module is provided by a package such as perl-My-Module. -
shell> zypper search Digest::MD5
-
Then install it:
-
shell> zypper install perl-Digest-MD5
-
For Debian, Ubuntu or compatible systems, first determine the package name. Usually a module like My::Module would be provided by a package such as libmy-module-perl.
-
shell> apt-cache search Digest::MD5
-
Then install it:
-
shell> apt-get install libdigest-md5-perl
-
Please note that not all required modules or versions may be available in your distribution repository. In that case, install them via CPAN.
b) Install required modules using the CPAN shell
Under Linux, you should run CPAN as root, because the modules must be accessible to both OFORK and the web server.
shell> perl -MCPAN -e shell;
...
install Digest::MD5
install Crypt::PasswdMD5
...
Note: In some environments, the following Perl modules may also be required:
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: Verify 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 install the Apache2 web server and mod_perl using your package manager.
Below are example commands for 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 use a conf.d directory.
On Linux systems, this is usually located under /etc/apache or /etc/apache2.
Log in as root, change into the Apache configuration directory, and link the template
/opt/ofork/scripts/apache2-httpd.include.conf as zzz_ofork.conf to ensure it loads after the other Apache configuration files.
# Debian/Ubuntu:
shell> ln -s /opt/ofork/scripts/apache2-httpd.include.conf /etc/apache2/sites-enabled/zzz_ofork.conf
OFORK requires several Apache modules for proper operation.
On many systems, you can enable them using a2enmod.
shell> a2enmod perl
shell> a2enmod version
shell> a2enmod deflate
shell> a2enmod filter
shell> a2enmod headers
After that, restart the web server to load the new configuration. On many systems this is done with systemctl restart apache2.service.
Step 6: File permissions
Run the following command as root to set the correct file and directory permissions for OFORK.
The script will try to detect the required user and group settings 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) to configure your database and basic system settings such as email accounts.
Note: The following configuration settings are recommended for MySQL setups.
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
Note: OFORK requires UTF-8 as the database storage encoding.
Step 8: First login
You can now log in to your system at http://localhost/ofork/index.pl using the credentials
configured in the web installer (user: root@localhost).
At this point, the basic system setup is complete.
Step 9: Start the OFORK daemon
The OFORK daemon is responsible for asynchronous and recurring tasks in OFORK.
It 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 ensure that the OFORK daemon is running.
Activate them by copying the files without the .dist extension.
shell> cd /opt/ofork/var/cron
shell> for foo in *.dist; do cp $foo `basename $foo .dist`; done
To enable these cron jobs on your system, you can use the Cron.sh script as the ofork user.
shell> /opt/ofork/bin/Cron.sh start
Stopping the cron jobs is also possible, for example during maintenance:
shell> /opt/ofork/bin/Cron.sh stop
Note: If you have problems with the installation, you can send a message to
support@o-fork.com.
Our professional services can help you implement OFORK faster and get the most out of your system.
