• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Saturday, May 10, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home VPS/Servers management guides

Configure Apache Virtual Hosts on a VPS

How VPS by How VPS
November 2, 2018
in VPS/Servers management guides
0
Configure Apache Virtual Hosts on a VPS
0
SHARES
76
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Apache Virtual Hosts Configuration
    1. Shared IP with Multiple Virtual Hosts
    2. Virtual Hosts with dedicated IP addresses
    3. Combination Name Based and IP Based Apache Virtual Hosts

Configure Apache Virtual Hosts on a VPSOne great benefit of VPS hosting is being able to easily host multiple websites off the same server. Owning a VPS offers much more than just web hosting but in this tutorial we will show you how to setup virtual hosts with Apache.

Apache HTTP Server is probably one of the most influential pieces of open-source software that let to the explosive growth of the World Wide Web today. Still going strong it is the leading web server used across the internet today. Apache HTTP Server runs on many operating systems such as Unix, Linux, BSD, Windows, OSX, and Solaris, among others.

Apache HTTP Server is developed by the Apache Software Foundation, and has a strong community of  developers supporting the project.

Apache Virtual Hosts Configuration

Setting up virtual hosts is straightforward. In your HTTP Configuration file add the following lines. Modify the settings for your environment. If you have any question leave a comment and we will get back to you.



Shared IP with Multiple Virtual Hosts

# accept virtual host requests on all IP's
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/domain1
ServerName www.domain1.com

</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/domain2
ServerName www.domain2.net

</VirtualHost>

Virtual Hosts with dedicated IP addresses

Listen 80

# This is the server running on your main IP.
ServerName server.maindomain.com
DocumentRoot /www/maindomain

# Virtual Servers will use other IP address
NameVirtualHost 123.231.199.50

<VirtualHost 123.231.199.50>
DocumentRoot /www/domain1
ServerName www.domain.com

</VirtualHost>

<VirtualHost 123.231.199.50>
DocumentRoot /www/domain2
ServerName www.domain2.net

</VirtualHost>

Combination Name Based and IP Based Apache Virtual Hosts

Listen 80

NameVirtualHost 123.231.199.50

<VirtualHost 123.231.199.50>
DocumentRoot /www/domain1
ServerName www.domain.com
</VirtualHost>

<VirtualHost 123.231.199.50>
DocumentRoot /www/domain2
ServerName www.domain2.org
</VirtualHost>

<VirtualHost 123.231.199.50>
DocumentRoot /www/domain3
ServerName www.domain3.com
</VirtualHost>

## - IP Based Hosted Domains
<VirtualHost 123.231.199.51>
DocumentRoot /www/domain4
ServerName www.domain4.info
</VirtualHost>

<VirtualHost 123.231.199.51>
DocumentRoot /www/domain5
ServerName www.domain5.me
</VirtualHost>

Happy Hosting!
– Tutor

Previous Post

Real Time Interactive IP LAN Monitoring with IPTraf Tool

Next Post

Cheat – An Ultimate Command Line ‘Cheat-Sheet’ for Linux Beginners and Administrators

Next Post

Cheat – An Ultimate Command Line ‘Cheat-Sheet’ for Linux Beginners and Administrators

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet