• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

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

1367

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

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.

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

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

How To Install AnyDesk on Centos 7
How To Install AnyDesk on Centos 7
Apr 2, 2018
How to install Tiki Wiki CMS Groupware on CentOS 7
How to install Tiki Wiki CMS Groupware on CentOS 7
May 31, 2018
How to install PHP ImageMagick on CentOS 7
How to install PHP ImageMagick on CentOS 7
Nov 4, 2017
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
Jun 4, 2019
How to install Apache from Source Code on CentOS 7
How to install Apache from Source Code on CentOS 7
Oct 21, 2017
How to enable or disable repositories in CentOS
How to enable or disable repositories in CentOS
Mar 28, 2018
How to install AWStats on CentOS 7
How to install AWStats on CentOS 7
Dec 8, 2017
How to install Apache JMeter in CentOS 7
How to install Apache JMeter in CentOS 7
Mar 24, 2017

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

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

CentOS
connor class=
How To Completely Remove Apache package On CentOS 7.6
May 14, 2019
CentOS
ceriaimmaculate class=
setfacl : command not found
Jan 3, 2018
CentOS
mason class=
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
Nov 20, 2018
CentOS
landon class=
Command to find SNMP Version
May 28, 2018
CentOS
arjitharon class=
cannot start minio service help
Mar 10, 2018
Apache
isaac class=
How to disable apache welcome page on Ubuntu
Dec 15, 2018
Apache tomcat
AadrikaAnshu class=
Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program
Jun 17, 2019
gitlab
caden class=
Insufficient space in download directory /var/cache/yum/x86_64/6/base/packages
Jul 22, 2019

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

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

Attackers take advantage of Apache Struts vulnerabilities
Attackers take advantage of Apache Struts vulnerabilities
Mar 17, 2017
An Apache Web Server Bug That Grants Root Access on  Shared Web Hosts
An Apache Web Server Bug That Grants Root Access on Shared Web Hosts
Apr 10, 2019
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 Gibbson ?
How do i run both nginx and apache in same instance on centos

Hi...,

my server is based centos operating system and my webserver is already running on Apache.... i need to run both apache and nginx on same instance ... please help me to implement this concept...

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.