Installing Apache Web Serverguide how to install apache web serverIntroduction:
Installing Apache. The only reason to install Apache 2.2.11 is if you will be running web-server off your home machine, or for site testing purpose.To start with we will download all of the necessary applications which can be found at the following locations:
Apache:
Apache download pageFile to download: Win32 Binary including OpenSSL (MSI Installer): apache_2.2.11-win32-x86-openssl-0.9.8i.msi
Now Open notepad and Copy the Below Batch Code, File -> Save As... File Named: Server Layout.bat
cls
@echo off
echo.
echo.
goto HDDCLN
:HDDCLN
echo y | MD %HOMEDRIVE%\webserver
echo y | MD %HOMEDRIVE%\webserver\bin
echo y | MD %HOMEDRIVE%\webserver\bin\apache2.2.11
echo y | MD %HOMEDRIVE%\webserver\logs
echo y | MD %HOMEDRIVE%\webserver\tmp
echo y | MD %HOMEDRIVE%\webserver\apps
echo y | MD %HOMEDRIVE%\webserver\scripts
echo y | MD %HOMEDRIVE%\webserver\wwwroot
echo y | MD %HOMEDRIVE%\webserver\alias
cls
echo.
echo.
@echo Done.
Exit
Now Double Click Server Layout.bat
#!\webserver
Description: Server Directory, where all server files will be stored.
#!\webserver\bin
Description: This is where you Install Apache, PHP, Perl, MySQL.
#!\webserver\tmp
Description: There is Server Temporary Folder.
#!\webserver\logs
Description: All Server / Site Logs will go here.
#!\webserver\apps
Description: Misc Applications for the Server e.g,. PHP MyAdmin, SQLite manager.
#!\webserver\scripts
Description: This is if you want a defualt folder for script can only be ran.
#!\webserver\wwwroot
Description: This is Root Directory for sites.
#!\webserver\alias
Description: Alias (Short-Cuts) for Each web-site are here.
Installing Apache 2.2.11Go to your desktop to the previously Downloaded file and double click apache_2.2.11-win32-x86-openssl-0.9.8i.msi. This will start installation of Apache web server. Follow the instructions:
01 - Click next
02 - Select I accept terms in the licence agreement and click next.
03 - Click next
04 - In the first two fields type in localhost and in the last one info@localhost.
We will be installing Apache as a service which starts automatically when computer starts therefore we select Port 80. If you are about to use your web server just from time to time then you may choose Port 8080. This way you would need to start Apache manually everytime you are going to use it.
05 - Select Custom and click next.
06 - Because we want our server to be installed in "C:\webserver\bin\apache2.2.11" click Change button to change the path of the installation.
07 - Navigate to "C:\webserver\bin\apache2.2.11" and click OK. On the next screen click next.
08 - Now you are ready to install Apache. Click Install.
09 - Once everything is done click Finish to exit setup.
10 - You should now see a small Apache icon in the system tray.
12 - Now let´s see if Apache is running. Open your browser and if you were installing Apache as a service (Port 80)
then type in URL
http://localhost and press Enter. You should see It works! displayed on page.
If you were installing Apache using Port 8080 then you would need to first start it by going to Start > All Programs > Apache HTTP Server 2.2 > Control Apache Server and click Start. Then in your browers´s URL type
http://localhost:8080. This should open the same page in your browser.
Make sure you allow Apache access on your firewall.
Creating Apache 2.2.11 AliasGo to "C:\webserver\alias" Create File Named your Alias Cap Senitive. e.g. AliasExample.com.conf
The Following Highlighted Should be Changed to Match your site folder, Alias.
Alias /AliasExample.com/ "c:/webserver/wwwroot/Alias Examples/"
<Directory "c:/webserver/wwwroot/Alias Examples/">
#
#By Adding the SetEnv Varabile to you Can
#Enable Custom Logging by Adding the Following to httpd.conf "" Section:
#CustomLog C:/webserver/logs/AliasExample.com_access.log combined env=AliasExample.com
#Example: SetEnv Domain_Name without Forward Slash's
SetEnv AliasExample.com
#
#If Enable Allows Visiter to Browse Dirctory like "Windows Explorer"
#Set Options to either None or -Indexes or +Indexes
#Options -Indexes
#
#This Enabled / Disbaled Server Side Includes.
#Set Options to either None or -Includes or +Includes
#Options +Includes
#
#This is To Allow .CGI .PL File to Be ran.
#Set Options to either None or -ExecCGI or +ExecCGI
#Options +ExecCGI
#
#This is like a "Short-cut" if enabled or Direct Link if Turned off.
#Set Options to either None or -FollowSymLinks
#Options -FollowSymLinks
#
#Turning off multiple Options
#If you want to turn off all Options simply use:
#Options None
#
#MultiViews will take a request for foobar, and find matching files.
#For example, I could have an HTML file foobar.html and a PDF file foobar.pdf.
#MultiViews would determine which of the possible choices best matched the
#Accept header in the request, and serve the appropriate file.
#Options +Multiviews
#
#If you only want to turn off some separate each option with a space in your Options directive:
#Options -ExecCGI -FollowSymLinks +Indexes
#
#Enable / Disbale The Support for .htaccess files
#AllowOverride None
</Directory>
then type in URL
http://localhost/AliasExample.com/ and press Enter. You should see your page displayed on web Browser.
Windows .htaccess FixApply the Following Registration Entries will allow you to Double click .htaccess file to Edit.
Now Open notepad and Copy the Below "Registration Entries", File -> Save As... File Named: HTaccess.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\htaccess_auto_file]
@=""
"EditFlags"=dword:00000000
[HKEY_CLASSES_ROOT\htaccess_auto_file\shell]
[HKEY_CLASSES_ROOT\htaccess_auto_file\shell\edit]
[HKEY_CLASSES_ROOT\htaccess_auto_file\shell\edit\command]
@="C:\\Windows\\notepad.exe \"%1\""
[HKEY_CLASSES_ROOT\htaccess_auto_file\shell\open]
[HKEY_CLASSES_ROOT\htaccess_auto_file\shell\open\command]
@="C:\\Windows\\notepad.exe \"%1\""
Now Double Click HTaccess.reg, Click Yes to "Are you sure you want to add the information in HTaccess.reg to the registry."
Thats all you have completed your installation and you are now ready to start developing your web applications using Apache.
Note: if you want to use PHP, Perl and MySQL you would have to install more programsGood Luck!