LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-16-2007, 06:30 AM   #1
dave`2005
Member
 
Registered: Aug 2005
Distribution: Ubuntu 7.10, Slackware 12
Posts: 270

Rep: Reputation: 30
apache2 virtual hosts


Hi all,

I've read how to set up a virtual host on the ubuntu documentation site but i think im missing something because its not working.

I've put the site folder in /var/www and made a mysite.co.uk text file and put it in /etc/apache2/sites-available/ here it is:
Code:
NameVirtualHost *
<VirtualHost *>
	ServerAdmin webmaster@mysite.co.uk
	ServerName mysite.co.uk
	ServerAlias *.mysite.co.uk
	
	DocumentRoot /var/www/mysite.co.uk/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/mysite.co.uk/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
		# This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
	</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/mysite.co.uk-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>
(I replaced my url with mysite)

Do i need to delete /etc/apache2/sites-available/default ? Do i have to make a symbolic link to /var/www/mysite.co.uk somewhere?

Any help very much appreciated.
 
Old 11-19-2007, 07:17 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

You need to make a symlink to your file in "/etc/apache2/sites-enabled". Alternatively, you can use a command that is included with Apache2:

a2ensite mysite.co.uk

This command will make a symlink for you.
 
  


Reply



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
Virtual hosts on apache2 70mas Linux - Server 3 07-16-2007 02:29 AM
Apache2 - need help with virtual hosts bioalchemist Linux - Software 5 08-11-2006 01:24 PM
Subdomains on Apache2 with virtual hosts - how? <Ol>Origy Linux - Networking 2 08-18-2005 05:53 AM
Apache2, SSL, 2 Virtual Hosts franticbob Linux - Software 0 04-07-2004 09:48 PM
apache2 virtual hosts viniosity Linux - Software 4 02-07-2004 12:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:23 PM.

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
Open Source Consulting | Domain Registration