Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 3rd, 2009, 10:45 AM
murklys murklys is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 351 murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 15 h 7 m 11 sec
Reputation Power: 21
Something is wrong with virtual hosts

Hello, i have a problem with virtual hosts. I am running debian 5 with apache 2. In /etc/apache2/sites-available i have a default configuration and one for a virtual host. Both enabled. The default looks like this:

Code:
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost
        DocumentRoot /some/path
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /some/path/>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log
        LogLevel warn
        CustomLog /var/log/apache2/access.log combined
</VirtualHost>



And there's a virtualhost, configured like this:

Code:
#
#  domain.com (/path/)
#
<VirtualHost *>
        ServerAdmin webmaster@localhost
        ServerName  www.domain.com
        ServerAlias domain.com *.domain.com

        DocumentRoot /path/

        <Directory /path/>
                AllowOverride All
        </Directory>

        # CGI Directory
        ScriptAlias /cgi-bin/ /path/cgi-bin/
        <Location /cgi-bin>
                Options +ExecCGI
        </Location>

        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
        CustomLog /var/log/apache2/access.domain.log combined

</VirtualHost>



It works if i navigate to *.domain.com, but if i navigate to domain.com precisely - it shows me the default website from the default config. I've defined "domain.com" in aliases so why doesn't it work ?

Reply With Quote
  #2  
Old June 3rd, 2009, 10:59 AM
menator's Avatar
menator menator is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Posts: 594 menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 4 h 9 m 46 sec
Reputation Power: 25
Send a message via MSN to menator
Do you have the dns and host files set up propperly.

And this <virtualhost *> should be <virtualhost *:80>
and namevirtualhost * should be namevirtualhost *:80

Reply With Quote
  #3  
Old June 3rd, 2009, 11:03 AM
murklys murklys is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 351 murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 15 h 7 m 11 sec
Reputation Power: 21
I've just changed all to *:80 format. No change unfortunatelly. Still doesn't work without a domain prefix.

What did you mean by dns and host files?

Content of /ec/hosts

Code:
127.0.0.1 localhost.localdomain localhost
127.0.0.1 mgrsoft.domain.com
# Auto-generated hostname. Please do not remove this comment.
?.?.?.? domain.com domain domain


Question marks simply hide the ip.

Last edited by murklys : June 3rd, 2009 at 11:06 AM.

Reply With Quote
  #4  
Old June 3rd, 2009, 11:32 AM
menator's Avatar
menator menator is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Posts: 594 menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 4 h 9 m 46 sec
Reputation Power: 25
Send a message via MSN to menator
Here is my setup, but will not work if you do not have a registered domain name.

Code:
#Apache2

UserDir www

NameVirtualHost *:80

<VirtualHost *:80>
  ServerAdmin webmaster@phpshelf.net
  DocumentRoot /home/menator/www
  ServerName www.phpshelf.net
  ScriptAlias /cgi-bin/ "/home/menator/www/cgi-bin/"
  CustomLog /home/menator/logs/access_log combined
</VirtualHost>


#/etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1	server1.phpshelf.net	localhost.localdomain	localhost
192.168.1.103 server1.phpshelf.net server1
::1		localhost6.localdomain6 localhost6


#named.conf
#
# Configure ourself as the host for basiczone.com
#
zone "phpshelf.net" IN {
	type master;
	file "phpshelf.net.zone";
};
#
zone "1.168.192.in-addr.arpa" {
	type master;
	file "192.168.1.rev";
};

# zone file
$TTL 900		; 900 seconds default record (T)ime (T)o (L)ive in cache

; Authored by SilentRage
;
; Download Location:
; http://www.dollardns.net/bind/

@		SOA	ns1 (		; ns1.basiczone.com is the primary server for basiczone.com
			postmaster	; contact email for basiczone.com is postmaster@basiczone.com
			2004041700	; Serial ID in reverse date format
			21600		; Refresh interval for slave servers
			1800		; Retry interval for slave servers
			604800		; Expire limit for cached info on slave servers
			900 )		; Minimum Cache TTL in zone records

@		NS	ns1		; ns1.basiczone.com is a host for basiczone.com
@		NS	ns2		; ns2.basiczone.com is a host for basiczone.com

@		A	192.168.1.103	; basiczone.com's IP address is 127.0.0.4

@		MX	10 mail		; Mail for *@basiczone.com is sent to mail.basiczone.com

ns1		A	192.168.1.103	; ns1.basiczone.com's IP address is 127.0.0.1
ns2		A	192.168.1.103	; ns2.basiczone.com's IP address is 127.0.0.2

mail		A	192.168.1.103	; mail.basiczone.com's IP address is 127.0.0.3
phpshelf.net.	A	192.168.1.103
www		A	192.168.1.103	; www.basiczone.com's IP address is 127.0.0.4



Hope it helps

I do not have a great deal of knowledge with apache and dns but this is how I got mine to work.

Apache documentation was a great help

Reply With Quote
  #5  
Old June 3rd, 2009, 12:14 PM
murklys murklys is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 351 murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 15 h 7 m 11 sec
Reputation Power: 21
Well my domains are located in another place and another dns servers, they simply point to this server's IP. According to tutorials on google, my config should be working ... I don't see much of a difference between your config and mine. But still can't get a domain without www to work ... I guess i'll try google's help once again. If only i knew how to name this particular problem ... Now it's like looking for a needle in a haystack.

Reply With Quote
  #6  
Old June 3rd, 2009, 01:43 PM
menator's Avatar
menator menator is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Posts: 594 menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level)menator User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 4 h 9 m 46 sec
Reputation Power: 25
Send a message via MSN to menator
Two questions
Do you have access to the dns server " the zone file "?
When was the zone file updated?

It takes 72 hours for it to flow out to the web.

Reply With Quote
  #7  
Old June 3rd, 2009, 04:24 PM
murklys murklys is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 351 murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level)murklys User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 15 h 7 m 11 sec
Reputation Power: 21
If it weren't updated - i wouldn't see the default page of my server I wouldn't resolve to the correct ip at all. It gets to the server and then ... for some reason ... doesn't understand it has to go to the virtual host directory.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Something is wrong with virtual hosts


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT