# Can anybody show me how to install the port orangehrm on a fresh virtualbox with FreeBSD 11.2 on it using Apache2.4



## Relictrix (Nov 9, 2018)

Hi,

I followed the instructions for installing the orangehrm port, the installation works fine. However when starting the apache2.4 (which works fine as well) I always receive:
Fri Nov 09 16:57:37.338523 2018] [authz_core:error] [pid 1282] [client 127.0.0.1:61015] AH01630: client denied by server configuration: /usr/local/www/orangehrm/
[Fri Nov 09 16:57:37.570702 2018] [authz_core:error] [pid 1282] [client 127.0.0.1:61015] AH01630: client denied by server configuration: /usr/local/www/orangehrm/favicon.ico

Seems to me a typical Apache error , so not necessary something to do with orangehrm I tried already for 2 days, nothing worked.

There are not 1000 ways to install things but if the port show this information and I test it. Then why does it not work, nobody ever tested this or?

These are the instructions:
POST-INSTALL CONFIGURATION FOR OrangeHRM
=====================================

1) Add the following to your Apache configuration, and
   restart the server:

   For Apache versions earlier than 2.4:

   Alias /orangehrm /usr/local/www/orangehrm/
   AcceptPathInfo On
   <Directory /usr/local/www/orangehrm>
      AllowOverride All
      Order Allow,Deny
      Allow from all
   </Directory>

   For Apache version 2.4.x or above:

   Alias /orangehrm /usr/local/www/orangehrm/
   AcceptPathInfo On
   <Directory /usr/local/www/oranghrm/>
      AllowOverride All
      Require all granted
   </Directory>

