LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 10-27-2004, 09:32 AM   #1
nIMBVS
LQ Newbie
 
Registered: Sep 2003
Location: Romania
Distribution: Linux Mint
Posts: 29

Rep: Reputation: 15
Apache & VirtualHost


I installed Slackware 10 and I want to have 2 virtualhosts on my coomputer.

I give you the settings in httpd.conf wich I thinks are relevant to my problem.

Code:
ServerName server.com

DocumentRoot /var/www/htdocs

<IfModule mod_userdir.c>
    UserDir public_html
    UserDir disabled root
</IfModule>

NameVirtualHost 11.22.33.44:80

<VirtualHost 11.22.33.44:80>
    ServerAdmin blah@server.com
    DocumentRoot /var/www/server2
    ServerName server2
    ErrorLog /var/log/apache/server2_error_log
    CustomLog /var/log/apache/server2_access_log combined
    DirectoryIndex index.php index.html
</VirtualHost>
Now when I access server.com through my browser it shows the page from server2 and the URL in the browser remains the same (http://server.com). server2 works corectly (when I access http://server2 with my browser the corect page is displayed).

The settings in the DNS are correct. "host server2" gives me the corect IP and host server.com gives the same IP.

What gives? Is the apache wich comes with Slackware broken?
 
Old 10-27-2004, 09:37 AM   #2
neilman
Member
 
Registered: Oct 2004
Location: Northville, MI
Distribution: Slackware
Posts: 65

Rep: Reputation: 15
I would recommend doing this: Get rid of "ServerName" at the top of your httpd.conf, or make it generic (i.e. something not useful to you). Now, make a VirtualHost entry (and a NameVirtualHost, if its on a different IP address) for server.com. What I'm saying is make your definition of "server.com" an explicit virtualhost directive-- just as you are doing with server2. And no, that Apache compile with Slackware most likely isn't broken.
 
Old 10-27-2004, 04:01 PM   #3
nIMBVS
LQ Newbie
 
Registered: Sep 2003
Location: Romania
Distribution: Linux Mint
Posts: 29

Original Poster
Rep: Reputation: 15
Yes, Thank you, I did what you told me and it works.
 
  


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 + add a VirtualHost linuxtesting2 Linux - Newbie 2 09-03-2005 04:21 AM
Apache -VirtualHost davidhk Debian 7 08-19-2005 01:33 PM
Virtualhost setup on apache 2 notmatt Debian 2 10-28-2004 02:05 PM
Help with Apache <VirtualHost> please. smakkythecamel Linux - Networking 2 06-12-2003 08:15 PM
apache virtualhost jonfa Linux - Networking 5 08-12-2002 07:07 PM


All times are GMT -5. The time now is 03:55 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration