Apache server php mysql windows 7


















Now we need to configure Apache. This will make sure that the Apache listens only to requests from localhost and will ignore the external addresses. DocumentRoot and Directory directive Next, we need to set the root server folder in httpd.

Find the following directives:. If you prefer to have it somewhere else, change the path. This change is needed for WordPress due to. In the above code, the index. Now we need to add a PHP module. Go to the end of the LoadModule list and add the following two lines at the end:. Without the ServerName directive, the Apache server might give you the following warning:.

And we are done with modification of Apache configuration file. Save the httpd. All that is left to do is to start the Apache server. A window with a command prompt should open and remain open. Now, let's test if the Apache server is really running.

The browser should now show you the content of the folder that was set in DocumentRoot and Directory directives when we modified the httpd.

Open text editor, create a test. You should see the white page with the " hello world " message. A better way is to run it as a service.

First, close the Command Prompt window running httpd. Next, we need to run a command prompt as an administrator. There are many ways to do this, one quick way is to type " cmd " in the Windows Search:. Command Prompt should show up as the best match. On the right side, click on " Run as administrator ". User Account Control Window should show up asking you to confirm this. After clicking " Yes ", the command prompt window should show up.

Inside the command prompt, first type the line shown below, so that we will be inside the Apache bin folder:. The easiest way to control the Apache Service is by running ApacheMonitor. After running this utility, you should see that the notification icon on the taskbar has been added for the ApacheMonitor utility.

If you click on it, you can start the Apache service by going to Apache2. You can also Stop and Restart the Apache service the same way. After selecting Apache2. So far we have a Web server that is able to process PHP files. Go to MySQL download page. There should be two installers available for downloads. One is a much smaller web online installer which is handy if you have a slow internet connection as it will download only stuff you need.

The other one is an offline installer with all the features and due to that is a much larger file. These are instructions for installing on Windows 7 desktop they may also be useful for a server install with some thought to security using individual components rather than a one click installer. Proper server configuration and security is not considered.

NOTE : This assumes that you are comfortable with administering a Windows system and can use the command line. I never use Windows and I managed, but this may not be the quickest or most efficient way to do things.

Make sure your Windows installation is in good shape, you clear out all the junk and stuff making it run slower because installing all this server software certainly isn't going to make it run faster! From that website, we can download either the Bit version win32 or the Bit one Win64 - if your OS is Bit you should always try to install Bit versions of software, but note that you'll need to use Bit modules as well, that means if you only have a Bit module then download the Bit Apache.

Here's the version that I used when writing this : Apache 2. The latest version when this answer was last updated: Apache 2. Once downloaded, just extract the Apache24 folder to the root of your hard drive, so that you have a path like C:Apache24bin.

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 by default; uncheck 'Use port 80 and 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.

A warning like Could not reliably determine the server's fully qualified domain name can be ignored for now. If you got a warning about not being able to determine the system's fully qualified domain name, fix it by editing C:Apache24confhttpd. Finally, 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 :.

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.

Open Apache's configuration file C:Apache24confhttpd. At the end if it, there should be a line Require all granted , this means that anyone can access this server.

Let's make that Require local which only allows access from the local machine. Also, 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. For this, locate the Listen directive by default it's set to 80 and change it to the following :. 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.

Collectives on Stack Overflow. Learn more. Asked 11 years, 6 months ago. Active 11 years, 6 months ago. Viewed times. Improve this question. Anthony Keane Anthony Keane 2 2 gold badges 11 11 silver badges 17 17 bronze badges. Add a comment. Active Oldest Votes. This happens to me almost all the time I set up a new PC



0コメント

  • 1000 / 1000