logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Basic question - Apache configuration - Default web page
Author
Empulak



Joined: 09 Oct 2015
Posts: 1
Location: Benešov

PostPosted: Sun 24 Jan '16 19:45    Post subject: Basic question - Apache configuration - Default web page Reply with quote

Hello,

i am sorry for my amateur question.

I have few webpages on my Apache server. I use virtual hosts configuration.

In my config files is:

servername siteA

servername siteB

servername siteC

..

But if somebody access server by IP.. siteA is showed.

How to show Default Apache webpage?
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Mon 25 Jan '16 2:58    Post subject: Reply with quote

I too have vhosts up and running for 4 different sites. I have this in my httpd.conf

# DocumentRoot: The directory out of which you will serve your documents. By default, all requests are taken from this
# directory, but symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "${SRVROOT}/WEBSites"
<Directory "${SRVROOT}/WEBSites">


# DirectoryIndex: sets the file that Apache will serve if a directory is requested.
#
<IfModule dir_module>
DirectoryIndex index.htm
</IfModule>


What it does is point the requester to a generic page if they try to access my server via IP instead of a URL.

I have the index.htm sitting in the home of my Websites folder (AKA - Document Root).

Kind of like this:

D:\WEBSites
index.htm
<DIR> Site A
<DIR> Site B
<DIR> Site C
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Mon 25 Jan '16 16:31    Post subject: Reply with quote

If you create a vhost the non vhost in httpd.conf disappears.

You can create a default vhost on your own.

Code:

<VirtualHost _default_:80>
...
</VirtualHost>
Back to top


Reply to topic   Topic: Basic question - Apache configuration - Default web page View previous topic :: View next topic
Post new topic   Forum Index -> Apache