[Vtigercrm-developers] use vtiger in lan and external access

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Fri Jun 26 01:09:01 GMT 2015


I use this approach all the time. But mostly because I tunnel to my dev box and therefore must setup DNS to point to localhost

The trouble is it gets annoying when you have to keep editing the hosts file. Also it can be confusing if you forget to change the host file or you do change it and it doesn’t work.

To solve the latter I use dns flusher
www.coders.com.br/dns-flusher<http://www.coders.com.br/dns-flusher>

This is a must have plugin for firefox if you often switch from dev to prod using the host file hack Vladimir suggests

Chris

From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Vladimir Karažija
Sent: Thursday, 25 June 2015 8:03 PM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] use vtiger in lan and external access

Hi,

maybe different approach to this could be to use FQDN URL for vtiger.

Create for example vtiger.yourdomain.com<http://vtiger.yourdomain.com> and publish this URL on DNS.
Enter this URL in config.inc.php
Configure your local DNS to point to your vtiger on local IP.

If you do not have local DNS server you can add this in host file C:\Windows\System32\drivers\etc

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com<http://rhino.acme.com>          # source server
#       38.25.63.10     x.acme.com<http://x.acme.com>              # x client host

# localhost name resolution is handled within DNS itself.
#          127.0.0.1       localhost
#          ::1             localhost

192.168.1.123        vtiger.yourdomain.com<http://vtiger.yourdomain.com>



Vladimir Karažija
Kosa crta d.o.o.
Jagnedje 1
10090 Zagreb
OIB: 57724075047

t. +385 1 777 33 85
m. +385 91 122 0511
www.kosacrta.hr<http://www.kosacrta.hr>

On Thu, Jun 25, 2015 at 2:54 AM, Hamono, Chris (DPC) <Chris.Hamono at sa.gov.au<mailto:Chris.Hamono at sa.gov.au>> wrote:
I should have said this is done in config.inc.php

Chris

-----Original Message-----
From: vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com> [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com>] On Behalf Of Hamono, Chris (DPC)
Sent: Thursday, 25 June 2015 9:27 AM
To: vtigercrm-developers at lists.vtigercrm.com<mailto:vtigercrm-developers at lists.vtigercrm.com>
Subject: Re: [Vtigercrm-developers] use vtiger in lan and extarnal access

This is what I do...

if (empty($_SERVER['HTTP_HOST'])) {
    $site_URL = 'http://my.domain.name/';
}
else {
    $site_URL = 'http://' . $_SERVER['HTTP_HOST'] . '/';
}


The "if" statement is a quick way to determine if the script is called via the webbrowser you need this for some crons to work.

No need to edit the http referrer script

Chris

-----Original Message-----
From: vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com> [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com>] On Behalf Of Alan Bell
Sent: Wednesday, 24 June 2015 11:14 PM
To: vtigercrm-developers at lists.vtigercrm.com<mailto:vtigercrm-developers at lists.vtigercrm.com>
Subject: Re: [Vtigercrm-developers] use vtiger in lan and extarnal access

well the line might end up something like

if ((stripos($_SERVER['HTTP_REFERER'], $site_URL) !== 0 ) && stripos($_SERVER['HTTP_REFERER'], "http://192.168.") !== 0 && stripos($_SERVER['HTTP_REFERER'], "http://localhost") !== 0 && stripos($_SERVER['HTTP_REFERER'], "http://10.") !== 0 &&
($this->get('module') != 'Install')) {

which would let you access it via the site URL, or an internal IP address starting 192.168.*.* or 10.*.*.* or locally. Your exact requirements might be different.

Alan.

On 24/06/15 14:12, marlos22 wrote:
> so i have to replace this (stripos($_SERVER['HTTP_REFERER'],
> $site_URL) !==
> 0) whit my two URL (lan and external access) ????
>
>
>
>
>
> --
> View this message in context:
> http://vtiger-crm.2324883.n4.nabble.com/use-vtiger-in-lan-and-extarnal
> -access-tp16676p16680.html Sent from the vtigercrm-developers mailing
> list archive at Nabble.com.
> _______________________________________________
> http://www.vtiger.com/

_______________________________________________
http://www.vtiger.com/

_______________________________________________
http://www.vtiger.com/

_______________________________________________
http://www.vtiger.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150626/87cedb73/attachment.html>


More information about the vtigercrm-developers mailing list