Difference between revisions of "Apache (Retired)"

From 24PinTech Wiki
Jump to navigation Jump to search
Line 2: Line 2:


<pre>
<pre>
todo: finish dependencies and prerequisites, then Apache Installation + PHP Installation + MySQL Installation + Verifying Functionality + Celebration
todo: finish MySQL Installation, Verifying Functionality, and Conclusion
</pre>
</pre>


Line 14: Line 14:


== Dependencies and Prerequisites ==
== Dependencies and Prerequisites ==
<div id="notice"><strong>DO NOT CONTINUE UNTIL YOU HAVE COMPLETED EVERYTHING IN THIS SECTION</strong></div>
<div id="notice"><strong>&mdash; DO NOT CONTINUE UNTIL YOU HAVE COMPLETED EVERYTHING IN THIS SECTION &mdash;</strong></div>
 


Before you begin, you're obviously going to need to download Apache. You can find this [https://httpd.apache.org/download.cgi here], or at the bottom of this section. Once you have it downloaded, unzip the folder called <span class="cde">Apache24</span> and paste it into the C:\ drive (or whatever drive your primary partition is on.) Repeat the same process with PHP, except create a folder on the C:\ drive called <span class="cde">PHP</span> and extract the .zip file's contents into there.
Before you begin, you're obviously going to need to download Apache. You can find this [https://httpd.apache.org/download.cgi here], or at the bottom of this section. Once you have it downloaded, unzip the folder called <span class="cde">Apache24</span> and paste it into the C:\ drive (or whatever drive your primary partition is on.) Repeat the same process with PHP, except create a folder on the C:\ drive called <span class="cde">PHP</span> and extract the .zip file's contents into there.
Line 96: Line 95:
</pre>
</pre>


Save the file, and then navigate back to <span class="cde">http://localhost/</span>. You should now see a page that displays info and statistics about the current PHP version you have installed.
Save the file, and then navigate back to <span class="cde">http://localhost/</span>. A page that contains information about your PHP install should display. You've successfully installed (and enabled) PHP! 👏
 
== Installing MySQL ==

Revision as of 02:00, 1 March 2018

THIS PAGE IS A WORK IN PROGRESS
todo: finish MySQL Installation, Verifying Functionality, and Conclusion

Introduction and Summary

Apache is one of the most common, versatile, and supported web servers of all time due to its easy installation and high functionality. This article is meant to guide you through the process of installing and configuring a fresh new install of Apache and the libraries it works well with (PHP and MySQL) on a Windows environment.

Selecting the Proper Environment

Another great thing about Apache is that it runs well on most (if not all) operating systems and provides the same functionality. Before you get started, you want to select which OS you are going to run the web server on. You as the server administrator (or poor soul assigned this agonizing task) should note the features you need and what OS they work best on. If you need a utility that runs better on a Linux server distro than on Windows Server, you might want to select a Linux distro that works well for you (vice versa Windows server.)

If you only need an Apache server running, the general consensus is that it will run the same regardless of OS on most modern hardware, but some disagree. (serverfault discussion about LAMP vs WAMP stacks)

Dependencies and Prerequisites

— DO NOT CONTINUE UNTIL YOU HAVE COMPLETED EVERYTHING IN THIS SECTION —

Before you begin, you're obviously going to need to download Apache. You can find this here, or at the bottom of this section. Once you have it downloaded, unzip the folder called Apache24 and paste it into the C:\ drive (or whatever drive your primary partition is on.) Repeat the same process with PHP, except create a folder on the C:\ drive called PHP and extract the .zip file's contents into there.

For MySQL, download the

All of the download links can be found here:

Apache Installation

Open a new command prompt window as administrator and navigate to the bin folder in the Apache directory you unzipped by running

cd C:/Apache24/bin

and then run the command:

httpd -k install

You should now see "The 'Apache2.4' service is successfully installed." on the 2nd line of the output. After this, start Apache by running the command in the same directory:

httpd -k start

Note: For future reference, in order to manage the Apache service, you can either run the httpd -k command with the options start, restart, or stop. Alternatively, you can manage the service by opening services.msc, finding the Apache2.4 service, and then right clicking on it to manage it there.

Go to your browser and visit http://localhost/ and you should see a page load. You've successfully installed Apache! 👏

httpd.conf

httpd.conf is the main configuration file Apache uses and references it whenever any HTTP request is sent to the website, which is why it's so important you have everything configured properly. First and foremost, if you want your website to be accessible via LAN you're going to need to access this file and tell it to listen on the server's IP. To start, open a new command prompt window and run ipconfig and find where it says "IPv4 Address . . . ." in the output (it'll say "IPv6 Address" if you're a communist) and copy the IP.

Open your favorite text editor as an administrator (it matters that you run as administrator) and then open the file C:/Apache24/bin/httpd.conf, and then add the following code at the bottom of the file (location doesn't matter, bottom is just the easiest):

Listen [IP]:80

Just replace [IP] with the IP you copied and save the file, and then restart Apache (httpd -k restart or services.msc in case you forgot.)

VCURNTIME140.dll


"The program can't start because VCRUNTIME140.dll is missing from your computer. Try reinstalling the program to fix this issue."

Go here and scroll below the "DLL-files.com Client Demo" button where it says "VCRUNTIME140.DLL, 7 AVAILABLE VERSIONS" and download both the 64-bit and 32-bit file if you have a 64-bit OS, and only the 32-bit file if you have a 32-bit OS.

This will get a little confusing, but this is where to put the file(s):

64-bit OS

64-bit FileC:/Windows/System32

32-bit FileC:/Windows/SysWOW64

32-bit OS

32-bit FileC:/Windows/System32

PHP Installation

After following the instructions for installing PHP as instructed in the Dependencies and Prerequisites section, open a text editor as administrator and open the file C:/Apache24/bin/httpd.conf. Next, at the bottom, add the following lines:

LoadModule php7_module "C:/PHP/php7apache2_4"
AddHandler application/x-httpd-php .php
PHPIniDir C:/PHP

Save the configuration file and restart Apache. Next, find the following code in httpd.conf:

<IfModule dir_module>
     DirectoryIndex index.html
</IfModule>

Once you've found it, replace it with:

<IfModule dir_module>
     DirectoryIndex index.php index.html
</IfModule>

Save your file and restart Apache (httpd -k restart or services.msc in case you forgot.) Once you've restarted that, navigate to C:/Apache24/htdocs, create a new file called index.php, and edit it to have only the following code (reminder to edit it with a text editor that has been ran as administrator):

<?php
     phpinfo();
?>

Save the file, and then navigate back to http://localhost/. A page that contains information about your PHP install should display. You've successfully installed (and enabled) PHP! 👏

Installing MySQL