Need HELP w/Apache Conf

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Need HELP w/Apache Conf

Postby alfred3x » 10. August 2006 19:23

I've installed XAMPP and got it working on my machine after days of struggling with port 80. (Did you know Skype binds to port 80, and if installed first, gives Apache a hard time?)

Anyhow, I've now got the whole thing installed and localhost brings up the XAMPP home page. But I can't seem to get the virtual hosts working, which is where I do my development, of course. I keep getting Access Forbidden! (403) errors.

Here's the vhost directives:

Code: Select all
<VirtualHost *>
  ServerName bluetree.lastbyte.ca
  DocumentRoot "E:/Websites/bluetree/leisureamerican/site/"
   <Directory "E:/Websites/bluetree/leisureamerican/site/" >
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>


If anyone can help, I'd be most appreciative.

Thanks,
- AAA
alfred3x
 
Posts: 29
Joined: 10. August 2006 19:00
Location: Toronto, ON, Canada

Postby alfred3x » 10. August 2006 20:00

Ah, I made some headway, thanks to Izzy's replies in:

http://community.apachefriends.org/f/viewtopic.php?t=19525

I had copied my vhost directives over to httpd-vhosts.conf, and had added a directory directive to the one I was working on. But I had many others which hadn't been "upgraded" that way. Something in that post suggested they *ALL* had to be upgraded. So I removed all of the vhosts, except for the one I was working on, and it worked!

OK, happy about that. But why would the other vhosts affect this one?

Thanks,
- AAA
alfred3x
 
Posts: 29
Joined: 10. August 2006 19:00
Location: Toronto, ON, Canada

Postby Izzy » 11. August 2006 01:37

It might help to post your httpd-vhosts.conf file so it can be looked at and and a more informed reply composed. If you are worried about sensitive information (though I can't think of any) just obfuscate it after pasteing it.

Is it not possible to change the port that Skype listens on?

Not sure if this wildcard is OK or not:
<VirtualHost *>

Try specify a port number in place of 80, for example, being as you say it is only for development purposes.
<VirtualHost *:8000>

Or try this:
<VirtualHost vhostname:*>
Example:
<VirtualHost bluetree.lastbyte.ca:*>

More reading on virtual hosts:
http://httpd.apache.org/docs/2.0/mod/co ... irtualhost

http://httpd.apache.org/docs/2.0/vhosts/

Running sites on different ports example:
http://httpd.apache.org/docs/2.0/vhosts/examples.html

At a command prompt in:
xampp/apache/bin
issue this command to check the syntax of your httpd-vhosts.conf file:
apache -S
It will give the line number(s), if any, of the problem(s), if any, and the error message(s), if any, associated with the line number(s).
If all is fine then it will give a Syntax OK message.


This command checks the syntax in the httpd.conf file:
apache -t

As a side note my extremely limited Internet bandwidth, due to my rural location, prevents my use of any Skype like applications. Broadband in any form is not an option. :(
Last edited by Izzy on 27. August 2006 01:21, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby alfred3x » 11. August 2006 03:44

Sorry I gave a wrong impression: Skype is now out of the way. Once Apache is loaded (before Skype) Skype loads fine afterwards.

The only problem now is with the vhost conf. Here is the syntax check results:

Code: Select all
D:\Program Files\xampp\apache\bin>apache -S
[Thu Aug 10 22:37:01 2006] [warn] VirtualHost bluetree.lastbyte.ca:80 overlaps with VirtualHost ims.lastbyte.ca:80, the first has precedence, perhaps you need a
 NameVirtualHost directive
[Thu Aug 10 22:37:01 2006] [warn] NameVirtualHost *:80 has no VirtualHosts
VirtualHost configuration:
70.25.255.209:80       bluetree.lastbyte.ca (D:/Program Files/xampp/apache/conf/extra/httpd-vhosts.conf:25)
wildcard NameVirtualHosts and _default_ servers:
_default_:443          localhost (D:/Program Files/xampp/apache/conf/extra/httpd-ssl.conf:74)
Syntax OK


And here's the vhost file:

Code: Select all
NameVirtualHost *:80


<VirtualHost bluetree.lastbyte.ca:80>
  ServerName bluetree.lastbyte.ca
  DocumentRoot "E:/Websites/bluetree/leisureamerican/site/"
   <Directory "E:/Websites/bluetree/leisureamerican/site/" >
      Options Indexes FollowSymLinks
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

<VirtualHost ims.lastbyte.ca:80>
  ServerName ims.lastbyte.ca
  DocumentRoot "E:/Websites/ims/site/"
   <Directory "E:/Websites/ims/site/" >
      Options Indexes FollowSymLinks ExecCGI
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
   </Directory>
   CustomLog "E:/Websites/ims/logs/access.log" common
   ErrorLog "E:/Websites/ims/logs/error.log"
</VirtualHost>


Thanks so much for your help! And sorry to hear about your bandwidth limitations.
- AAA
alfred3x
 
Posts: 29
Joined: 10. August 2006 19:00
Location: Toronto, ON, Canada

Postby Izzy » 11. August 2006 03:59

Add this where indicated, save and restart apache.
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "D:/Program Files/xampp/htdocs"
ServerName localhost:80
</VirtualHost>

<VirtualHost bluetree.lastbyte.ca:80>
  ServerName bluetree.lastbyte.ca
  DocumentRoot "E:/Websites/bluetree/leisureamerican/site/"
   <Directory "E:/Websites/bluetree/leisureamerican/site/" >
      Options Indexes FollowSymLinks
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

<VirtualHost ims.lastbyte.ca:80>
  ServerName ims.lastbyte.ca
  DocumentRoot "E:/Websites/ims/site/"
   <Directory "E:/Websites/ims/site/" >
      Options Indexes FollowSymLinks ExecCGI
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
   </Directory>
   CustomLog "E:/Websites/ims/logs/access.log" common
   ErrorLog "E:/Websites/ims/logs/error.log"
</VirtualHost>
Last edited by Izzy on 27. August 2006 01:22, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby alfred3x » 11. August 2006 04:07

Still not 100%. All vhosts point to the same bluetree server: localhost, bluetree and ims.

Here's my apache -S results:

Code: Select all
D:\Program Files\xampp\apache\bin>apache -S
[Thu Aug 10 23:06:27 2006] [warn] VirtualHost bluetree.lastbyte.ca:80 overlaps with VirtualHost ims.lastbyte.ca:80, the first has precedence, perhaps you need a
 NameVirtualHost directive
VirtualHost configuration:
70.25.255.209:80       bluetree.lastbyte.ca (D:/Program Files/xampp/apache/conf/extra/httpd-vhosts.conf:29)
wildcard NameVirtualHosts and _default_ servers:
_default_:443          localhost (D:/Program Files/xampp/apache/conf/extra/httpd-ssl.conf:74)
*:80                   is a NameVirtualHost
         default server localhost (D:/Program Files/xampp/apache/conf/extra/httpd-vhosts.conf:24)
         port 80 namevhost localhost (D:/Program Files/xampp/apache/conf/extra/httpd-vhosts.conf:24)
Syntax OK


And here's the vhosts file:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "d:/Program Files/xampp/htdocs"
    ServerName localhost:80
</VirtualHost>

<VirtualHost bluetree.lastbyte.ca:80>
  ServerName bluetree.lastbyte.ca
  DocumentRoot "E:/Websites/bluetree/leisureamerican/site/"
   <Directory "E:/Websites/bluetree/leisureamerican/site/" >
      Options Indexes FollowSymLinks
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

<VirtualHost ims.lastbyte.ca:80>
  ServerName ims.lastbyte.ca
  DocumentRoot "E:/Websites/ims/site/"
   <Directory "E:/Websites/ims/site/" >
      Options Indexes FollowSymLinks ExecCGI
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
   </Directory>
   CustomLog "E:/Websites/ims/logs/access.log" common
   ErrorLog "E:/Websites/ims/logs/error.log"
</VirtualHost>


- AAA
alfred3x
 
Posts: 29
Joined: 10. August 2006 19:00
Location: Toronto, ON, Canada

Postby Izzy » 11. August 2006 04:12

Try this:
Replace <VirtualHost bluetree.lastbyte.ca:80>
with
<VirtualHost *:80>

and replace <VirtualHost ims.lastbyte.ca:80>
with
<VirtualHost *:80>

Save and restart Apache.
Fingers crossed now. :)
Last edited by Izzy on 27. August 2006 01:20, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby alfred3x » 11. August 2006 14:56

You know, I think the problem may have been with the XAMPP Control Panel. It had tried running Apache, but thought it had failed, so it didn't toggle the Start button to Stop. So it wasn't stopping Apache when I was trying to do a Start/Stop or restart.

For some reason my workstation went down last night, and when I started it up this morning, everything was working tickety boo.

localhost goes to the XAMPP page, bluetree and ims go to their respective sites.

Thanks again!

Now I have another isuue. I need PERL to work, with the MySQL module. Is this something I should be taking to another forum?

Thanks,
- AAA
alfred3x
 
Posts: 29
Joined: 10. August 2006 19:00
Location: Toronto, ON, Canada

Postby Izzy » 11. August 2006 19:05

alfred3x wrote:...Now I have another isuue. I need PERL to work, with the MySQL module. Is this something I should be taking to another forum?...

Yes, I would start another topic. It may draw more attention now that this topic has had a favourable conclusion. ;)
Last edited by Izzy on 27. August 2006 01:18, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Acess Forbidden

