0

I have a PHP-MySQL based single page application (using Angular 6), working on a local network.

We set up the etc/hosts as following:

#127.0.0.1 localhost
#::1 localhost

192.168.0.217   dev.local
::1 dev.local

#127.0.0.1  angular.local
#::1    angular.local

127.0.0.1 localhost
::1 localhost

192.168.0.217   angular.local
::1 angular.local

the angular.local is the application to open on users windows and dev.local to access the PHP script for login, adding, editing,...

The httpd-vhosts is as the following:

# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    #Require local
    Allow from 192.168.10.0
    Allow from 192.168.0.217
Require all granted
  </Directory>
</VirtualHost>


#dev.local
<VirtualHost *:80>

    ServerAdmin it@m.org
    DocumentRoot "c:/wamp64/www/dev"
    ServerName dev.local    
    ServerAlias www.dev.local

    <Directory  "c:/wamp64/www/dev/">   
        AllowOverride All
        Require ip 192.168.0
        Require ip 192.168.1    
        Require ip 192.168.10
        Require all granted     
                Allow from all
    </Directory>
</VirtualHost>


#
<VirtualHost *:80>
    ServerName angular.local
    DocumentRoot "c:/wamp64/www/angular/"
    ServerAlias angular.local
    <Directory  "c:/wamp64/www/angular/">
        #Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require ip 192.168
        Require all granted
        Allow from all
    </Directory>
</VirtualHost>

On server side, when running the application, getting about 11000+ records took 1.11 seconds:

enter image description here

On a user computer, where we allowed to him to access the application by changing his etc/hosts file to:

#127.0.0.1  host1
#::1    host1
#127.0.0.1 aff.local
#127.0.0.1 primero.test
#127.0.0.1 localhost
#::1 localhost
127.0.0.1 dev.local

192.168.0.217   angular.local
192.168.0.217 dev.local
::1 angular.local

The request to get the 11000+ records took 13.25 seconds which is a very bad timing:

enter image description here

I did everything written in this answer but still having the same problem, and on some computers it took 25 seconds.

As said in this link, I changed all the AllowOverride All to AllowOverride None.

The documentation said:

Then Apache will attempt to open /.htaccess, /www/.htaccess, and /www/htdocs/.htaccess. The solutions are similar to the previous case of Options FollowSymLinks. For highest performance use AllowOverride None everywhere in your filesystem.

But still having the same issue.

Then I checked this link and disabled xdebug but still having the same issue.

alim1990
  • 4,656
  • 12
  • 67
  • 130
  • Realize that being local will always be faster than being on the network somewhere. You want to see how much data is being transferred (like how many Mb) and see if it makes sense with your network. Ex. it is limited to 10 Mbps? Not duplex? Firewalls, routing, ... Try a simple FTP from the external computer to the server of a bunch of files about the same size, does it take 13 seconds as well? Then == network issue. No == configuration issue. – Nic3500 Nov 05 '18 at 14:04
  • @Nic3500 the file being sent is 15mb. It took 30 seconds for one of my users to see it on his computer. Sometime it took 13 seconds. So should I try it on faster network to check if we have the same behavior ? – alim1990 Nov 05 '18 at 14:56
  • Hi, do the FTP transfer test. I have seen issues like that (13 seconds - 30 seconds, inconsistent) on improperly configured networks. If you are on 10/100Mbps networks, the ports need to match for speed and duplex mode. Your local network, is it off a hub, a simple router, ...? – Nic3500 Nov 05 '18 at 21:31
  • It is a simple router. How can I do the ftp test ? And what to do if the problem is from router? – alim1990 Nov 06 '18 at 04:43
  • 1
    From command line, use the FTP client command (`ftp TARGETSERVER PORT`). Ex `ftp angular.local 80`. If the router is the issue: update the firmware, get a better one. – Nic3500 Nov 06 '18 at 17:48

0 Answers0