2) Visit your OrangeHRM site with a browser (i.e.,
http://your.server.com/orangehrm), and you should
   be taken to the setup script, which will lead
   you through creating a configuration file and then
   setting up OrangeHRM, creating an admin account, etc.

For more information, see the INSTALL DOCUMENTATION:

http://www.orangehrm.com/installation-Linux.shtml

================================================================

Thanks in advance for helping out.

Best Regards,

R


----------



## VladiBG (Nov 9, 2018)

Can you show your configuration from /usr/local/etc/apache24/Includes/ directory?


----------



## Relictrix (Nov 9, 2018)

root@vm1:/usr/local/etc/apache24/Includes # ls -rlt
total 5
-rw-r--r--  1 root  wheel   89 Oct  2 06:15 no-accf.conf
-rw-r--r--  1 root  wheel  252 Nov  4 16:06 php.conf

root@vm1:/usr/local/etc/apache24/Includes # cat php.conf 
<IfModule dir_module>
    DirectoryIndex index.php index.html
<FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
</IfModule>
root@vm1:/usr/local/etc/apache24/Includes #


----------



## VladiBG (Nov 9, 2018)

You need to create your config to allow the access to the /usr/local/www/orangehrm/  directory.

Create a file in `/usr/local/etc/apache24/Includes` with some name like orangehrm.conf and put the configuration there:



```
Alias /orangehrm /usr/local/www/orangehrm/

AcceptPathInfo On

<Directory /usr/local/www/orangehrm/>
AllowOverride All
Require all granted
</Directory>
```

This will grand all access to that directory.

If you previously modify your httpd.conf it's better to reverse the changes that you made there.
Then reload the apache.


----------



## Relictrix (Nov 9, 2018)

Ok lets give that a try. One moment i do it now.


----------



## Relictrix (Nov 9, 2018)

Thanks for the quick reply, these are the results:


I reverted the httpd.conf.
The content of the orangehrm.conf is set:
root@vm1:/usr/local/etc/apache24/Includes # ls -rlt
total 10
-rw-r--r--  1 root  wheel   89 Oct  2 06:15 no-accf.conf
-rw-r--r--  1 root  wheel  252 Nov  4 16:06 php.conf
-rw-r--r--  1 root  wheel  152 Nov  9 18:16 orangehrm.conf
root@vm1:/usr/local/etc/apache24/Includes # cat orangehrm.conf
Alias /orangehrm /usr/local/www/orangehrm/

AcceptPathInfo On

<Directory /usr/local/www/oranghrm/>
AllowOverride All
Require all granted
</Directory>

root@vm1:/usr/local/etc/apache24/Includes #
Restarted the apache24 service.
[Fri Nov 09 18:23:17.091826 2018] [mpm_prefork:notice] [pid 1553] AH00169: caught SIGTERM, shutting down[Fri Nov 09 18:23:17.254253 2018] [mpm_prefork:notice] [pid 1614] AH00163: Apache/2.4.35 (FreeBSD) configured -- resuming normal operations
[Fri Nov 09 18:23:17.254926 2018] [core:notice] [pid 1614] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'



root@vm1:/usr/local/etc/apache24/Includes # httpd -S
VirtualHost configuration:
ServerRoot: "/usr/local"
Main DocumentRoot: "/usr/local/www/apache24/data"
Main ErrorLog: "/var/log/httpd-error.log"
Mutex default: dir="/var/run/" mechanism=default 
Mutex mpm-accept: using_defaults
PidFile: "/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www" id=80
Group: name="www" id=80
root@vm1:/usr/local/etc/apache24/Includes # 
Test on : http://localhost/orangehrm -> resulted in forbidden
[Fri Nov 09 18:24:40.026110 2018] [authz_core:error] [pid 1615] [client 127.0.0.1:57967] AH01630: client denied by server configuration: /usr/local/www/orangehrm/
As you can see i did also a chmod and chown because i really did not know how to get it working:
root@vm1:/usr/local/etc/apache24/Includes # ls -rlt /usr/local/www/orangehrm/
total 5328
-rwxrwxrwx   1 www  www      8042 Sep  5 19:11 sysinfo.php
-rwxrwxrwx   1 www  www       884 Sep  5 19:11 phpunit.xml
-rwxrwxrwx   1 www  www      2301 Sep  5 19:11 orangehrm_updates.php
-rwxrwxrwx   1 www  www      9368 Sep  5 19:11 install.php
-rwxrwxrwx   1 www  www      1291 Sep  5 19:11 index.php
-rwxrwxrwx   1 www  www       223 Sep  5 19:11 fix_permissions.sh
-rwxrwxrwx   1 www  www     14387 Sep  5 19:11 faq.html
-rwxrwxrwx   1 www  www      3315 Sep  5 19:11 error.xsl
-rwxrwxrwx   1 www  www       210 Sep  5 19:11 codeception.yml
-rwxrwxrwx   1 www  www  10608444 Sep  5 19:11 codecept.phar
-rwxrwxrwx   1 www  www       172 Sep  5 19:11 apidoc.json
-rwxrwxrwx   1 www  www        25 Sep  5 19:11 _config.yml
-rwxrwxrwx   1 www  www      2579 Sep  5 19:11 README.md
-rwxrwxrwx   1 www  www      1571 Sep  5 19:11 INSTALL.html
-rwxrwxrwx   1 www  www      1721 Sep  5 19:11 Dockerfile
-rwxrwxrwx   1 www  www      1248 Sep  5 19:11 .travis.yml
-rwxrwxrwx   1 www  www       236 Sep  5 19:11 .htaccess
-rwxrwxrwx   1 www  www     13433 Sep  5 19:11 logo.png
-rwxrwxrwx   1 www  www      1378 Sep  5 19:11 jobs.php
-rwxrwxrwx   1 www  www    152035 Sep  5 19:11 CHANGELOG.TXT
drwxrwxrwx   3 www  www         4 Oct  3 22:03 scripts
drwxrwxrwx   3 www  www         5 Oct  3 22:03 license
drwxrwxrwx   4 www  www         4 Oct  3 22:03 lib
drwxrwxrwx   6 www  www        33 Oct  3 22:03 installer
drwxrwxrwx   2 www  www         5 Oct  3 22:03 docker-build-files
drwxrwxrwx   2 www  www         5 Oct  3 22:03 dbscript
drwxrwxrwx   2 www  www         6 Oct  3 22:03 build
drwxrwxrwx  10 www  www        11 Oct  3 22:03 upgrader
drwxrwxrwx   5 www  www         6 Oct  3 22:03 travis-config-files
drwxrwxrwx   3 www  www         3 Oct  3 22:03 themes
drwxrwxrwx   6 www  www         9 Oct  3 22:03 tests
drwxrwxrwx  10 www  www        11 Oct  3 22:03 symfony
root@vm1:/usr/local/etc/apache24/Includes #


----------



## VladiBG (Nov 9, 2018)

There's missing "e" here

<Directory /usr/local/www/oranghrm/>

shoud be:

<Directory /usr/local/www/orangehrm/>


----------



## Relictrix (Nov 9, 2018)

Hahaha, oh boy it's like that in their pkg-message.in file, for the explanation of 2.4 not for the one earlier then 2.4. Damn i totally missed that

root@vm1:/usr/ports/www/orangehrm/files # cat pkg-message.in 
POST-INSTALL CONFIGURATION FOR OrangeHRM

Ok now my errors are gone, perfect. But I only get a white screen. When I take the source or code behind of the white screen i see this:

?php
/**
 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
 * all the essential functionalities required for any enterprise.
 * Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
 *
 * OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA
 */

/* For logging PHP errors */
include_once('lib/confs/log_settings.php');

$installed = true;

define('ROOT_PATH', dirname(__FILE__));

if (!is_file(ROOT_PATH . '/lib/confs/Conf.php')) {
    $installed = false;
}

if (!$installed) {
    header('Location: ./install.php');
    exit();    
}

header("Location: ./symfony/web/index.php/auth/login");
exit();

Conclusion this is a page of OrangeHRM, but I think that  maybe i am wrong that my apache2.4 is not PHP ready. What do you think?


----------



## VladiBG (Nov 9, 2018)

Do you have php installed?

Also if there's .htaccess inside the /usr/local/www/orangehrm neet to be checked if it complies for apache24 or apache22 the syntax is different for them.

https://httpd.apache.org/docs/2.4/upgrading.html


----------



## Relictrix (Nov 10, 2018)

Hi,

This is the content of the .htaccess file: 
root@vm1:/usr/local/www/orangehrm # cat .htaccess 
IndexIgnore *

<Files log.txt>
order allow,deny
deny from all
</Files>
<Files *.log>
order allow,deny
deny from all
</Files>
<Files log*.txt>
order allow,deny
deny from all
</Files>
<Files *.yml>
order allow,deny
deny from all
</Files>
root@vm1:/usr/local/www/orangehrm # 

Is this proving that php is installed?

root@vm1:/usr/local/www/orangehrm # pkg info | grep php
mod_php56-5.6.38               PHP Scripting Language
php71-7.1.22                   PHP Scripting Language
php71-ctype-7.1.22             The ctype shared extension for php
php71-iconv-7.1.22             The iconv shared extension for php
php71-json-7.1.22              The json shared extension for php
php71-pdo-7.1.22               The pdo shared extension for php
php71-pdo_mysql-7.1.22         The pdo_mysql shared extension for php
php71-session-7.1.22           The session shared extension for php
php71-simplexml-7.1.22         The simplexml shared extension for php
php71-xml-7.1.22               The xml shared extension for php
root@vm1:/usr/local/www/orangehrm # 

I am not a hero in those two things you ask now.


----------



## VladiBG (Nov 10, 2018)

Yes you have mod_php for apache24 but you need to enable it in httpd.conf or Include directory.
I'm not sure if it's a good idea to mix different versions of mod_php56 with php71. Better check what the port requires and change it according it.

Regarding .htaccess file it need to be modified for apache24 version. You can read the changes in the following link.
https://httpd.apache.org/docs/2.4/upgrading.html


----------



## Relictrix (Nov 10, 2018)

Hi,

So first of all thanks very much for your help VladiBG. Without your expertise it would have taken me weeks.

Second a bit pitty that the explanation of OrangeHRM contained errors and does not explain more about the Apache install and configuration. 

Anyway this is the summary of steps, you can read it without going throug all previous posts:
*
0.    Install the PHP module and mod:*
pkg install lang/php71

Also install mod_php71
pkg install www/mod_php71

1.*    Start the PHP Module in Apache24:*
/usr/local/etc/apache24/Includes/php.conf
<IfModule dir_module>
    DirectoryIndex index.php index.html
<FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
</IfModule>

*2.    Configure php:*
Create a new php.ini file by copying one of the sample files.
cd /usr/local/etc/
cp php.ini-production php.ini

Open and edit /usr/local/etc/php.ini and adjust the following values:

    memory_limit: Minimum: 64M Recommended: 128M or better
    upload_max_filesize: Minimum: 20M
    post_max_size: Minimum: 20M
    max_execution_time: At Least 120 Recommended: 300


*3.    Create orangehrm config in Apache24:*
You need to create your config to allow the access to the /usr/local/www/orangehrm/ directory.

Create a file in /usr/local/etc/apache24/Includes with some name like orangehrm.conf and put the configuration there:


Code:

Alias /orangehrm /usr/local/www/orangehrm/

AcceptPathInfo On

<Directory /usr/local/www/orangehrm/>
AllowOverride All
Require all granted
</Directory>

This will grant all access to that directory.

If you previously modify your httpd.conf it's better to reverse the changes that you made there. Then reload the apache.

Then it worked.

THanks again VladiBG.

Best Regards,

R


----------



## VladiBG (Nov 11, 2018)

Relictrix said:


> Second a bit pitty that the explanation of OrangeHRM contained errors and does not explain more about the Apache install and configuration.



How to install Apache HTTP Server is a whole another story and it's shouldn't be explained in every port that requires HTTP server. For example you can use other HTTP server like NGINX. So you will need to know how to setup the webroot directory and how to manage the access of it before continue to host any webpage.

Back to the topic.
To test the installation of the php you can create a simple test page using
`echo "<?php phpinfo(); ?>" >> /usr/local/www/apache24/data/test.php`
Then open the test page http://<serverIP_or_hostname>/test.php

Because the package of www/orangehrm is with versin 4.1.2.1 the autoinstall script will fail during the create of the DB but you can installed it manually using the following method or use the updated port which is version 4.2 to install it.


`pkg install apache24 orangehrm mod_php71 php71-mysqli php71-curl mysql56-server mysql56-client`
`sysrc apache24_enable=yes`
`sysrc mysql_enable=yes`

`cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini`
edit the timezone
http://php.net/manual/en/timezones.php

`date.timezone = "Europe/Bucharest"`

create http-orangehrm.conf
cat /usr/local/etc/apache24/Includes/http-orangehrm.conf

```
Alias /om /usr/local/www/orangehrm/

AcceptPathInfo On

<Directory /usr/local/www/orangehrm/>
    AllowOverride All
    Require all granted
</Directory>
```

create http-php.conf
cat /usr/local/etc/apache24/Includes/http-php.conf

```
<IfModule dir_module>
    DirectoryIndex index.php index.html
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
</IfModule>
```

`cd /usr/local/etc/mysql`
`cp my.cnf.sample my.cnf`
add under [mysqld] section
`event_scheduler = ON`

Start the MySQL server
`service mysql-server start`

Create the DB and user with password in this example the password is 123, change it with something better.

Open the mysql console
`mysql`


```
select @@GLOBAL.event_scheduler;

CREATE USER 'om'@'localhost' IDENTIFIED BY '123';
CREATE DATABASE orangehrm_mysql;
GRANT ALL PRIVILEGES ON orangehrm_mysql.* TO 'om'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'om'@'localhost';
set GLOBAL event_scheduler =ON;

USE orangehrm_mysql;
SOURCE /usr/local/www/orangehrm/dbscript/dbscript-1.sql
SOURCE /usr/local/www/orangehrm/dbscript/dbscript-2.sql
SOURCE /usr/local/www/orangehrm/dbscript/dbscript-functions.sql

INSERT INTO `ohrm_user` (`user_name`, `user_password`, `user_role_id`) VALUES ('Admin', encrypt('123'),'1');
```


/usr/local/www/orangehrm/symfony/config/databases.yml

```
all:
  doctrine:
    class: sfDoctrineDatabase
    param:
      dsn: 'mysql:host=localhost;port=3306;dbname=orangehrm_mysql'
      username: om
      password: 123
      attributes: { export: tables }
test:
  doctrine:
    class: sfDoctrineDatabase
    param:
      dsn: 'mysql:host=localhost;port=3306;dbname=test_orangehrm_mysql'
      username: om
      password: 123
```

`cd /usr/local/www/orangehrm/lib/confs/`
`cp Conf.php-distribution Conf.php`

/usr/local/www/orangehrm/lib/confs/Conf.php

```
<?php
class Conf {

    var $smtphost;
    var $dbhost;
    var $dbport;
    var $dbname;
    var $dbuser;
    var $version;

    function __construct() {

        $this->dbhost  = '127.0.0.1';
        $this->dbport  = '3306';
        if(defined('ENVIRNOMENT') && ENVIRNOMENT == 'test'){
        $this->dbname    = 'test_orangehrm_mysql';.....
        }else {
        $this->dbname    = 'orangehrm_mysql';
        }
        $this->dbuser    = 'om';
        $this->dbpass  = '123';
        $this->version = '4.1.2.1';

        $this->emailConfiguration = dirname(__FILE__).'/mailConf.php';
        $this->errorLog =  realpath(dirname(__FILE__).'/../logs/').'/';
    }
}
?>
```

start the apache24
`apachectl start`

go to: http://<serverIP>/om/
login with user Admin and password 123 you will be asked to change the password.

Edit your /usr/local/www/orangehrm/.htaccess

```
IndexIgnore *
Options All -Indexes
RedirectMatch 404 /\..*$

<FilesMatch "(\.(bak|config|dist|inc|swp|xml|sql|sh|xsl|conf|ini|json)|~)$">
    Require all denied
</FilesMatch>

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule (/)?(build|lib|license|tests|test|apps|cache|config|data|log|plugins)(/.*)?$ - [F,NC]
</IfModule>
```

You can also try to manually install the newest version from https://github.com/orangehrm/orangehrm but you will need to install the composer by youself in orangehrm/symfony/lib/vendor

ps.
I'm not using this port and all of above is edited from the orangehrm/faq.html and orangehrm/installer/guide/


----------



## Relictrix (Nov 13, 2018)

Hi,

Wow thanks, I was setting up mysql and was again stuck. The program could not talk to the database that it created, reason was not clear. I was about to look when i was free or this weekend.

But with what I read from your comment , it will help me for sure!

I will post the result when I am there 

Best Regards,

R


----------



## Relictrix (Nov 17, 2018)

Hi,

I tried all above, but I keep getting : 
*Internal Error Occurred*

Check this log /usr/local/www/orangehrm/symfony/log/orangehrm.log :
PDO Connection Error: SQLSTATE[HY000] [1045] Access denied for user 'orangehrm'@'localhost' (using password: YES)

These are the database logs:
`root@vm1:/var/db/mysql # tail -f vm1.err`
2018-11-17T11:46:40.439207Z 0 [Note] Event Scheduler: Loaded 1 event
2018-11-17T11:46:40.439760Z 1 [Note] Event Scheduler: scheduler thread started with id 1
2018-11-17T11:46:40.439964Z 0 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.7.23-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
2018-11-17T11:46:41.381620Z 0 [Note] InnoDB: Buffer pool(s) load completed at 181117 12:46:41
2018-11-17T11:46:51.617631Z 3 [Note] Access denied for user 'orangehrm'@'localhost' (using password: YES)
2018-11-17T11:49:10.709411Z 4 [Note] Access denied for user 'orangehrm'@'localhost' (using password: YES)
2018-11-17T11:50:53.406247Z 5 [Note] Access denied for user 'orangehrm'@'localhost' (using password: YES)
2018-11-17T11:51:54.741292Z 6 [Note] Access denied for user 'orangehrm'@'localhost' (using password: YES)
2018-11-17T11:52:24.171902Z 7 [Note] Access denied for user 'orangehrm'@'localhost' (using password: YES)
2018-11-17T11:54:52.792934Z 8 [Note] Access denied for user 'orangehrm'@'localhost' (using password: YES)
2018-11-17T11:54:55.725085Z 9 [Note] Access denied for user 'orangehrm'@'localhost' (using password: YES)

Strange thing is that attempts to change the db_user from om to oma are not visible in the logs, there the logs keeps saying om. But i named my user orangehrm.

Anyway when i log into the mysql it works:
`root@vm1:~ # mysql -u orangehrm -p`
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.7.23-log Source distribution

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

orangehrm@localhost [(none)]> 

I tried with 4.1.2.1  and 4.2 . I now have 4.2.

Best Regards,

R


----------



## VladiBG (Nov 17, 2018)

check if the user has access to that database or if you are creating new database check if the user has rights to create new database.


----------



## Relictrix (Nov 17, 2018)

The user has those rights, and can access the database. The question is how does the application at a certain point calls the database or mysql component. Yet again like some things in the past with other ports, i really don't see why a user , who wants to use the port, needs to dive into these details. The time and effort we put in it is really too long. Money wise, how can you explain that? There are not 1000 ways to install this, why no script that works, really don't get this to be honest. If they ask me , can you write an installation script i can, so every port creator can also... 

But ok, i will check further ... and update here when i found something.


----------



## VladiBG (Nov 17, 2018)

to see the user rights  select the db and use use:
`SHOW GRANTS FOR 'orangehrm'@'localhost';`


----------



## ShelLuser (Nov 17, 2018)

Relictrix said:


> The user has those rights, and can access the database.


Obviously not. Make sure you didn't make any typoes in the service configuration. It has happened before where you missed an 'e' so if you did the same while setting up the password it would have the above results.

(edit)
Another issue is "_login from where?_" I see you're on vm1 but that doesn't mean that you're also automatically logging onto localhost (it seems likely, but it's no proof). And why are you trying all of this as root in the first place? That's a bad habit, don't use root if you don't have to.

