Solved

apache virtual hosts 2.2 with vhosts.d not working

Posted on 2009-03-30
6
497 Views
Last Modified: 2012-05-06
I'm trying to configure apache virtual hosts on a suse 11.0 server. I edit the httpd.conf file to reflect the files under the vhost.d directory and apache continues to display the default web page no matter which virtual host I browse to.

DNS has been set to see the same IP address for all the hosts (three to start with) and the httpd2 -S confirms config is OK, but to the same default virtual host page.

I've tried a number of variations and the doc files up at apache.org don't seem to cover this new(er) version of apache.

I have googled this till I've run out of links. Any help would be appreciated.

Thanks!

Blaine
0
Comment
Question by:Blainesea0tter
  • 3
  • 3
6 Comments
 
LVL 2

Expert Comment

by:rydersaint
ID: 24025595
Hello Blaine

I find it easier just to make everything virtual servers and then make a default virtual server to catch anything else that is not configured in the DNS

I will attached my apache conf files I hope it helps

Ryder

[default virtual host]

NameVirtualHost 0.0.0.0:80

<VirtualHost 0.0.0.0:80>

	ServerAdmin webmaster@localhost

	

	DocumentRoot /var/www/apache2-default/

	<Directory />

		Options FollowSymLinks

		AllowOverride None

	</Directory>

	<Directory /var/www/>

		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 /var/log/apache2/error.log
 

	# Possible values include: debug, info, notice, warn, error, crit,

	# alert, emerg.

	LogLevel warn
 

	CustomLog /var/log/apache2/access.log combined

	ServerSignature On
 

    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>
 

[another virtual host with DNS configured]

<VirtualHost *:80>

    DocumentRoot /var/www/tweedhost.com.au/web
 

    ServerName tweedhost.com.au

    ServerAlias www.tweedhost.com.au

    ServerAdmin webmaster@tweedhost.com.au
 

    ErrorLog /var/clients/client4/web7/log/error.log
 

    ErrorDocument 400 /error/400.html

    ErrorDocument 401 /error/401.html

    ErrorDocument 403 /error/403.html

    ErrorDocument 404 /error/404.html

    ErrorDocument 405 /error/405.html

    ErrorDocument 500 /error/500.html

    ErrorDocument 503 /error/503.html
 

    <Directory /var/www/tweedhost.com.au/web>

        Options FollowSymLinks

        AllowOverride Indexes AuthConfig Limit FileInfo

        Order allow,deny

        Allow from all

    </Directory>

</VirtualHost>

Open in new window

0
 

Author Comment

by:Blainesea0tter
ID: 24025663
Ryder,

Thanks for the post. It was helpful, but it's the same format as the rest of the doc I've seen so far. In that it doesnt address the new format of the modularization of the virtualization of hosts in apache 2.2.x.

Close though!

Thanks again!

Blaine
0
 
LVL 2

Expert Comment

by:rydersaint
ID: 24025871
Interesting I use apache server 2.2.8 would you be able to attach a link of the "new format of the modularization of the virtualization of hosts" alway happy to learn new things
thank you
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Blainesea0tter
ID: 24025921
Yup,

You're correct. I'm using 2.2.4 and the virtual hosting section I see looks totally different from your code. You know more than I about this, I'm sure.

Attached is the httpd.conf virtual host section and one of the vhost.conf files. Coming right up!

I was trying to describe what is to me a very complex environment. From the sounds of things, you may be able to help me. I'm only an egg...

Thanks!

Blaine
### Virtual server configuration ############################################

#

# VirtualHost: If you want to maintain multiple domains/hostnames on your

# machine you can setup VirtualHost containers for them. Most configurations

# use only name-based virtual hosts so the server doesn't need to worry about

# IP addresses. This is indicated by the asterisks in the directives below.

#

# Please see the documentation at

# <URL:http://httpd.apache.org/docs-2.2/vhosts/>

# for further details before you try to setup virtual hosts.

#

# You may use the command line option '-S' to verify your virtual host

# configuration.

#

Include /etc/apache2/vhosts.d/*.conf
 
 

# Note: instead of adding your own configuration here, consider

#       adding it in your own file (/etc/apache2/httpd.conf.local)

#       putting its name into APACHE_CONF_INCLUDE_FILES in

#       /etc/sysconfig/apache2 -- this will make system updates

#       easier :)
 
 

<VirtualHost *>

DocumentRoot "/srv/www/silentpartnerstech.com/htdocs"

<Directory "/srv/www/silentpartnerstech.com/htdocs">

allow from all

Options +Indexes

</Directory>

</VirtualHost>

Open in new window

0
 
LVL 2

Expert Comment

by:rydersaint
ID: 24026018
everyone is an egg somehow

the important part is

NameVirtualHost 0.0.0.0:80 # this command basically leads all your VirtualHosts

then you just keep adding VirtualHost hosts from there using the
<VirtualHost *:80> # like in your conf file however the port is important

"<VirtualHost *>"  by alone tends to cause trouble

how about trying

NameVirtualHost 0.0.0.0:80

<VirtualHost *:80>
DocumentRoot "/srv/www/silentpartnerstech.com/htdocs"
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com
    ServerAdmin webmaster@yourdomain.com

   <Directory "/srv/www/silentpartnerstech.com/htdocs">
   allow from all
   Options +Indexes
   </Directory>
</VirtualHost>
0
 

Accepted Solution

by:
Blainesea0tter earned 0 total points
ID: 25238096
I solved it on my own through trial and error. Solution is simply put the code for the virtual servers OUTSIDE the body where it says to put it...

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
slow web access in oversea location 3 41
500 Internal Server Error When I Run Code Igniter 4 60
ports for sccm 2012 1 73
Missing Apache mod_DBD packages in Centos 7 2 64
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now