How to install an apache server for windows 7?

When looking for hosting websites or services from a Windows server, there are several options to think about. It’s worth reviewing the strengths and weaknesses of every server type to work out which one is presumed to satisfy your particular needs before you spend the time installing and configuring an internet service.

Some of the foremost familiar web servers available for Windows services are Tomcat, Microsoft IIS (Internet Information Services), and in fact, the Apache server. Many server owners will prefer to use an impact panel that manages the most common tasks usually needed to administer an internet server like e-mail and firewall configuration.

 

Let’s understand what’s a web search.

A web server is a software that listens for requests and returns data (usually a file). Once you type “www.mysite.com”, the request is forwarded to a machine running web server software that returns a file to your browser — like the contents of index.html. The browser might then make further requests supporting HTML content — like CSS, JavaScript, and graphic files.

Since the online Server sits between your browser and, therefore, the requested file, it can perform processing that’s impossible by opening an HTML file directly. For instance, it can parse PHP code that connects to the database and returns data.

Why Apache?

In general, it’s good to use the online server software that your web host uses. Unless you’re creating ASP.NET on Microsoft IIS, the host will probably use Apache — the foremost widespread and fully-featured and widespread web server available. It is an open-source project, so it doesn’t cost anything to download or install.

 

The following instructions describe the way to install Apache on Windows Server. 

macOS comes with Apache and PHP. Most Linux users will have Apache available or pre-installed within the base repositories.

The Apache Installation Wizard

An excellent official .msi installation wizard is out there from the Apache download page. This feature is undoubtedly recommended for novice users or perhaps those installing Apache for the primary time.

Manual Installation

The manual installation offers several benefits:

Backing up, reinstalling, or moving the online Server are often achieved in secs.

You have, moreover, control how and when Apache starts.

You can install the Apache anywhere, like a transportable USB drive (useful for client demonstrations).

Step 1: Configure IIS

Apache listens for the requests on TCP/IP port 80. you would like to uninstall or disable any program that uses that port. If you’ve got a knowledgeable or Server version of Windows, you’ll have already got IIS installed. If you’d prefer Apache, either remove IIS as a Windows component or disable its services.

Step 2: Download the files

We’re getting to use the unofficial Windows binary from Apache Lounge. It has performance and stability improvements over the official Apache distribution. However, it’s provided as a manual zip file from Apache Lounge official site apachelounge.com/download/

One should also download and install the Windows C++ runtime from the Microsoft website. You’ll have this installed already, but there’s no harm installing it again.

Always remember to scan for virus all the downloads.

Step 3: Extract the Downloaded Files

We will install Apache in C:/Apache24, so extract the ZIP file to the basis of the C:/ drive. Apache is often installed anywhere on your system, but you’ll get to change the SVROOT configuration to point to your unzipped location — like E:/Apache24.

Step 4: Configure Apache

Apache is configured with the document conf/httpd.conf contained within the Apache folder. Open it together with your favourite text editor.

Note that each file path setting uses a forward slash (/) instead of the Windows backslash. If you installed Apache anywhere aside from C:/Apache24, now’s an honest time to look and replace all references to C:/Apache24.

There are several lines you ought to change for your production environment:

Line 60, hear all requests on port no. 80:

Listen *:80
Line 162, enable mod-rewrite by removing the # (optional, but useful):

LoadModule rewrite_module modules/mod_rewrite.so
Line 227, specify the server domain name:

ServerName localhost:80
Line 224, allow .htaccess overrides:

AllowOverride All

Or

You now got to edit Apache’s httpd.conf file. Within the file, explorer navigates to C:\Apache24\conf\httpd.conf. Open it in Notepad. At the top of this file (or wherever you wish if you would like to be more organised), add these lines:

 LoadModule php5_module 

“C:/PHP/php5apache2_4.dll”

 AddHandler application/x-httpd-PHP .php

 PHPIniDir C:/PHP

The version of the module file matters (2_4 during this case). It MUST match the Apache version installed.

In the same file. Look for the road starting DirectoryIndex. Change it as follows.

 DirectoryIndex index.php index.html

Now, navigate to C:\PHP, and replica php.ini-development to php.ini. Edit this file, find the subsequent lines and modify them as follows (all should exist already):

 memory_limit = 256M   

 post_max_size = 128M

 upload_max_filesize = 128M

One needs to specify the extensions required for Moodle. Find the ‘Dynamic Extensions’ section and alter the subsequent lines (uncomment and add the right path)

 extension=c:/php/ext/php_curl.dll

extension=c:/php/ext/php_mysqli.dll

 extension=c:/php/ext/php_gd2.dll

 extension=c:/php/ext/php_intl.dll

 extension=c:/php/ext/php_mbstring.dll

 extension=c:/php/ext/php_soap.dll

 extension=c:/php/ext/php_openssl.dll

 extension=c:/php/ext/php_xmlrpc.dll

(these are the minimum. you’ll need others – e.g. LDAP – for specific functions) …and save.

Back within the ‘cmd’ window for Apache, you would like to restart it to load your changes.

Step 5: Change the online Page Root (optional)

Default, Apache returns the files found in its C:/Apache24/htdocs folder. It’s good to use a folder on another drive or partition to form backups and re-installation easier. For the needs of this instance, we’ll create a folder called D: WebPages and alter httpd.conf accordingly:

Line 251, set the root:

DocumentRoot “D:/WebPages”

Line 252:

Step 6: Test your Installation

Your Apache configuration can now be tested. Open a command box (Start >> Run >> cmd) and enter:

# navigate to Apache bin directory

cd /Apache24/bin

# Test httpd.conf validity

httpd -t

It should say “Syntax OK”. If not, correct any httpd.conf configuration errors and retest until none appear.

Step 7: Install Apache as a Windows service.

The easiest way to start Apache is to feature it as a Windows service. Open a replacement prompt as administrator, and enter the following:

cd /Apache24/bin

httpd -k install

Open the instrument panel, Administrative Tools, then Services and double-click Apache2.4. Set the Startup type to “Automatic” to make sure Apache starts whenever you boot your PC.

Alternatively, set the Startup type “Manual” and launch Apache whenever you select the “net start Apache2.4″ command”.

 Or 

Install the Apache webserver on your PC.

 Attend http://www.apachelounge.com/download/. Scroll down until you discover the download for the ‘Apache 2.4 win32 binaries’ and download. You would like to take care that the module dll in PHP matches the version of Apache you put in. Apache won’t load otherwise.

Unzip the file into C:\. You ought to find yourself with a directory ‘Apache24’ (or regardless of the latest version is).

Find Start > All programs > Accessories > prompt …… BUT, right-click, and choose ‘Run as administrator.

Enter the subsequent cmd

 cd \Apache24\bin

 httpd -k install

 httpd -k start

…you may get a warning about the Server’s name. Please don’t be concerned about it. Please don’t close this window; you’ll need it again in a minute.

Step 7: Test the online Server

By Creating a file named index.html in Apache’s website root (either htdocs or D:\WebPages) and add a touch HTML code:

<html>

 <head>

 <title>Testing Apache</title>

 </head>

 <body>

 Apache is working!

 </body>

</html>

Ensure Apache has started successfully, open an internet browser and enter the web address “http://localhost/”. 

In general, most problems are going to be caused by an incorrect setting within the httpd.conf configuration file. Ask the Apache documentation if you need further information.

On specific systems, Apache might throw a ‘Requested Operation Failed’ message. This is often generally due to a conflict with another program that’s using an equivalent server port. Though it’s going to sound really techie and intimidating, the answer to the Requested Operation Failed! Apache error is simple; click that link to resolve your problem. Following are solutions to another problem you would possibly face.

Leave a Comment

Your email address will not be published. Required fields are marked *