Start with: `mysql -h localhost -u orangehrm -p` and see if that still works. Then double check your orangehrm configuration to see if you set up the right password, my guess is that you mistyped that somehow.
(/edit)



Relictrix said:


> Yet again like some things in the past with other ports, i really don't see why a user , who wants to use the port, needs to dive into these details. The time and effort we put in it is really too long. Money wise, how can you explain that?


Oh, puhlease give me a break.

How much money did you spent on buying this port? How much money did you spend on getting pretty professional _customized_ support as shown above?

It all boils down to a very simple basic issue: understanding the stuff you're working with. You chose to use Apache and a MySQL backend and therefor you'll need to know how to configure and use those. At least get your basics sorted out. And it hardly is as difficult as you make it sound, if you know what you're doing.

But if you want to talk money wise, sure: this is why many companies sent their staff out for training before they're allowed to use a certain piece of soft or hardware. The money invested in the training will help save money spent on having to check where things went wrong.

This is hardly any different. The main difference of course is that you didn't have to spend one single dime to pick up on this software.



Relictrix said:


> There are not 1000 ways to install this, why no script that works, really don't get this to be honest. If they ask me , can you write an installation script i can, so every port creator can also...


LOL

So why don't you do just that and put your money where your mouth is? The port maintainer is _wen at FreeBSD.org_, but keep one important thing in mind: ports (and binary packages) are merely copies of the actual software which have been altered (if needed) to work on FreeBSD. But that's also where the differences end.

