LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-26-2005, 03:53 AM   #1
davidhk
Member
 
Registered: Jun 2005
Posts: 38

Rep: Reputation: 15
virtual host in debian???


1) I would like to use virtual host in apache2
Steps:-
-added my ip as below.
-add ServerName...
-create dir /var/ww/dn1/, and made a file of index.html in it.
-make symbolic link
-restart apache2


2)
/etc/apache2/sites-available# ls
default domain1
/etc/apache2/sites-available# cat domain1
----------
NameVirtualHost 203.x.x.x
<VirtualHost 203.x.x.x>
ServerAdmin webmaster@localhost
ServerName www.domain1.com
DocumentRoot /var/www/dn1/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/dn1/>
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/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>
-----
cd /var/www/dn1# ls
index.html

-----
3) At client,
open a browser, and try http://www.domain1.com

Result:-
Not Found
The request URL / was not found on this server.

Thanks!

4) I make a file of domain1
dns:/etc/apache2/sites-available# ls
default domain1

5) create symbolic link
ln -s /etc/apache2/sites-available/domain1 /etc/apache2/sites-enabled/domain1.com

6)tail /var/log/apache2/error.log
[warn] NameVirtualHost 203.x.x.x. has no VirtualHosts

Thanks for any help.







Last edited by davidhk; 08-26-2005 at 08:56 PM.
 
Old 08-30-2005, 01:33 PM   #2
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
A stupid question first: do you have a registered domain and a DNS server pointing to your server? It won't work if you don't.
 
Old 08-30-2005, 09:07 PM   #3
davidhk
Member
 
Registered: Jun 2005
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Moloko
A stupid question first: do you have a registered domain and a DNS server pointing to your server? It won't work if you don't.
I did the dns server setting (100% works) and got my registered domain. domain1.com is not my real registered domain, I can't disclose here.
 
Old 08-31-2005, 03:39 PM   #4
redir
Member
 
Registered: May 2004
Location: Virginia USA
Distribution: Debian_Ubuntu_FreeBSD
Posts: 122

Rep: Reputation: 16
another stupid question perhaps:

You said "-create dir /var/ww/dn1/, and made a file of index.html in it."

And your Document root is " DocumentRoot /var/www/dn1/"

I am guessing its a typo but everything else looks right to me.
 
  


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
Virtual Host abridge Linux - Software 1 04-13-2005 07:35 AM
Apache 2.0 Virtual Host? w0lfeyes Linux - Networking 1 05-03-2004 03:09 PM
virtual host ziggie216 Linux - General 2 12-22-2003 06:38 PM
Virtual Host |Drakehash| Linux - Networking 0 07-17-2003 03:02 PM
VIrtual host thep Linux - General 10 08-06-2002 11:28 AM

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

All times are GMT -5. The time now is 03:02 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
Open Source Consulting | Domain Registration