0

I have setup a local webserver to develop my php apps, everything should be working ok (no problem testing the domain through a proxy website), but when I navigate from local, sometimes the request won't finish loading (it keeps loading for a while but never throws a 500 error or something like busy server, it eventually finish loading).

Apache is configured to listen to my private IP and the port (both 80 and 443) is open in the router (pointing to my IP too). The domain is pointing to my public IP (that is dynamic but it doesn't change too often).

# httpd.conf
Listen 192.168.1.10:80
ServerName *public ip*

# httpd-ssl.conf
Listen 192.168.1.10:443

I have a default vhost (the first one) for port 80 (in it's httpd-vhosts.conf file) and another one for port 443 (in it's httpd-ssl.conf file) with it's own ssl (auto-signed) certificate. The rest of the vhosts are in the vhosts folder, using the wildcard *:80 and *:443 because I couldn't make them work with their domain/subdomain names (I already read about name based vhosts but nothing). They are properly configured and working ok, though.

I don't think it's a php-fpm problem because I tried a subdomain that doesn't use the php handler at all (in fact, it's set to use the default handler for all files in its vhost block). The php-fpm configuration for apache is set on each vhost block as needed, I don't have a single file for it. Is this ok? (And a quick question about php and fpm, does php have its own log file when using fpm? Or is everything logged into the php-fpm log file? I set the error_log in php.ini but nothing is logged, not even the file is created)

I have set the loglevel to debug, but I really don't know where the problem could be (it even may be a nat problem): http://pastebin.com/cTjyxwYf

I see gaps of 2 minutes, that's when I click and it keeps loading, maybe it's a nat/router problem. Any way to fix this?

4
  • This normally means you development system is being overloaded when your running it whats you CPU and Memory Consumption like? on nix use htop on windows open the task manager – Martin Barker Jan 4 '17 at 13:50
  • The cpu doesn't even hit 40% usage (there are peaks of 20-35%) and the memory is good, 2.7GiB of 7.7GiB. – Chazy Chaz Jan 4 '17 at 13:59
  • when you test locally and still delays, do you access the ip directly or use a hostname? To discard some name resolution related issue. Does it happen with static content? (another check to discard httpd if name resolution is fine or you access through ip). – ezra-s Jan 4 '17 at 17:18
  • I use the domain name, the IP shows the default/first vhost folder and it contains an html file (saying test server). The private IP never dealys, the public one does along the domain name (either the domain or a subdomain). I tried adding in the hosts file mydomain.com -> 127.0.0.1/192.168.1.10 but still delays. If you mean the static subdomain (where images, stylesheets, javascripts and static stuff is) yes it also delays (that's the subdomain that doesn't have the php handler enabled). Although, the delays do occur while navigating (clicking links) it happens more if I click F5 and ctrl+F5. – Chazy Chaz Jan 4 '17 at 18:20
0

I came up with a solution after getting wrong the hosts file format, instead of domain -> IP it's the other way around:

192.168.1.10    mydomain.com www.mydomain.com sub1.mydomain.com #etc...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.