• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to configure multiple instance of Apache on the same server in CentOS 6.7

{{postValue.id}}

How to configure multiple instance of Apache on the same server in CentOS 6.7

Apache is the mostly widely used web server developed and maintained by open community of developers under Apache Software Foundation. In this tutorial we are going to configure multiple instances of Apache webserver on the same server in CentOS 6.7.

Installation procedure

To start the installation process, first install the apache, mod_ssl and mod_nss package in the target system.

[root@linuxhelp Desktop]# yum install httpd mod_ssl mod_nss -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
epel/metalink                                                                             | 4.6 kB     00:00    
 * base: mirror.fibergrid.in
 * epel: mirror01.idc.hinet.net
 * extras: mirror.fibergrid.in
.
.
.
Updated:
  httpd.x86_64 0:2.2.15-59.el6.centos                                                                              
Dependency Updated:
  httpd-tools.x86_64 0:2.2.15-59.el6.centos                                                                        
Complete!

The packages has been successfully installed. Now duplicate the Http Configuration File and conf.d location.

[root@localhost Desktop]# cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd2.conf
[root@localhost Desktop]# cp -pr /etc/httpd/conf.d/ /etc/httpd/conf.d2/

Open the configuration file for Apache second instance and run the following command.

[root@localhost Desktop]# vim /etc/httpd/conf/httpd2.conf

The configuration file opens, change the settings as shown below. Save and exit from the file.

Listen 8095
PidFile run/httpd.pid2
Include conf.d2/*.conf

The configuration file is saved successfully. Now change the SSL Listening port of Apache second instance.

[root@localhost Desktop]# vim /etc/httpd/conf.d2/ssl.conf

Next change the NSS Listening port of Apache second instance.

[root@localhost Desktop]# vim /etc/httpd/conf.d2/nss.conf

The configuration settings for Apache second instance is done successfully. Flush and save the iptables.

[root@localhost Desktop]# iptables &ndash F
[root@localhost Desktop]# service iptables save

Start the Apache second instance by running the following command.

[root@localhost Desktop]# /usr/sbin/httpd -f /etc/httpd/conf/httpd2.conf -k start
httpd: Could not reliably determine the server' s fully qualified domain name, using localhost.localdomain for ServerName

The second instance is started successfully. Now start the Apache first instance by running the following command.

[root@localhost Desktop]# service httpd start
Starting httpd: httpd: Could not reliably determine the server' s fully qualified domain name, using localhost.localdomain for ServerName                  [  OK  ]

The two instances of Apache is running successfully. Next create index.html file in document root directory of apache.

[root@localhost Desktop]# vim /var/www/html/index.html

index

Run the following command to confirm that both httpd processes are running using the following command.

[root@localhost Desktop]# ps -aux | grep httpd
Warning: bad syntax, perhaps a bogus ' -' ? See /usr/share/doc/procps-3.2.8/FAQ
root      27588  0.0  0.1  41696  2988 pts/0    S    15:11   0:00 /usr/libexec/nss_pcache 65538 off /etc/httpd/alias
root      27590  0.0  2.8 466128 54444 ?        Ssl  15:11   0:00 /usr/sbin/httpd -f /etc/httpd/conf/httpd2.conf -k start
apache    27592  0.0  0.3 466040  7360 ?        S    15:11   0:00 /usr/sbin/httpd -f /etc/httpd/conf/httpd2.conf -k start
apache    27593  0.0  0.6 478084 12484 ?        S    15:11   0:00 /usr/sbin/httpd -f /etc/httpd/conf/httpd2.conf &ndash k
.
.
.

Open the Browser and check the multiple instance of apache working status by opening two different tabs.

first instance

second instance

Wasn' t that an easy configuration procedure? Apache supports a variety of features that extend the core functionality.

Tags:
brayden
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How to include PID file for the second apache?

A

You can include pid file and conf location for the second instance in main configuration as "PidFile run/httpd.pid2
Include conf.d2/*.conf"

Q

Is Apache Web server?

A

Apache is a free and open-source cross-platform web server, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation.

Q

What do you mean by Apache server?

A

Apache Web Server is an open-source web server creation, deployment, and management software. Initially developed by a group of software programmers, it is now maintained by the Apache Software Foundation.

Q

How does an Apache server work with PHP?

A

Apache decides that is is a PHP file, it gives it to the PHP interpreter. When PHP receives the file it reads through it and executes any PHP code it can find. ... When Apache gets the output back from PHP, it sends that output back to a browser which renders it to the screen.

Q

What is the use of Apache Web server?

A

Apache is the most widely used web server software. Developed and maintained by Apache Software Foundation, Apache is an open source software available for free. It runs on 67% of all web servers in the world.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help legeek ?
Installation of the call center module

hello

I wish to install a call center in virtual with issabel, I downloaded the latest version of it , but I don' t arrive to install the call center module in issabel. please help me

thanks!

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.