LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 03-24-2006, 10:29 PM   #1
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Rep: Reputation: 15
Apache 2.0 virtual host config file


ALright I just cant seem to get this config file thing, when I go to the HTTP server and setup and add everything it seems to work with the defaults except the virtual host.

I think i am confusing the config file with the HTTP server setup or visa versa.

Do i need to add or configure anything else? I just want to run two domains on one server and i cant seem to get it right because i dont know 100% what i am doing.

Anyone out there who can help me would be greatly appreciated! thanks Mike

This is what I have so far and it doesn`t work (note my domain names are different but this is what I have tried so far.

Include /etc/apache2/vhosts.d/*.conf
<VirtualHost 192.168.1.69>
ServerName www.mydomain.com
DocumentRoot srv/www/site1
</VirtualHost>

#<VirtualHost 192.168.1.69>
#ServerName www.otherdomain.com
#DocumentRoot srv/www/site2

#</VirtualHost>
 
Old 03-24-2006, 11:03 PM   #2
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Rep: Reputation: 34
you need the following line before your VirtuslHost directives:
NameVirtualHost 192.168.1.69

You may also want (or need) to put a port in there and in the VirtualHost tags:
NameVirtualHost 192.168.1.69:80

Also, you should be including your dynamic virtual hosts after your static ones - the first one read into the server becomes default - so move the Include line to below the VirtualHost container.
 
Old 03-25-2006, 12:02 AM   #3
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Original Poster
Rep: Reputation: 15
thanks i will try that,it shouldnt be that difficult,galdthis forum ishere !Mike
 
Old 03-25-2006, 03:27 AM   #4
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by this213
you need the following line before your VirtuslHost directives:
NameVirtualHost 192.168.1.69

You may also want (or need) to put a port in there and in the VirtualHost tags:
NameVirtualHost 192.168.1.69:80

Also, you should be including your dynamic virtual hosts after your static ones - the first one read into the server becomes default - so move the Include line to below the VirtualHost container.
Crap, I got this error now

Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
www.mctech-computers.com
Sat Mar 25 01:26:36 2006
Apache/2.0.54 (Linux/SUSE)

So here is part of my config file I changed the document root to default but that didnt help.
I know I need some sort of error logs too, but I am getting this done first.

NameVirtualHost 192.168.1.69:80
<VirtualHost 192.168.1.69>
ServerName www.mctech-computers.com
DocumentRoot srv/www/htdocs
</VirtualHost>
<VirtualHost 192.168.1.69>
ServerName www.taaxwilaas.com
DocumentRoot srv/www/taaw
</VirtualHost>
Include /etc/apache2/vhosts.d/*.conf

I did have the page up before but just the one site and the second site taaxwilaas came up with the same page as my index so I know its not looking in the right spot for the document root for that site.

Question what is the difference when adjusting the config file and editing the HTTP Server? I have basically duplicated everything in the HTTP Server Using YaSt and then save the changes.

Perhaps I am missing something or am complicationg this? the darn thing will work with one site depending on what index file i use so I know it works but it doesn`t want to see two sites.

Under HTTP Server I have listed the mctech domain as default and the taaxwilaas domain as the second.

Also should I simply put my Dynamic IP in there instead of the static?

any other help with this would be appreciated thanks Mike
 
Old 03-25-2006, 06:04 AM   #5
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Original Poster
Rep: Reputation: 15
Any Takers?

just a bump, cuz i need some help thanks

Last edited by mnm_mc; 03-25-2006 at 06:23 AM.
 
Old 03-25-2006, 01:47 PM   #6
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Original Poster
Rep: Reputation: 15
anyone? anyone?
 
Old 03-25-2006, 07:32 PM   #7
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Original Poster
Rep: Reputation: 15
guess not eh?
 
Old 03-25-2006, 10:57 PM   #8
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Rep: Reputation: 34
Code:
DocumentRoot srv/www/htdocs
should be something like:
Code:
DocumentRoot /srv/www/htdocs
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Config file for Apache name-based virtual hosting mnm_mc Linux - Software 5 03-22-2006 03:29 AM
Apache named virtual host config darthtux Linux - Software 8 04-19-2005 02:38 AM
Apache: Virtual Host Config question rajanr Linux - Software 5 08-30-2003 12:41 PM
Virtual host config won't work klintonray Linux - Networking 18 08-19-2003 02:53 PM
Major Virtual Host Config Issues klintonray Linux - Software 2 08-07-2003 07:20 PM


All times are GMT -5. The time now is 05:03 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration