Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6069717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:51:09+00:00 2026-05-23T09:51:09+00:00

I have an Ubuntu dedicated server, and I have 2 domain names. The first

  • 0

I have an Ubuntu dedicated server, and I have 2 domain names. The first one is related to the directory ‘/var/www/’ and the second one is too, I didn’t know how to associate the second one to another directory like ‘/var/www/site2/’
Can you help me ?
Thank you !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:51:09+00:00Added an answer on May 23, 2026 at 9:51 am

    To host multiple domains on the same server with different directories of their own, you need to use the VirtualHost config directive. Inside each one you can specify their own set of configurations (by default the configuration file is stored at /etc/apache2/sites-enabled/000-default.conf):

    NameVirtualHost *:80
    
    <VirtualHost *:80>
            ServerName example.com
            DocumentRoot /var/www/site1
            <Directory /var/www/site1>
                Options -Indexes
            </Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
            ServerName another-example.com
            DocumentRoot /var/www/site2
            <Directory /var/www/site2>
                Options +Indexes
            </Directory>
    </VirtualHost>
    

    The first one lives in /var/www/site1 and has directory indexing turned off. The other is in /var/www/site2 and has directory indexing turned on. You can specify pretty much most configs to be virtualhost specific – ie, custom logging, use of modules such as php or perl, and ServerAlias, among much more. See http://httpd.apache.org/docs/2.2/mod/core.html#virtualhost for more details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have in ubuntu an apache server with a web in /var/www/myweb. I have
I have an ubuntu server with mysql installed, at one point I saw the
i have magento 1.6.2 running on a dedicated server (ubuntu 10.04 lts) I have
I have Ubuntu Linux. I found one command will let me download unread message
I have an Ubuntu server on linode running a node.js/mongo app. I realize I
We have a ubuntu test server that this simple script works fine on where
I have computer (ubuntu server). Server have internet and share internet for local network.
I have an ubuntu server (11.10) on a single-board computer that occasionally is subject
I have Ubuntu 8.04 running on a Xen based VPS server that runs on
I have two issues. I have Ubuntu 10.10 and I have installed git server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.