Apache Web Server Configuration File

Posted on  by admin
Configuring Windows Apache 2.0/2.2 with Windows WebSphere
Configuring UNIX Apache 2.0/2.2 with UNIX/LINUX WebSphere
Configuring Windows Apache 1.3 with Windows WebSphere
Configuring UNIX Apache 1.3 with UNIX/LINUX WebSphere
  1. Apache Web Server Log File Configuration
  2. Apache Web Server Configuration File Linux
  3. Apache Web Server Configuration File Directive
Server

Configuring Windows Apache 2.0/2.2 with Windows WebSphere

Jul 03, 2019 On a CentOS server, the package manager used to install the Apache web server (such as rpm, yum, or dnf) will typically default to placing the main Apache configuration file in of one of the following locations on the server: /etc/apache2/httpd.conf /etc/apache2/apache2.conf. Run the PowerServer setup program and install PowerServer Web Component to the document root of the Apache HTTP Server, for example,%Apache% htdocs.

Installing PowerServer Web Component to the Apache document root

Run the PowerServer setup program and install PowerServer Web Component to the document root of the Apache HTTP Server, for example, %Apache%htdocs.

If you have installed PowerServer Web Component to another location, then you should copy the entire appeon folder from the installation directory of PowerServer Web Component to the Apache document root.

In WebSphere 5.1: Copy the mod_was_ap20_http.dll or mod_was_ap22_http.dll file from the %WAS_HOME%bin folder to the %APACHE%modules folder.

In WebSphere 6.0: Download the installation program and set up for Apache 2.0 or 2.2. For detailed information, refer to WebSphere user document.

  1. Click Environment > Virtual Host in the navigation tree of the WebSphere Administrative Console.

  2. Click the New button in the page that displays.

  3. Input the IP address of the Web server in the Host Name field and port number in the Port field.

  4. Click Environment > Update Web Server Plug-in in the console navigation tree.

  5. Click OK to update the Web server plug-in.

  6. Save the new configuration and restart WebSphere server.

Copy the plugin-cfg.xml file from the %WAS_HOME%configcells folder to the %APACHE%conf folder and modify the following directives according to the PowerServer/WebSphere environment:

Configure the log file location. For example:

Configure the IP address and port number of the PowerServerWebSphere. For example:

Configure the context path. For example:

  1. Add the following scripts to the httpd.conf file (located in the %APACHE%conf folder):

    Take was_ap20_module as an example:

  2. Specify an appropriate timeout period in the 'Timeout' script in the httpd.conf file. The default value is 300 seconds.

Under the installation directory of PowerServer Web Component (for example, C:Inetpubwwwrootappeon), there are Apache20Support and Apache22Support folders.

  1. Copy the appeoncache.conf file from the Apache20Supportconf or Apache22Supportconf folder to the %APACHE%conf folder.

    • The cachesize property is 100MB by default (and minimum). If you set the size to a value smaller than 100MB, the cache size will still be regarded as 100MB. For the Web server cache to keep enough DataWindow data, the larger the cache size, the better, but you need to make sure the cache size is no larger than the available memory on the server.

    • The cache_temp_dir property is 'C:tmp' by default. Make sure 'C:tmp' exists on your computer, or change the default value to the physical path of an existing directory.

    • The encoding formats for the cached data include UTF-8 and UTF-16LE. If you use the plug-in from the application server, DataWindow Data Cache will fail to cache data in UTF-8 and UTF-16LE at the same time, and requires you to set the encoding format. If the Appeon cluster plug-in is used, you must comment out the setting as shown in the code example below, so that DataWindow Data Cache can cache data in UTF-8 and UTF-16LE at the same time.

  2. Copy the modcache2.dll or modcache22.dll file from the Apache20Supportmodules or Apache22Supportmodules folder to the %APACHE%modules folder.

  3. Add the following script to the httpd.conf file in the %APACHE%conf folder:

    Take modcache2.dll as an example:

    The scripts load the modcache2.dll or modcache22.dll file and include the appeoncache.conf file.

Configuring UNIX Apache 2.0/2.2 with UNIX/LINUX WebSphere

Installing PowerServer Web Component to the Apache document root

Install PowerServer Web Component to the document root of the Apache HTTP Server, for example, $APACHE/htdocs/, by following the instructions in Installation Guide for Appeon PowerServer.

If you have installed PowerServer Web Component to another location, then you should copy the entire appeon folder from the installation directory of PowerServer Web Component to the Apache document root.

In WebSphere 5.1: Copy the mod_was_ap20_http.so or mod_was_ap22_http.so file from the $WAS_HOME/bin/ folder to the $APACHE/modules/ folder.

In WebSphere 6.0: Download the installation program and set up for Apache 2.0 or 2.2. For detailed information, refer to WebSphere user document.

In certain UNIX operating systems (such as Sun Solaris), the plug-in file requires libgsk7*.so to work. Download and install GSKit7.x from the IBM Website (http://www.ibm.com/).

  1. Click Environment> Virtual Host in the navigation tree of the WebSphere Administrative Console.

  2. Click the New button in the page that displays.

  3. Input the IP address of the Web server in the Host Name field and port number in the Port field.

  4. Click Environment > Update Web Server Plug-in in the console navigation tree.

  5. Click OK to update the Web server plug-in.

  6. Save the new configuration and restart WebSphere server.

Copy the plugin-cfg.xml file from the $WAS_HOME/config/cells/ folder to the $APACHE/conf/ folder and modify the following directives according to the PowerServer/WebSphere environment:

Configure the log file location. For example:

Configure the IP address and port number of the PowerServerWebSphere. For example:

Configure the context path. For example:

  1. Add the following scripts to the httpd.conf file (located in the $APACHE/conf folder):

    Take mod_was_ap20_http.so as an example:

  2. Specify an appropriate timeout period in the 'Timeout' script in the httpd.conf file. The default value is 300 seconds.

The DataWindow data cache feature is not available in UNIX and Linux.

Configuring Windows Apache 1.3 with Windows WebSphere

Apache Web Server Log File Configuration

Installing PowerServer Web Component to the Apache document root

Run the PowerServer setup program and install PowerServer Web Component to the document root of the Apache HTTP Server, for example, %Apache%htdocs.

If you have installed PowerServer Web Component to another location, then you should copy the entire appeon folder from the installation directory of PowerServer Web Component to the Apache document root.

Configuration

Copy the mod_app_server_http.dll file from the %WAS_HOME%bin to the %APACHE%modules folder.

  1. Click Environment > Virtual Host in the navigation tree of the WebSphere Administrative Console.

  2. Click the New button in the page that displays.

  3. Input the IP address of the Web server in the Host Name field and port number in the Port field.

  4. Click Environment > Update Web Server Plug-in in the console navigation tree.

  5. Click OK to update the Web server plug-in.

  6. Save the new configuration and restart WebSphere server.

Copy the plugin-cfg.xml file from the %WAS_HOME%configcells folder to the %APACHE%conf folder and modify the following directives according to the PowerServerWebSphere environment:

Configure the log file location. For example:

Configure the IP address and port number of the PowerServerWebSphere. For example:

Configure the context path. For example:

Apache tomcat web server configuration file
  1. Add the following script to the httpd.conf file (located at the %APACHE%conf folder):

  2. Specify an appropriate timeout period in the 'Timeout' script in the httpd.conf file. The default value is 300 seconds.

Under the installation directory of PowerServer Web Component (for example, C:Inetpubwwwrootappeon), there is an Apache13Support folder.

  1. Copy the appeoncache.conf file from the Apache13Supportconf folder to the %APACHE%conf folder.

    • The cachesize property is 100MB by default (and minimum). If you set the size to a value smaller than 100MB, the cache size will still be regarded as 100MB. For the Web server cache to keep enough DataWindow data, the larger the cache size, the better, but you need to make sure the cache size is no larger than the available memory on the server.

    • The cache_temp_dir property is 'C:tmp' by default. Make sure 'C:tmp' exists on your computer, or change the default value to the physical path of an existing directory.

  2. Copy the modcache.dll file from the %APACHE%htdocsappeonApache13Supportmodules folder to the %APACHE%modules folder.

  3. Add the following script to the httpd.conf file in the %APACHE%conf folder:

    The scripts load the modcache.dll file and include the appeoncache.conf file.

Apache Web Server Configuration File Linux

Configuring UNIX Apache 1.3 with UNIX/LINUX WebSphere

Installing PowerServer Web Component to the Apache document root
Nginx web server

Install PowerServer Web Component to the document root of the Apache HTTP Server, for example, $APACHE/htdocs/, by following the instructions in Installation Guide for Appeon PowerServer.

If you have installed PowerServer Web Component to another location, then you should copy the entire appeon folder from the installation directory of PowerServer Web Component to the Apache document root.

Copy the mod_app_server_http.so file from the $WAS_HOME/bin/ folder to the $APACHE/modules folder.

In certain UNIX operating systems (such as Sun Solaris), the plug-in file requires libgsk7*.so to work. Download and install GSKit7.x from the IBM Website (http://www.ibm.com/).

  1. Click Environment > Virtual Host in the navigation tree of the WebSphere Administrative Console.

  2. Click the New button in the page that displays.

  3. Input the IP address of the Web server in the Host Name field and port number in the Port field.

  4. Click Environment > Update Web Server Plug-in in the console navigation tree.

  5. Click OK to update the Web server plug-in.

  6. Save the new configuration and restart WebSphere server.

  1. Copy the plugin-cfg.xml file from the $WAS_HOME/config/cells/ folder to the $APACHE/conf/ folder and modify the following directives according to your PowerServer/WebSphere environments:

    Configure the log file location. For example:

    Configure the IP address and port number of the PowerServerWebSphere. For example:

    Configure the context path. For example:

  2. Specify an appropriate timeout period in the 'Timeout' script in the httpd.conf file. The default value is 300 seconds.

Add the following script to the httpd.conf file (located in the $APACHE/conf folder):

The DataWindow data cache feature is not available in UNIX and Linux.

PrevUp
Configuring Apache with WebLogic Home

Using Apache Virtual Host, you can run several websites on the same server.

For example, I can run both thegeekstuff.com and top5freeware.com on a single physical server that has one Apache webserver running on it.

Fig: Apache Virtual Host (Multiple websites, one Apache)


There are two types of Apache virtual host configurations: 1) IP-Based Virtual Host and 2) Name-based Virtual Host. Name-based virtual host is recommended for most scenarios.

IP-Based Virtual Host

In this configuration, when you are pointing two websites (with different ip-address) to the server that runs Apache, that physical server should have two different ip-address configured.

This means that the server should have two ethernet cards, each one of them configured to the ip-address of the corresponding website that Apache virtual host will be serving. So, this is not practical for most aspects, and you should not be using this.

In the following example, the server contains two NIC cards, one is configured with 192.168.101.1 ip-address for thegeekstuff.com, another is configured with 192.168.102.1 for top5freeware.com. Both these ip-address are served by a single Apache webserver running on that server using IP-Based virtual host.

Name-Based Virtual Host

Configuration

In this configuration, when Apache webserver receives a request, it looks for the hostname in the HTTP header, and depending on the hostname, it servers different websites. This is very easy, as you need only one ip-address on that physical server; but, you update the DNS with multiple website names pointing to the same ip-address. For all practical purpose, you’ll be using only Name-based virtual host configuration.

In the following example, the server contains only one NIC card, which is configured with 192.168.101.1 ip-address. The DNS entry for both thegeekstuff.com and top5freeware.com website points to 192.168.101.1 ip-address. When Apache recives a request, it looks for the hostname entry in the HTTP header, and serves the corresponding website.

Fig: Apache Name-Based Virtual Host

1. Uncomment httpd-vhosts.conf in httpd.conf

If you’ve installed Apache 2 from source, by default, the following line will be commented in the httpd.conf file. Uncomment this line.

2. Setup virtual hosts

Modify the httpd-vhosts.conf as shown below to setup named-based virtual host setting for two hosts.

  • NameVirtualHost *:80 – Indicates that all the name-based virtual hosts will be listening on the default port 80
  • <VirtualHost *:80> </VirtualHost> – Enclose all the apache configuration parameters for each and every virtual host between these VirtualHost tags. Any apache directives can be used within the virtualhost container.
  • In the following example, we are setting up virtual host for thegeekstuff.com and top5freeware.com listening on the same port 80. So, there will be two <VirtualHost *:80> </VirtualHost>, one for each website.
  • When you go to thegeekstuff.com, the files under /usr/local/apache2/docs/thegeekstuff will be served by Apache; and the access_log and error_log for this site will go under /usr/local/apache2/logs/thegeekstuff

3. Check VirtualHost Configuration Syntax

Verify virtual configuration syntax using “httpd -S” as shown below. When everything is setup properly, it just displays “Syntax OK”.

When something is not configured properly, it will display warning message, including “directory does not exit” message as shown below.

4. Restart the Apache and test

Now, when you go to thegeekstuff.com (or www.thegeekstuff.com), the apache will serve the files from /usr/local/apache2/docs/thegeekstuff directory.

When you go to top5freeware.com (or www.top5freeware.com), the same apache running on the same server will serve the files from /usr/local/apache2/docs/top5freeware directory.

Apache Web Server Configuration File Directive

Just to reiterate, for the name-based virtual host to work properly, the DNS entry for both these websites should be pointing to the same external ip-address of the physical server where the Apache webserver is running.