WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ....

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
fibrepunk
Posts: 2
Joined: Wed Jul 01, 2020 10:32 am

WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ....

Post by fibrepunk »

After auto update from last night, I got the following error. Anyone else experiencing this issue? Here is the screenshot of the error.

Screenshot:
Error msg.
Error msg.
2020-07-01_10-30-52_hostname_url.jpg (54.11 KiB) Viewed 22976 times
TIA
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by shaunw »

In your TimeTrex.ini.php file, there is a "hostname" setting under the [other] section, that does not match the hostname in the URL that you are using to access TimeTrex with, therefore TimeTrex isn't able to perform some operations properly.

For example if you access TimeTrex in your web browser with: "http://www.mycompany.com/timetrex", you should have the following in your TimeTrex.ini.php file:

Code: Select all

hostname = "www.mycompany.com" 
fibrepunk
Posts: 2
Joined: Wed Jul 01, 2020 10:32 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by fibrepunk »

Thank you, after editing the file, that fixed it. I also wonder, can the hostname accept multiple names? If so, do you have an example?
mikeb
Posts: 709
Joined: Thu Jul 27, 2006 11:58 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by mikeb »

It does not accept multiple names.
TimeTrex Community Edition is developed and supported by volunteers.
Help motivate us to continue by showing your appreciation!
rafat
Posts: 5
Joined: Mon Dec 28, 2020 10:36 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by rafat »

Out of curiosity what is the benefit of specifying the host name? I
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by shaunw »

Its required so TimeTrex knows how to generate a link back to itself properly.
rafat
Posts: 5
Joined: Mon Dec 28, 2020 10:36 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by rafat »

Fair enough .. although I dont understand this very well.
My installation has a server with two adapters one that goes to the internet as www.example.com and the one I use locally as 192.x.x.x to administer the system. So which one in your opinion I should set as the hostname in the .ini file.
Thanks.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by shaunw »

I would recommend using whichever is used most often for now. However the warning that you are seeing will still always appear for people accessing it a different way. Therefore the proper approach is have a single domain that works both externally and internally on your network.
rafat
Posts: 5
Joined: Mon Dec 28, 2020 10:36 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by rafat »

Thanks for the recommendations.
For the time being I commented the hostname directive in the .ini file and the messages do not appear in either side.
I will have to look for the single domain that can be accessed by both sides of the aisle.
Regards.
Rafat
moinqureshi
Posts: 7
Joined: Wed Jun 02, 2021 8:06 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by moinqureshi »

Hi,

I didnot found any hostname in php.ini file.

cd /etc/php/7.2/apache2/

ubuntu 18.04 LTS
Please guide, I want to remove this error.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by shaunw »

moinqureshi wrote: Wed Jun 02, 2021 8:07 am I didnot found any hostname in php.ini file.

cd /etc/php/7.2/apache2/

ubuntu 18.04 LTS
Please guide, I want to remove this error.
Its the timetrex.ini.php file that has that setting rather than the php.ini file.
moinqureshi
Posts: 7
Joined: Wed Jun 02, 2021 8:06 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by moinqureshi »

Where i find this file timetrex.ini.php ? complete folder location

LTS 18.04 , Installed via .deb file.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by shaunw »

Try: /var/www/timetrex/timetrex.ini.php
moinqureshi
Posts: 7
Joined: Wed Jun 02, 2021 8:06 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by moinqureshi »

I have timetrex folder only in /var/cache/timetrex.

I have /var/www/html instead of /var/www/timetrex.

Image attached!
Attachments
timetext.PNG
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by shaunw »

If you aren't seeing it there, try this instead:

Code: Select all

/usr/share/timetrex/html/timetrex.ini.php
moinqureshi
Posts: 7
Joined: Wed Jun 02, 2021 8:06 am

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by moinqureshi »

Thanks.

Its works!

two question:

hostname = 10.19.1.200

I set hostname to local ip, but when i iopen this IP, always Apache page is open. When I open 10.119.1.200/timetrex, then Timetrex login page is open. How i can change to my IP only? Also i want to customize logins. I want to add my company facebook on login page, Also i want to change favicon. Thanks
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: WARNING: Hostname specified in TimeTrex config file does not match the accessed URL. Please contact your TimeTrex ..

Post by shaunw »

I set hostname to local ip, but when i iopen this IP, always Apache page is open. When I open 10.119.1.200/timetrex, then Timetrex login page is open. How i can change to my IP only?
You will need to change your Apache config or use a .htaccess redirect for that, which is outside the scope of TimeTrex.
Post Reply