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 09-11-2006, 04:05 AM   #1
Galaxy_Stranger
Member
 
Registered: Oct 2003
Distribution: CentOS 6 and Fedora
Posts: 239

Rep: Reputation: 36
Apache 2.2.3 issue.


(Technically, this question is about the WINDOWS version of Apache, but I'll bet i'm going to run into the same thing when I implement on my Core5 machine.)

I recently got Apache 2.2.3 when I reformatted. I installed it and got it running real quick. Then, I got the bright idea to host another site on the server. I decided to use Name Virtal Hosts. I'm not getting the effects that I want.

As I understand it, you're supposed to configure your default server as normal. Then, you add the first virtual host which is identical to the default server settings. THEN you can add all the other virtual hosts you need. I restart the server and hit the site. The main site opens just fine. The second virtual host seems to hit, but gives me - "Error 403"..."You are not authorized to view this page".

At this point, I thought it would be some sort of permissions issue, which I've played with, but can't seem to improve any - I still get the same response. I've been to the Apache site and I've perused through this forum for a while and didn't find anything that helped.

Can anyone give me a checklist to go through of things that need to be done to setup virtual hosts? Here's a copy of the host I can't get access to:

Code:
 
<VirtualHost *:3000>
    ServerAdmin galaxy_stranger@hotmail.com
    DocumentRoot "d:\internet"
    ServerName planetrobotech.no-ip.com
<Directory d:\internet>
order allow,deny
  #Options All FollowSymLinks Indexes
</Directory>
 
Old 09-11-2006, 05:53 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
You try to access it on port 3000?
 
Old 09-11-2006, 12:01 PM   #3
Galaxy_Stranger
Member
 
Registered: Oct 2003
Distribution: CentOS 6 and Fedora
Posts: 239

Original Poster
Rep: Reputation: 36
Yes, indeedy.
 
Old 09-11-2006, 10:23 PM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
And you pass the port in the URL I suppose. So unfortunately I don't know.
Did you enable name based virtual hosting (on my machine it's disabled as I use SSL (and that only works with IP-based virtual hosting).
Code:
#NameVirtualHost *:80
Enable it by removing the '#'
 
Old 09-12-2006, 03:57 AM   #5
Galaxy_Stranger
Member
 
Registered: Oct 2003
Distribution: CentOS 6 and Fedora
Posts: 239

Original Poster
Rep: Reputation: 36
Yeah - tried every way of passing the IP and the port with and without the URL.
Anyway - I found out what the problem was. - I hadn't included the ALLOW directive in the virtual host settings: http://httpd.apache.org/docs/2.2/mod...uthz_host.html Turns out I had it right - just didn't allow myself access to the freaking host. Just in case anyone is interested, I'll briefly go over how I set it up.

First of all, go through the httpd.conf and configure everything you like for the main web page you're hosting. Just act like that's all you're going to host. Save the config file and make sure the server works and you have outside access to it - now you know it at least works.

Second, you need to add a second LISTEN line, specifying whatever other port you want to use. In my case, I have 80 and 8080.

Third, Scroll down to the "virtual hosts" section. You'll need to add lines that look like this:
Code:
 
NameVirtualHost *:80
NameVirtualHost *:8080
 
<VirtualHost *:80>
   DocumentRoot d:\my_main_web_page
#  The directory path above must be in quotes if you use spaces instead of underscores.
   ServerName myfirsturl.com
</VirtualHost>
 
<VirtualHost *:8080>
   DocumentRoot d:\internet
   ServerName mysecondurl.com
      <Directory d:\internet>
      Allow from all
      </Directory>
</VirtualHost>
As you can see, you need a "NameVirtualHost" line for each virtual host. The first host must reflect the main httpd.conf settings and inherits from that. The second host can be configured independently. As far as I can tell, there is no limit to the number of virtual hosts you can create.
 
  


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: Vhosts Issue SpiDeRBlTE Linux - Software 4 05-27-2006 09:23 PM
apache and /etc/hosts issue gravesb Linux - Software 14 08-10-2005 09:32 AM
Apache Issue Jukas Linux - Software 3 07-14-2005 01:33 PM
Is this an apache issue? opsraja Linux - Networking 1 03-02-2005 11:03 PM
apache issue... Robin01 Linux - Newbie 3 09-21-2003 06:12 AM


All times are GMT -5. The time now is 04:42 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