Therefor this isn't an issue with the port, but more so an issue with the OrangeHRM project, found here. And will you look at that: they even provide support and training, which obviously isn't free.

So your options are very easy: If you think this should be a whole lot easier then you can opt for a support contract after which they'll do the work for you. Money "wasted" on all this can then be well spend.

But another issue is that open source projects are usually community efforts. If you feel so strongly that an installation script is needed then why not write one and send that back to the OrangeHRM project instead of whining on this forum about how difficult everything is, while it obviously isn't for anyone who knows how this stuff works?

Sorry for a rant, guess I didn't have my coffee yet, but sometimes I get a little tired with people whining about how hard and "expensive" everything is while easily accepting free software and custom tailored support without a care about the effort for the other party, only caring about trying to avoid paying for official project support (that's how it looks to me at least).


----------



## Relictrix (Nov 18, 2018)

VladiBG said:


> to see the user rights  select the db and use use:
> `SHOW GRANTS FOR 'orangehrm'@'localhost';`



orangehrm@localhost [(none)]> show grants;
+------------------------------------------------------------------------------------------+
| Grants for orangehrm@localhost                                                           |
+------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'orangehrm'@'localhost'


----------



## Relictrix (Nov 18, 2018)

I expect if there is a port that port documentation works, I don't know for how long (months , years) this error was in there. If we on top have to question if everything is valid, then what's the use?

Login is from VM itself ofc, and i just test with root because it's not even sure i will use it. All this gots nothing to do with my question about the port.

Totally not agree, very simple example, if i show my uncle who does not know much about a pc. If i show him how to install a port, i think he can do that . If I then show him the information the ports show: basically add a few lines to apache and it works. If I say to my uncle, he will surely say ofc that's just doing what's written (if there are no errors ofc). Then put 20 uncles in a classroom, and go you can all start with installing the port and making sure it runs. They will all say it does not work, they will not be able to find the problem. But they want their program, suppose he likes taking pictures and the program was to manage pictures. What will be the result? They say it does not work and they are right, because they did what the port told. And what will happen, after a few more example of this, they will install another OS .

The talk about money is the example I gave for companies, the example of my uncle is for normal users. But companies will react the same, look around you they do .

I send a mail to that person of the port already before your reaction, you know what he said?
1. Oh there is an error in your config hahaha, my config????
2. it surely is no issue with the port, here it works.

Well he can say that for 1000 years, with that you will not keep user that run programs  simple as that. And i hope it's not just build for the OS right?

From that point of view a port alone is not enough, documentation should be included. Just a simple basic working config. For somebody that has the port running, it's zero work to add a basic setup. But oh they pretend its special config and this and that, yeah sure oooh it's complicated hè. There are not 1000 ways to configure apache , symfony or whatever. And there should not be training and support for installation ports, that a nice cover for more money. If the documentation is clear we don't need this forum , and we don't need a person to spend x hours on the configuration and another person also , ... All this can be easily avoided by one single thing, document the port in a clear way.

