Setup your own WAMP stack – Part I
Though a distinct module for wamp server is available over
the internet and one can download and install it as a package, wamp stack
components can be installed separately (manually). Here
we have shown how to install and setup wamp stack components separately
(manually).
Significance:
It is very essential for a Windows user who wants to
establish his/her own dynamic web presence. A WAMP stack will enable you to
test your own web pages on your own server on your own windows pc. Once successful, you can easily put your web
pages and server code into the actual domain server.
What is WAMP stack?
It is a stack to set up your own server on your Windows PC.
First you need Windows environment (the OS), then you need to install Apache
server, after that you need to install PHP and then setup your MYSQL database.
In short it is Windows-Apache-MySQL-PHP stack. PHP is needed for your
server-side coding.
For users of other environments like linux, they need to
setup their LAMP stack which is Linux-Apache-MySQL-PHP stack. There are other
stacks like MAMP – the Mac-Apache-MySQL-PHP stack etc.
As a Windows user we already have
windows installed in our pc. I have Windows 10 installed in my pc. Now I need to install and setup
Apache.
Before
that we need to disable IIS in our Windows PC, if it is enabled. To disable
IIS, follow the steps below:
1.
Go to Services window by typing services in search bar at the bottom left; from
there disable IIS admin service.
2.
Now open "Turn Windows features on or off" in the same way.
3.
Go to Internet Information Services
4.
Click the square next to it so that it becomes empty.
5.
Click OK and reboot the PC.
Start
with Apache:
We need to start apache as a service
in our Windows Pc. Apache can be downloaded from any of its official sites. (it
an open source software).
Before downloading and installing
Apache we need to uninstall Apache if it is previously installed anytime. The
code to uninstall Apache is >httpd-k uninstall
[Note: httpd is available in bin
folder of the root directory. If apache is installed in c:\Apache24 then the
command will be available in c:\Apache24\bin> folder.
Again, the command prompt( dos
prompt) should be opened with administrative privileges.
It is necessary to restart the apache
server each time.]
To check whether Apache is running in
our system we need to check the services running in our system. For windows 10
users we need to write services in the search box in the status bar.
v
On hitting enterß the services window will open. In this window we will get all the
services running in our system. As I have Apace 2.4 already installed in my
system the Apache service is seen to be running in my system. Below is the
figure:
So, if apache is installed in our
system, we need to uninstall it first. To do that first we need to check where
Apache was installed in our system. Mostly it is in the C:\Apache directory.
For me it is C:\Apache24 directory. And the httpd is in the C:\Apache24\bin
directory. So, we need to go to C:\Apache24\bin> and then >httpd -k
uninstall ß
If you don’t have Apache installed in
your system You can start with next step:
Step 1:
Install the Microsoft VC++
Redistributable. We can do this from http://www.apachelounge.com/download. And look for 2.4.x VC11/14/VC15/VC1 link for windows 32 bit or 64 bit
processor. In my case, my pc was Windows10 64 bits.
Be sure you installed latest 14.25.28508.3 Visual C++
Redistributable for Visual Studio 2015-2019 : vc_redist_x64 or vc_redist_x86 see Redistributable
Step 2:
Now download the zip file
httpd-2.4.x-win64-VS16.zip from http://www.apachelounge.com/download/ for Apache 2.4.
Unzip the zip file, then rename the
unzipped folder to anything suitable. I renamed it as Apache24. Put the folder
in C:\ directory. So, my Apache is now at C:\Apache24.
Step 3:
Now get the file httpd.conf located
at C:\Apache24\conf directory. It is a text file.
Open it with a suitable editor. I
used Notepad++ for ease.
Specify the ServerRoot in this file:
change it accordingly[ we have to uncomment and change these lines accordingly]
Define SRVROOT
"c:/Apache24"
ServerRoot "${SRVROOT}"
Now specify the document root as in
the following way: [We have to uncomment and change these lines accordingly]
DocumentRoot
"${SRVROOT}/htdocs"
<Directory
"${SRVROOT}/htdocs">
……………
…………..
</Directory>
Step 4:
Now, at the command prompt, go to the
bin folder of Apache24 i.e. C:\Apache24\bin>. Put there httpdß. This will will start apache services in your system.
Always remember to get the Command
Prompt with Administrative privilege.
To check whether apache properly
started in your system or not, you need to go to your internet browser and type
in the address bar: http://localhost. Press Enter. If the browser shows “It
Works”, it ensures that Apache is working successfully.
Now, again at the command prompt
window, press CTRL + Cß. this will stop Apache and command prompt will come back again.
Note: whenever there is any change in
apache system ie. httpd.conf or any allied files, you need the restart apache.
We can restart Apache with the
following command:
>httpd -k restart
httpd command path should be
accessible from the document root & remember to put command prompt in
administrative mode.
No comments:
Post a Comment