logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Virtual Hosts
Author
OldManRiver



Joined: 21 Jun 2006
Posts: 21

PostPosted: Wed 21 Jun '06 20:18    Post subject: Virtual Hosts Reply with quote

Working on several sites and have a PHP problem in code on one.

Been FTP'ing to ISP and running but then cannot see PHP errors.

Need to mirror ISP setup on my localhost so I can debug. Error is a redirect error that is causing either blank pages (sometimes) or staying in current page with no changes (other times).

Added the following VHost code to apache, which is syntax free, but not running:
Code:
<VirtualHost *:80>
  ServerName "stovall.home.com"
  DocumentRoot "E:/Mypath/Stovall"
  ServerAdmin "admin@stovallhome.com"
  ErrorLog "logs/stovall-error_log"
  CustomLog logs/stovall-access_log common
</VirtualHost>


Calling file is .shtml so have the line:
Code:
DirectoryIndex index.html index.html.var index.shtml


This is my first try at Virtual Host so could use some help here!

Thanks!

OMR
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Wed 21 Jun '06 20:51    Post subject: Reply with quote

Not clear to me what does not work for you.

Our vhost config looks like:

NameVirtualHost *

<VirtualHost *>
ServerName just_a_name
DocumentRoot f:/web/unknown
</VirtualHost>

<VirtualHost *>
ServerName www.apachelounge.com
ServerAlias apachelounge.com
DocumentRoot f:/web/al
</VirtualHost>

etc. etc.

note:
The first VirtualHost section is used for all requests that do not match a ServerName or ServerAlias in any <VirtualHost> block

Steffen
Back to top
OldManRiver



Joined: 21 Jun 2006
Posts: 21

PostPosted: Thu 22 Jun '06 0:59    Post subject: Reply with quote

Steffen wrote:
Not clear to me what does not work for you.

Our vhost config looks like:

NameVirtualHost *

<VirtualHost *>
ServerName just_a_name
DocumentRoot f:/web/unknown
</VirtualHost>

<VirtualHost *>
ServerName www.apachelounge.com
ServerAlias apachelounge.com
DocumentRoot f:/web/al
</VirtualHost>

etc. etc.

note:
The first VirtualHost section is used for all requests that do not match a ServerName or ServerAlias in any <VirtualHost> block

Steffen


Thanks for the reply. Let me see if I can explain better. I have these projects organized like:
    e:\projects\project1
    e:\projects\project2
    e:\projects\project3
    e:\projects\project4
    e:\projects\project5
I need to be able to do either:
    localhost/project1/
    or
    new.project1.com
and have Apache recognize that just like:
    http://www.project1.com
    or
    /apache/htdocs/project1
What I entered does not get that done, not even sure it works, don't know how to adequately test it and do not know what else to enter in the .conf file to get to the point I need. Maybe all I need is a ServerAlias to the right set of directories. I have a bunch of Directory defs like:
Code:
<Directory "E:/Projects/Project1">
  Options All
  Allow from All
  Order Allow,Deny
</Directory>
but don't even know what these do.

Hope this is not more confusing.

OMR
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Thu 22 Jun '06 11:55    Post subject: Reply with quote

When I understand the answer for you is in post www.apachelounge.com/viewtopic.php?p=1692#1692

Steffen
Back to top
OldManRiver



Joined: 21 Jun 2006
Posts: 21

PostPosted: Thu 22 Jun '06 20:14    Post subject: Tried but error Reply with quote

Tried the items in that post and now getting 403 errors, even on localhost.

Posted my problem there.

OMR
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Fri 23 Jun '06 10:45    Post subject: Reply with quote

Steffen wrote:
Not clear to me what does not work for you.

Our vhost config looks like:

NameVirtualHost *

<VirtualHost *>
ServerName just_a_name
DocumentRoot f:/web/unknown
</VirtualHost>

<VirtualHost *>
ServerName www.apachelounge.com
ServerAlias apachelounge.com
DocumentRoot f:/web/al
</VirtualHost>

etc. etc.

note:
The first VirtualHost section is used for all requests that do not match a ServerName or ServerAlias in any <VirtualHost> block

Steffen


If you use <VirtualHost _default_:80> stuff here </VirtualHost>
Apache will use this one when there is no-other available Wink beat using the unkown block.
Back to top
YoDude9999



Joined: 23 Jun 2006
Posts: 3

PostPosted: Fri 23 Jun '06 18:47    Post subject: Reply with quote

Quote:

jorge
<Directory "E:/Projects/Project1">
Options All
Allow from All
Order Allow,Deny
</Directory>


You may want to consider changing to:

<Directory "E:/Projects/Project1">
Options All
Order Allow,Deny
Allow from All
</Directory>
Back to top
OldManRiver



Joined: 21 Jun 2006
Posts: 21

PostPosted: Tue 27 Jun '06 21:06    Post subject: Order Reply with quote

Since there seems to be some logic to the order can you explain?

OMR

Please see my post on this at:

http://forums.devshed.com/apache-development-15/apache-error-can-t-load-find-php5apache2-dll-349394.html

Thanks!

OMR

Mod: You may edit your postings...
Back to top


Reply to topic   Topic: Virtual Hosts View previous topic :: View next topic
Post new topic   Forum Index -> Apache