Nobody has a clear view on how many people give up after a few failing ports that don't work. A lot my friend move to other OSs because of this. I am 100% sure.

Anyway, I will give it another try with new ideas...


----------



## VladiBG (Nov 18, 2018)

https://svnweb.freebsd.org/ports/head/www/orangehrm/files/pkg-message.in?r1=452414&r2=485136


----------



## ShelLuser (Nov 18, 2018)

Relictrix said:


> orangehrm@localhost [(none)]> show grants;
> +------------------------------------------------------------------------------------------+
> | Grants for orangehrm@localhost                                                           |
> +------------------------------------------------------------------------------------------+
> | GRANT ALL PRIVILEGES ON *.* TO 'orangehrm'@'localhost'


There are 2 serious problems with this output.

First it's missing the entry which allows the account to actually connect; the GRANT USAGE line, this probably also explains your connection errors:


```
mysql> show grants for orangehrm@localhost;
+------------------------------------------------------------------------------------------------------------------+
| Grants for orangehrm@localhost                                                                                   |
+------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'orangehrm'@'localhost' IDENTIFIED BY PASSWORD '*562A694BAEFFC8B9152976FECBF91BD08F294D0C' |
| GRANT ALL PRIVILEGES ON `orangehrm`.* TO 'orangehrm'@'localhost'                                                 |
+------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
```
Second: I don't know what granted those privileges (I have a good hunch...) but you basically created a second root account which is a seriously bad idea. Basically: if this CRM system gets compromised somehow then it can gain entry to every other database, _including_ the MySQL database itself which contains all your MySQL user accounts.

I'm assuming that you told the installer to use 1 account and then provided the root account in order for it to make a normal account? Ergo this isn't your fault; I noticed that the OrangeHRM installation process has some serious problems here and there. I can't even take this software seriously anymore: during the installation I told it to use another account name for the admin user (common practice if you value security) and as a result my chosen account can't log on even though it isn't rejected. I reinstalled, this time left the admin user as-is and now things do somewhat work out.


----------



## ShelLuser (Nov 18, 2018)

Relictrix said:


> Totally not agree, very simple example, if i show my uncle who does not know much about a pc. If i show him how to install a port, i think he can do that . If I then show him the information the ports show: basically add a few lines to apache and it works. If I say to my uncle, he will surely say ofc that's just doing what's written (if there are no errors ofc). Then put 20 uncles in a classroom, and go you can all start with installing the port and making sure it runs. They will all say it does not work


Ergo: pick the right tool for the job.

FreeBSD isn't an OS which is aimed at end-users but meant to be used by system administrators. At the risk of sounding very harsh but if you don't know how to configure a new website on a webserver then it is my believe that you have no business running & administrating that webserver in the first place. For the simple reason that servers which are placed online will get attacked sooner or later. And if you are totally clueless about how to operate a webserver then you'll also be left in the dark about all the nasty stuff that's happening on your server.

