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 7566423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:24:32+00:00 2026-05-30T14:24:32+00:00

I am interested in, if I can have vhosts on apache with domain names

  • 0

I am interested in, if I can have vhosts on apache with domain names like:
http://something.com/something or http://{server-ip-address-here}/something ?

I am using Apache 2.2.20 on Ubuntu Server, thats my home server and I am testing some stuff here, I dont have any DNS server here and what I have is only public IP address and a domain name attached to it from open dns service.

So, what did I do:

  1. I have created new file “demo” in /etc/apache2/sites-available
  2. I put there this (actually it is copied with modifications from default file):

    <VirtualHost *:80>
       ServerAdmin webmaster@localhost
       ServerName  {mydomain-here}/demo/
       DocumentRoot /vhosts/demo
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /vhosts/demo/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>
    
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>
    
    ErrorLog ${APACHE_LOG_DIR}/error.log
    
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
    </VirtualHost>
    

  3. Created symlink in /etc/apache2/sites-enabled/ which points to /etc/apache2/sites-available/demo

  4. Created /vhosts/demo/index.html file.

And now what i get is that when I go to {my-domain} I go to vhost which I have created, but problem is that server points me there in ANY case, not only {my-domain}/demo what I want.

In conclusion, I want that I can create different virtual hosts and attach them to different URL’s which will have same base-url, for example http://www.mydomain.com/vhost1, http://www.mydomain.com/vhost2 etc..

Is it possible?
Thanks 🙂

  • 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-30T14:24:33+00:00Added an answer on May 30, 2026 at 2:24 pm

    To start, the reason why it goes there is ANY case is cause you have you have a *:80 setting for your virtual host, so if nothing matches the request it uses the first virtual host entry

    If I understand what you are trying to do it appears like you might just want to alias each ‘virtual host’

    What you are trying to do isn’t quite a virtual host (at least what a virtual host is supposed to do), but you might be able to accomplish it by using alias feature of apache

    Alias /vhost1 /whatever/folder/your/vhost1/site/is/at
    Alias /vhost2 /whatever/folder/your/vhost2/site/is/at
    

    So now whatever domain you use e.g. http://whatever.com/vhost1 or http://whatever.com/vhost2
    The both of em will appear as separate sites

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

Sidebar

Related Questions

I have three tables something like the following: Customer (CustomerID, AddressState) Account (AccountID, CustomerID,
I'm interested to know if I can have access to all the libraries, ide,
I have an UITextView which can have multiple lines. All I'm interested in is
I am interested to know how can I do the same thing that the
im interested how many api calls per second or per minute i can do
I'm interested in developing an app for iPhone that can scan and read ITF
I can implement both variants - it's easy. But I'm interested: what approach is
How can I make an average between dates in MySQL? I am more interested
I'm interested in creating a system where the user can define the steps in
Can somebody share an experience concerning scaling vertically the ActiveMQ? I'm particularly interested how

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.