LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-19-2012, 09:31 AM   #16
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16

Ok, here you go:

Code:
NameVirtualHost *:80

<VirtualHost *:80>
	ServerAdmin mysite.com
	
	DocumentRoot /var/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all		
	</Directory>

	ErrorLog /var/log/apache2/error.log

</VirtualHost>
 
Old 10-19-2012, 09:55 AM   #17
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
fairly sure you aren't allowed a Directory option in a virtual host, as it's not related to a specific website, but the underlying OS access. Just remove them
 
Old 10-19-2012, 12:20 PM   #18
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16
Still no luck!

Code:
NameVirtualHost *:80

<VirtualHost *:80>
	ServerAdmin info@mtsite.com	
	DocumentRoot /var/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	ErrorLog /var/log/apache2/error.log
</VirtualHost>
 
Old 10-19-2012, 12:42 PM   #19
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Huh... you still very clearly DO have a directory declaration in there
 
Old 10-19-2012, 01:12 PM   #20
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16
ok ok , just really @?>L:^&% of with this now! Sorry!

Code:
NameVirtualHost *:80

<VirtualHost *:80>
	ServerAdmin info@learningworldonline.com	
	DocumentRoot /var/www/
	ErrorLog /var/log/apache2/error.log
</VirtualHost>
Still get same error in the apache log [warn] NameVirtualHost *:80 has no VirtualHosts

Just noticed I have a default -ssl in my sites available folder?? I don't have SSL! Interestingly enough, here's an excerpt from it:


Code:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
	ServerAdmin webmaster@localhost

	DocumentRoot /var/www
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
hmm is this the problem? Should I just bin it?
 
Old 10-19-2012, 02:11 PM   #21
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 425

Rep: Reputation: 56
I really don't know what to think about this thread.
Where is the ServerName directive in this VirtualHost definition?? (as it was suggested in the example by acid_kewpie )
Code:
NameVirtualHost *:80

<VirtualHost *:80>
	ServerAdmin info@learningworldonline.com	
	DocumentRoot /var/www/
	ErrorLog /var/log/apache2/error.log
</VirtualHost>
If there are confusions about your config-files (apache2.conf or httpd.conf) just post the versions you use.
- which distribution
- distribution-version
- apche2-version
The obvious reason why the most up-to-date distributions split up the main Apache2 configuration file into several separate files and then link them with Include again, is to keep neatness in it. For example Slackware use files like this.
- httpd.conf
- httpd-vhosts.conf
- https-ssl,conf
... and so on

As it is possible to guess from your posts you have one apache2.conf file (you may also fob off some of them). Usually there is one file because of two possible reasons:
1. You are using a very old version of distribution
2. Your distribution manages the web server configuration file by some utility (like YAST in SuSe EL). In this case "theoretically" you do not touch the configuration file manually. (this is the reason why it doesn't need to be transparent)

If you seriously want to configure your web server, you should take a deep breath and start from the beginning and post the versions mentioned above.

Hope it helps.

Last edited by hua; 10-19-2012 at 02:19 PM.
 
Old 10-21-2012, 12:50 AM   #22
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16
Lol, took your advice...walked away.... had a think about, started from scratch and hey presto the penny dropped! All working like a charm, kind thanks for sticking with me on this one cos I was pulling my hair out, as you probably guessed?

Oh, and you can add Directory options in a Virtual Host (Don't know if I'm right, but it works!):

Code:
<VirtualHost *:80>
	ServerName test.mysite.com
	ServerAlias test.mysite.com
	DocumentRoot /var/www/chamilo
	<Directory />
                Options FollowSymLinks
                AllowOverride None
      </Directory>
	<Directory /var/www/chamilo>
		Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
	</Directory>
</VirtualHost>
Thanks again for your help, you're a star!

Last edited by ludo33; 10-21-2012 at 12:51 AM. Reason: Spelling
 
1 members found this post helpful.
Old 10-21-2012, 04:10 AM   #23
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 425

Rep: Reputation: 56
Quote:
Originally Posted by ludo33 View Post
Thanks again for your help, you're a star!
I am glad it works. You can always show your pleasure with "Did you find this post helpful" and mark your thread solved (at the top right corner of thread - Thread tools).
Have a nice day!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache default virtual host rs232 Linux - Software 5 12-23-2009 09:57 PM
[SOLVED] Apache2 - virtual host defaulting to default host slimjim Linux - Server 1 10-31-2009 02:47 AM
Getting nuts. Can't receive e-mail and can't configure a dns server (virtual host) stormrider_may Linux - Networking 22 02-14-2006 06:44 AM
IP and Domain resolving to default virtual host DropHit Linux - Newbie 4 11-19-2005 03:42 PM
RH9 Apache Virtual Host Default Document jswilson Linux - Newbie 2 01-29-2004 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration