Showing posts with label Apache2. Show all posts
Showing posts with label Apache2. Show all posts

Friday, April 19, 2013

Apache 2.* VirtualHost Suddenly Stop working for no Reasons

It cost me two hours looking for the solution , and at last I found it :

The Apache virtual hosts were working great then suddenly I cannot reach those virtual hosts , only the local host is working, It seems to be difficult to find the problem when you are very sure that your files are OK and you didn't touch any of them or change their contents. then who did that ? who did change the configuration files content. 
To virtual hosts for Apache on windows you need three files : httpd.conf, httpd-vhosts.conf  those located in the server folder and host file which is part of the windows system and located at the folder
/windows/system32/drivers/etc/host.
Some Applications can reach your host and change its content, even changing its security status like Microsoft updates.

This is what happened , the host file security  was changed to be secured , So Apache cannot reach again unless you remove the security flag or Run Apache As Administrator.



Tuesday, January 22, 2013

Apache 2.* only serve the first virtual host - Windows 7 + WAMP

This is a problem that cost me 3 days googling and searching every where without any hints or clues to the way that I should take to solve this problem.
But It was very easy if you try to stop thinking that google can solve all of yourproblems , just relax and try to solve it by yourself.
That's what I did , the server was running great for more than 6 months now, and suddenly I cannot reach my virtual hosts.
My  $1 million dollar advice to any one face such a problem or any other one is "First Check Log files".
What I had there is 


[error] (OS 11001)No such host is known.  : Could not resolve host name

And that means the system don't know how to reach the name domain that you write in the address bar. So the Problem was in Domain Resolution. that lead to host file.

When I checked the host file I cannot find any problem. All virtual hosts had their right IP addresses "127.0.0.1".
But Apache Said he cannot reach this file , means  there are security rules prevent apache from opening this file. 
Yes, It is a secured file by windows and to allow any application to use this file you have to give the application the right permissions. So Apache on windows to be able to read host file and run virtual host must be "Run As Administrator". That is it .

Long Road for Dummies like me , but a very good tutorial to know that I can solve things my self.