There is much more to this story then merely installing a port.



Relictrix said:


> I send a mail to that person of the port already before your reaction, you know what he said?
> 1. Oh there is an error in your config hahaha, my config????
> 2. it surely is no issue with the port, here it works.


And I think he's right. See my previous comment: I spotted yet another issue with your setup.



Relictrix said:


> From that point of view a port alone is not enough, documentation should be included.


That is not a task for the port maintainer but the authors who develop & maintain the software. As I mentioned in my earlier reaction: a port is merely a reflection of the software as it is provided.

And obviously they're not providing the full documentation in hopes of users getting a support contract. Still...  `pkg info -lx orangehrm | less` can help you find the README's and other documentation.



Relictrix said:


> Nobody has a clear view on how many people give up after a few failing ports that don't work. A lot my friend move to other OSs because of this. I am 100% sure.


Which I consider a good thing. As mentioned earlier: picking the right tool for the job. FreeBSD is an awesome operating system but fact of the matter is that it isn't the best choice for everyone out there.


----------



## Relictrix (Nov 19, 2018)

Hi,

*Ok yesterday, I reverted the change of 2 files:*
/usr/local/www/orangehrm/lib/confs/Conf.php
/usr/local/www/orangehrm/symfony/config/databases.yml

After that I deleted port oranghrm, and reinstalled it again.

The database i kept how it is, it's not about password because I copy them all the time, no worries. After restarting the apache, i got a screen with the page of OracleHRM. The next button was not working, but there was a upgrade button. I pressed and he was asking DB details, suddenly he can connect. But the upgrade was failing ofc because I am already running in 4.2, he wanted to add a column that already existed. After restarting apache and mysql and even the vm, today the next button suddenly works. I did not modify any config. So now he can connect to the database and saysatabase `orangehrm_mysql` is not empty. Please use another empty database or cleanup the given database. Yes that's true because I run those sql manually.

I could drop the complete database, but I dropped the tables individual now it work. If the program can do what i am looking for I will install it again on another physical pc from scratch.

*The result after dropping the tables is this (all green , all good):*
Step 3: System Check

In order for your OrangeHRM installation to function properly, please ensure that all of the system check items listed below are green. If any are red, please take the necessary steps to fix them.
Component  Status
PHP version  OK (ver 7.1.22)
MySQL Client  OK (ver mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $)
MySQL Server  OK (ver 5.7.24-log)
Web Server  OK (ver Apache/2.4.35 (FreeBSD) PHP/7.1.22)
MySQL InnoDB Support  Default
Write Permissions for "lib/confs"  OK
Write Permissions for "lib/logs"  OK
Write Permissions for "symfony/config"  OK
Write Permissions for "symfony/apps/orangehrm/config"  OK
Write Permissions for "symfony/cache"  OK
Write Permissions for "symfony/log"  OK
Maximum Session Idle Time before Timeout  OK
Register Globals turned-off  OK
Memory allocated for PHP script  OK
Web server allows .htaccess files  OK
MySQL Event Scheduler status  Enabled
cURL status  Enabled

*After that all table are created:*
Installation completed successfuly.
Click [Next] to continue.
Database Creation  Done
Create Database Tables  Done
Fill default data into the database  Done
Create Database User  Done
Create Default User  Done
Write Configuration File  Done

So the installer installs the tables as well.

Now the application login page pops up. But when logging in with Admin, and pasword 123, i get this error:
Csrf token validation failed in OrangeHrm

I will continue later but seems to be something in Apache, i found this on internet:



> Thanks guys, whoever tried to help, I have been resolved the issue and i think it may helpful for others if have similar issue:
> In apache2 the cookie was disable over http and our site does not server https. So, we have to enable cookie over http and it works.
> So, from my understanding, if you have similar issue, look your redirect setting as well.


----------



## Relictrix (Nov 21, 2018)

Hi,

I stopped focusing on the secure cookie concept, I configured HTTPS with Apache2.4 and now everything works. If I will reinstall it on my physical pc I will post the summary again. But I doubt a bit because OrangeHRM is quiet complete, although something basic is missing namely overtime.

Best Regards,

R


----------

