Jump to content
  • Advertisement
Sign in to follow this  
gamelife

Apache problem on Windows

This topic is 2088 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have recently installed Apache 2.4.7, PHP 5.5.8 and virtual hosts on Windows Vista.

Now I often experience a strange connection hangs problem:

(1) Open Chrome and Internet Explorer, both connect to one of the virtual hosts

(2) Repeatedly do some random actions and refreshes in both browsers
(3) After a while, the browsers will show "Connecting..." and hangs. When it happens, if I open a new tab and connect to another virtual host, it will also hang.
(4) The only way to solve the "Connecting..." status is to stop loading the initial page, and refresh the browser. After that, all other hanging connection to other virtual hosts can load.
 
The way I have setup virtual hosts is edit the file C:/WINDOWS/system32/drivers/etc/hosts and it looks like:

127.0.0.1       localhost
::1             localhost
127.0.0.1       dpi.vh.com
127.0.0.1       pi.vh.com
 

And I have edited the file httpd-vhosts.conf like this:

<Directory D:/wwwroot>
  Require all granted
</Directory>

<VirtualHost *:8080>
    ServerName localhost
    DocumentRoot "D:/wwwroot"
    <Directory "D:/wwwroot/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog  "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" combined
</VirtualHost>

<VirtualHost *:8080>
    ServerName dpi.vh.com
    ServerAlias dpi.vh.com
    DocumentRoot "D:/wwwroot/dpi.vh-test.com/site/"
    AddDefaultCharset UTF-8
    SetEnv KOHANA_ENV PRODUCTION
    <Directory "D:/wwwroot/dpi.vh-test.com/site/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog  "logs/dpi.vh-test.com-error.log"
    CustomLog "logs/dpi.vh-test.com-access.log" combined
</VirtualHost>

<VirtualHost *:8080>
    ServerName pi.vh.com
    ServerAlias pi.vh.com
    DocumentRoot "D:/wwwroot/pi.vh-test.com/site/"
    AddDefaultCharset UTF-8
    SetEnv KOHANA_ENV PRODUCTION
    <Directory "D:/wwwroot/pi.vh-test.com/site/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog  "logs/pi.vh-test.com-error.log"
    CustomLog "logs/pi.vh-test.com-access.log" combined
</VirtualHost>

I have .htaccess file in both directories like this:

# Turn on URL rewriting
RewriteEngine On 

# Installation directory
RewriteBase /

# Protect hidden files from being viewed
<Files .*>
    Order Deny,Allow
    Deny From All
</Files>

# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

RewriteRule gallery_(.*).xml mread/detail/$1 [PT]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]

I am sure the connection hangs problem is not due to the PHP code, since I have added a few lines at the start of index.php to write log into txt file, and when the "Connecting..." situation happens, nothing is written into the txt file.

 

When the connection from browser hangs, I have tried to ping the domain (dpi.vh.com, pi.vh.com) and telnet to the port (telnet dpi.vh.com 8080, telnet pi.vh.com 8080), and these all works.

 

Anyone knows what might be the reason?

 

(BTW, the sites are using Kohana 3.0... not sure if that's the cause)

Edited by gamelife

Share this post


Link to post
Share on other sites
Advertisement

To answer my own question, adding these lines to httpd.conf seems solve the problem.

AcceptFilter http none 
AcceptFilter https none 
EnableSendfile off 
EnableMMAP off

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!