Postby bidlisiw » 12. August 2006 06:45

I was looking for a solution to my problem about Virtual Hosting. Well, I had the same problem as alfred3x and i've tried the solutions presented. The only progress I've made was to make my localhost work but the rest of my virtual hosts will display an Access Forbidden page. here is the vhost cofiguration:

Code: Select all
VirtualHost configuration:
wildcard NameVirtualHosts and _default_servers:
_default_:443        localhost (C:/Prgram Files/xampp/xampp/apache/conf/extra/http-ssl.conf:74)
*:80                     is a NameVirtualHost
              default server localhost (C:/Program Files/xampp/xampp/apache/conf/extra/httpd-vhosts.conf:46)
              port 80 namevhost localhost (C:/Program Files/xampp/xampp/apache/conf/extra/httpd-vhosts.conf:46)
              port 80 namevhost local.ub (C:/Program Files/xampp/xampp/apache/conf/extra/httpd-vhosts.conf:52)
              port 80 namevhost jrulida.ph (C:/Program Files/xampp/xampp/apache/conf/extra/httpd-vhosts.conf:62)
Syntax OK


and my vhost file:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "C:/Program Files/xampp/xampp/htdocs"
    ServerName localhost:80
</VirtualHost>

<VirtualHost *:80>
  ServerName local.ub
  DocumentRoot "F:/htdocs/"
   <Directory "F:/htdocs/" >
      Options Indexes FollowSymLinks
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

<VirtualHost *:80>
  ServerName jrulida.ph
  DocumentRoot "C:/htdocs/"
   <Directory "C:/htdocs/" >
      Options Indexes FollowSymLinks ExecCGI
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
   </Directory>
   CustomLog "C:/htdocs/logs/access.log" common
   ErrorLog "C:/htdocs/logs/error.log"
</VirtualHost>



can anyone help me please as to why i still get "Access Forbidden" messages? thanks in advance. :?
bidlisiw
 
Posts: 2
Joined: 12. August 2006 06:23

Postby Izzy » 12. August 2006 08:06

Code: Select all
CustomLog "C:/htdocs/logs/access.log" common
ErrorLog "C:/htdocs/logs/error.log"


Do these directories and files exsist?

If not create them and try and start apache again.

While you are editing the vhost file remove the spaces here in 2 lines:
<Directory "F:/htdocs/" >
To:
<Directory "F:/htdocs/">

These domains do not resolve on the Internet and as such are not virtual domains. There is more to it than just typing in a domain name, they have to mean something and resolve correctly.

They won't work until you can type them in your address bar as http://local.ub and http://jrulida.ph and be taken to your XAMPP web server on what ever IP has been assigned to them.

I have outlined the process in other posts of how to get your domain names to resolve on the Internet.
http://community.apachefriends.org/f/viewtopi ... 2606#82606

You can get them to work until they resove by creating a directory under your localhost web root like this for example:
C:/Prgram Files/xampp/htdocs/jrulida.ph
C:/Prgram Files/xampp/htdocs/local.ub
Put your web sites in them and then type:
http://localhost/jrulida.ph
and
http://localhost/local.ub
in your browser.

local.ub is not even a registered domain, is it?
Last edited by Izzy on 27. August 2006 01:16, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Access Forbidden

Postby bidlisiw » 12. August 2006 10:12

Well, hello! that was a fast reply! and thanks for the reply.

I've got my virtual host to run as smooth as it can be. removing the spaces didn't work for me though. What I did was actually very simpe like the one you've suggested and I was so stupid not to notice it! :shock:
I removed the trailing slash from

Code: Select all
DocumentRoot "F:/htdocs/"


to

Code: Select all
  DocumentRoot "F:/htdocs"


and I did the same with the rest of my virtual hosts. I was shocked that I hadn't noticed that. I've already installed XAMPP previously but I reformatted my drive so I guess, you can forgive me if I had lapses in my memory? :)

And to answer your other questions, none of the domain names are actually registered...they are just virtual host on my local machine.
The log files do exist too! And thanks for this meaningful statement :
There is more to it than just typing in a domain name, they have to mean something and resolve correctly.


So there you are..thanks and more power. I hope you will still help me if I have any more questions regarding XAMPP. And by the way, i'm a noob so i apologize for my lack of knowledge in these matters. :D
bidlisiw
 
Posts: 2
Joined: 12. August 2006 06:23


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 150 guests