Apache and Tomcat Under windows

Apache and Tomcat are the web servers from Apache foundations.In this small document shows how to install and configure a web server .

Apache Installation and configurations
______________________________________
1) Create a folder and download msi file from apache download site

2) When started, the Apache HTTP server installation wizard displays a welcome message. Click on the Next button to continue. Next, the Apache license is shown. Read it carefully and if you accept the license, select the “I accept the terms in the license agreement” option and press the Next button.

3) Next enter the server information

4) The next step allows you to select the install type of the Apache web server. The default (Typical program features)press Next.

5) Next, you can select the destination folder of the installation.Default setting: C:\Program Files\Apache Group\

6) When a Windows Security Alert window appears asking if you want to keep blocking this (Apache HTTP server) program.Select “Unblock” .

7) Click the Finished button to close the HTTP server installation wizard.

Note:-Installation time it ask to run the Apache HTTP server as a service. Select as a service ,because you don’t need to start it manually.

Under Apache Folders

Bin Folder :-The bin folder contains amongst other files the server executable: Apache.exe and a program to control the Apache HTTP server when ran as service: ApacheMonitor.exe. Also contained in this folder are htpasswd.exe and htdigest.exe for making parts of your site(s) restricted.

CGI-Bin Folder :-The cgi-bin folder has one CGI program written in Perl, printenv.pl, which you can use to test if your Perl installation is working in combination with the Apache HTTP server. If you get a “500 Internal Server Error” when you enter http://localhost/cgi-bin/printenv.pl in the address bar of your browser, you either have Perl not installed, or the configuration of the web server is not right. You might want to check the error.log file in the logs folder in the latter case.

Conf Folder :-configuration files used by the Apache web server. There is a copy for each files.default in its name, e.g. httpd.default.conf. The main configuration file is httpd.conf.

Htdocs :-Contains the default HTML pages .You can create folders under here.

Logs :-Contains access.log and error.log files.

Virtual hosts
_____________
Creating more web sites using a single IP.

For that we need to edit the httpd configuration file to server virtual hosts.

Add/Edit the following line in httpd.conf file in the C:\Program Files\Apache Group\Apache2\conf folder to include the virtual-hosts.conf file .

Include conf/virtual-hosts.conf

After Include directive to Apache’s httpd.conf need to add virtual hosts to the virtual-hosts.conf.

Either the file virtual-hosts.conf under conf folder or else add the entry in httpd.conf

# Use name-based virtual hosting.
NameVirtualHost *:80

<VirtualHost *:80>

ServerName example.com
DocumentRoot “C:\Program Files\Apache Group\Apache2\webroot”

CustomLog logs  example.com.access.log combined
ErrorLog logs   example.com.error.log

</VirtualHost>

Installation of Tomcat
_______________________
First install java jdk1.5.0_11 to the location (c:\programfiles\java\ jdk1.5.0_11& c:\programfiles\java\ jre1.5.0_11)
Install tomcat to the location (c:\programfiles\apacheswfoundations\tomcat5.5)
Start the service from taskbar icon (it will change to green button) or from program files\apache

Files will be created bin, common, conf, logs, server, shared, temp, webapps, work.
Once the installation over and start server you can access it from local host port8080

Default it is configure only for hostmanager.xml and manager.xml

For accessing admin you have to copy admin tools extract and paste the files here
C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost\ conf/put admin.xml
C:\Program Files\Apache Software Foundation\Tomcat 5.5\server\webapps paste admin folder
After that go to manager reload admin and start. Now you are able to access this.

Creating your own site (new deploying)
______________________________________
Create folder myweb in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps
Manager reloads and starts
Access localhost: 8080/myweb

Advertisements

Posted on April 30, 2011, in General, Uncategorized, Web, Windows. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: