I suggest you read the official PHP documentation about installing it on Windows systems.ĭownload the latest PHP binaries from the official PHP for Windows download page, choose the thread-safe version that matches your Apache installation's bit-version (x86 for 32-Bit, 圆4 for 64-Bit). Save the file, if you're already running the server then restart it in order to take our changes into account, and now only localhost has access, everyone else will get a 403 Forbidden. The first line is self explanatory, the second one is the first one's IPv6 equivalent, the brackets are used in the IPv6 notation to separate the address and the port. Let's make that Require local which only allows access from the local machine.Īlso, you can tell Apache to only bind to the loopback interface, that way even if both your firewall and the access control directives mentioned above fail, the server still won't be open to the whole internet.įor this, locate the Listen directive (by default it's set to 80) and change it to the following : Listen 127.0.0.1:80 Īt the end if it, there should be a line Require all granted, this means that anyone can access this server. Open Apache's configuration file C:\Apache24\conf\nf, search for the default directory block. If you're setting this up for development purposes you want to make sure that no one except you can access it, your firewall should already take care of that but let's add another layer of security to it by telling Apache to accept requests from the local machine only. Restricting Apache access to localhost only - optional That's it, now you have a new service in Services (Windows+R then type "services.msc" then press Enter) named "Apache2.4" that you can control just like any other Windows service. Replace with either the system's host name or localhost.įinally, if you want to run the server automatically when the system starts (even if nobody logs in), you'll need to run it as a service - in a new elevated (as an administrator) command prompt, type : httpd.exe -k install If you got a warning about not being able to determine the system's fully qualified domain name, fix it by editing C:\Apache24\conf\nf and editing the ServerName variable (it should be already there in a comment, just uncomment it and change it) : ServerName You can now stop the currently running Apache by pressing Ctrl+C in the command prompt. Then, open a browser and browse to if you see a page saying It works ! then it means your Apache installation is working. Windows Firewall may prompt you to allow Apache to communicate on specific networks, I recommend you use the default settings : allow it on home and work networks, but not on public/untrusted networks. If you get an error saying that it can't bind to port 80, check if another application uses that port - also Skype is known to use ports 80 and 443 by default uncheck "Use port 80 and 443 as alternatives for incoming connections" in its advanced connection settings, restart Skype to apply the changes, and then you should be able to start Apache without issues.Ī warning like Could not reliably determine the server's fully qualified domain name can be ignored for now. If you get an error dialog stating that MSVCR110.dll is missing on your system, you'll need to install the Visual C++ Redistributable for Visual Studio 2012 - as always, when prompted, select the appropriate bit-version : vcredist_x86.exe for 32-Bit systems and vcredist_圆4.exe for 64-Bit ones. Open a command line window (Windows+R and type cmd then press Enter), change directory into C:\Apache24\bin and run httpd.exe, normally it shouldn't print any errors. Once downloaded, just extract the Apache24 folder to the root of your hard drive, so that you have a path like C:\Apache24\bin. The latest version when this answer was last updated: Apache 2.4.38 Win64 (look at the edit date at the bottom of the post). Here's the version that I used when writing this : Apache 2.4.10 Win64. First, I recommend you read the Platform Specific Notes of Apache for Windows - it explains some Windows-specific features like running as a service that you don't have on other OSes and you probably have never used before.Īs mentioned in these platform specific notes, Apache doesn't provide binaries for Windows, however they have links to several third-party sites that provide binaries, for example Apache Lounge.įrom that website, we can download either the 32-Bit version (win32) or the 64-Bit one (Win64) - if your OS is 64-Bit you should always try to install 64-Bit versions of software, but note that you'll need to use 64-Bit modules as well, that means if you only have a 32-Bit module then download the 32-Bit Apache.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |