You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Crispen Smith <cr...@gmail.com> on 2012/03/08 16:57:30 UTC

[users@httpd] Alternate Ports and Virtual Directories

Hello,
I'm hoping I'm not posting this in a place or a way that will offend as I
only came across these forums this morning via google while looking for
groups that may be able to help with a problem I am encountering.

This is a fairly long post, and I apologize for that but a lot of it is code
excerpts that are probably familiar to anyone who's worked with the
HTTPD.conf file for Apache.

Any help would be greatly appreciated.

Here's the situation:

I've been using WAMP problem free for a couple of years now, across a couple
of different platforms and been very happy with it. 

Recently, I've had to install some other apps that are listening to port 80
and ideally don't want to disable them whenever I'm doing web development,
so I'm experimenting with alternate ports. 

I've gotten 127.0.0.1:8888 working correctly using the advice on this url:
[www.tivohelp.com] 

however, I can't seem to get localhost working correctly; I'm getting a 404
if I call it as localhost and Forbidden if I call it as localhost:8888. 

I have tried 2 different versions of the localhost directives, one
referencing port 8888 in the allow from, and one ignoring it. The one
referencing the port will not allow Apache to start so I'm going to assume
we can go without it. Here's the relevant section of my http.conf 

ServerName localhost:8888 

# 
# DocumentRoot: The directory out of which you will serve your 
# documents. By default, all requests are taken from this directory, but 
# symbolic links and aliases may be used to point to other locations. 
# 
DocumentRoot "c:/wamp/www/" 

# 
# Each directory to which Apache has access can be configured with respect 
# to which services and features are allowed and/or disabled in that 
# directory (and its subdirectories). 
# 
# First, we configure the "default" to be a very restrictive set of 
# features. 
# 
<Directory /> 
Options FollowSymLinks 
AllowOverride None 
Order deny,allow 
Deny from all 
</Directory> 

# 
# Note that from this point forward you must specifically allow 
# particular features to be enabled - so if something's not working as 
# you might expect, make sure that you have specifically enabled it 
# below. 
# 

# 
# This should be changed to whatever you set DocumentRoot to. 
# 
<Directory "c:/wamp/www/"> 
# 
# Possible values for the Options directive are "None", "All", 
# or any combination of: 
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 
# 
# Note that "MultiViews" must be named *explicitly* --- "Options All" 
# doesn't give it to you. 
# 
# The Options directive is both complicated and important. Please see 
# [httpd.apache.org] 
# for more information. 
# 
Options Indexes FollowSymLinks 

# 
# AllowOverride controls what directives may be placed in .htaccess files. 
# It can be "All", "None", or any combination of the keywords: 
# Options FileInfo AuthConfig Limit 
# 
AllowOverride all 

# 
# Controls who can get stuff from this server. 
# 

# onlineoffline tag - don't remove 
Order Deny,Allow 
Deny from all 
Allow from 127.0.0.1 
# Allow from 127.0.0.1:8888 
</Directory> 

Ideally, once I have localhost:8888 working correctly I need to get 2 more
Vhosts running. This is the essential part as I'm using Zend for development
and have all of my zend assets in two vhost directories. 

The old configuration had the following entries in my hosts file: 
127.0.0.1	ct.local 
127.0.0.1	km.local 

and Matching Vhosts in http.conf. However, I've removed the vhosts for now
as I don't want to muddy the waters on this part. 

I believe the directives should look like: 

<VirtualHost *:80> 
DocumentRoot "C:\Users\Public\Documents\CT" 
ServerName ct.local 

AllowOverride all 

Order Deny,Allow 
Deny from all 
Allow from 127.0.0.1 

</VirtualHost> 

Any help would be greatly appreciated.
-- 
View this message in context: http://old.nabble.com/Alternate-Ports-and-Virtual-Directories-tp33465842p33465842.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Alternate Ports and Virtual Directories

Posted by Steve Swift <Sw...@swiftys.org.uk>.
Well, first off, the ServerName directive shouldn't contain ":8888"

On 8 March 2012 15:57, Crispen Smith <cr...@gmail.com> wrote:

>
> Hello,
> I'm hoping I'm not posting this in a place or a way that will offend as I
> only came across these forums this morning via google while looking for
> groups that may be able to help with a problem I am encountering.
>
> This is a fairly long post, and I apologize for that but a lot of it is
> code
> excerpts that are probably familiar to anyone who's worked with the
> HTTPD.conf file for Apache.
>
> Any help would be greatly appreciated.
>
> Here's the situation:
>
> I've been using WAMP problem free for a couple of years now, across a
> couple
> of different platforms and been very happy with it.
>
> Recently, I've had to install some other apps that are listening to port 80
> and ideally don't want to disable them whenever I'm doing web development,
> so I'm experimenting with alternate ports.
>
> I've gotten 127.0.0.1:8888 working correctly using the advice on this url:
> [www.tivohelp.com]
>
> however, I can't seem to get localhost working correctly; I'm getting a 404
> if I call it as localhost and Forbidden if I call it as localhost:8888.
>
> I have tried 2 different versions of the localhost directives, one
> referencing port 8888 in the allow from, and one ignoring it. The one
> referencing the port will not allow Apache to start so I'm going to assume
> we can go without it. Here's the relevant section of my http.conf
>
> ServerName localhost:8888
>
> #
> # DocumentRoot: The directory out of which you will serve your
> # documents. By default, all requests are taken from this directory, but
> # symbolic links and aliases may be used to point to other locations.
> #
> DocumentRoot "c:/wamp/www/"
>
> #
> # Each directory to which Apache has access can be configured with respect
> # to which services and features are allowed and/or disabled in that
> # directory (and its subdirectories).
> #
> # First, we configure the "default" to be a very restrictive set of
> # features.
> #
> <Directory />
> Options FollowSymLinks
> AllowOverride None
> Order deny,allow
> Deny from all
> </Directory>
>
> #
> # Note that from this point forward you must specifically allow
> # particular features to be enabled - so if something's not working as
> # you might expect, make sure that you have specifically enabled it
> # below.
> #
>
> #
> # This should be changed to whatever you set DocumentRoot to.
> #
> <Directory "c:/wamp/www/">
> #
> # Possible values for the Options directive are "None", "All",
> # or any combination of:
> # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
> #
> # Note that "MultiViews" must be named *explicitly* --- "Options All"
> # doesn't give it to you.
> #
> # The Options directive is both complicated and important. Please see
> # [httpd.apache.org]
> # for more information.
> #
> Options Indexes FollowSymLinks
>
> #
> # AllowOverride controls what directives may be placed in .htaccess files.
> # It can be "All", "None", or any combination of the keywords:
> # Options FileInfo AuthConfig Limit
> #
> AllowOverride all
>
> #
> # Controls who can get stuff from this server.
> #
>
> # onlineoffline tag - don't remove
> Order Deny,Allow
> Deny from all
> Allow from 127.0.0.1
> # Allow from 127.0.0.1:8888
> </Directory>
>
> Ideally, once I have localhost:8888 working correctly I need to get 2 more
> Vhosts running. This is the essential part as I'm using Zend for
> development
> and have all of my zend assets in two vhost directories.
>
> The old configuration had the following entries in my hosts file:
> 127.0.0.1       ct.local
> 127.0.0.1       km.local
>
> and Matching Vhosts in http.conf. However, I've removed the vhosts for now
> as I don't want to muddy the waters on this part.
>
> I believe the directives should look like:
>
> <VirtualHost *:80>
> DocumentRoot "C:\Users\Public\Documents\CT"
> ServerName ct.local
>
> AllowOverride all
>
> Order Deny,Allow
> Deny from all
> Allow from 127.0.0.1
>
> </VirtualHost>
>
> Any help would be greatly appreciated.
> --
> View this message in context:
> http://old.nabble.com/Alternate-Ports-and-Virtual-Directories-tp33465842p33465842.html
> Sent from the Apache HTTP Server - Users mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Steve Swift
http://www.swiftys.org.uk

Re: [users@httpd] Alternate Ports and Virtual Directories

Posted by Steve Swift <Sw...@swiftys.org.uk>.
What response do you get to the command "ping localhost"

What do you have on the "Listen" directive in your config?

On 8 March 2012 15:57, Crispen Smith <cr...@gmail.com> wrote:

>
> Hello,
> I'm hoping I'm not posting this in a place or a way that will offend as I
> only came across these forums this morning via google while looking for
> groups that may be able to help with a problem I am encountering.
>
> This is a fairly long post, and I apologize for that but a lot of it is
> code
> excerpts that are probably familiar to anyone who's worked with the
> HTTPD.conf file for Apache.
>
> Any help would be greatly appreciated.
>
> Here's the situation:
>
> I've been using WAMP problem free for a couple of years now, across a
> couple
> of different platforms and been very happy with it.
>
> Recently, I've had to install some other apps that are listening to port 80
> and ideally don't want to disable them whenever I'm doing web development,
> so I'm experimenting with alternate ports.
>
> I've gotten 127.0.0.1:8888 working correctly using the advice on this url:
> [www.tivohelp.com]
>
> however, I can't seem to get localhost working correctly; I'm getting a 404
> if I call it as localhost and Forbidden if I call it as localhost:8888.
>
> I have tried 2 different versions of the localhost directives, one
> referencing port 8888 in the allow from, and one ignoring it. The one
> referencing the port will not allow Apache to start so I'm going to assume
> we can go without it. Here's the relevant section of my http.conf
>
> ServerName localhost:8888
>
> #
> # DocumentRoot: The directory out of which you will serve your
> # documents. By default, all requests are taken from this directory, but
> # symbolic links and aliases may be used to point to other locations.
> #
> DocumentRoot "c:/wamp/www/"
>
> #
> # Each directory to which Apache has access can be configured with respect
> # to which services and features are allowed and/or disabled in that
> # directory (and its subdirectories).
> #
> # First, we configure the "default" to be a very restrictive set of
> # features.
> #
> <Directory />
> Options FollowSymLinks
> AllowOverride None
> Order deny,allow
> Deny from all
> </Directory>
>
> #
> # Note that from this point forward you must specifically allow
> # particular features to be enabled - so if something's not working as
> # you might expect, make sure that you have specifically enabled it
> # below.
> #
>
> #
> # This should be changed to whatever you set DocumentRoot to.
> #
> <Directory "c:/wamp/www/">
> #
> # Possible values for the Options directive are "None", "All",
> # or any combination of:
> # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
> #
> # Note that "MultiViews" must be named *explicitly* --- "Options All"
> # doesn't give it to you.
> #
> # The Options directive is both complicated and important. Please see
> # [httpd.apache.org]
> # for more information.
> #
> Options Indexes FollowSymLinks
>
> #
> # AllowOverride controls what directives may be placed in .htaccess files.
> # It can be "All", "None", or any combination of the keywords:
> # Options FileInfo AuthConfig Limit
> #
> AllowOverride all
>
> #
> # Controls who can get stuff from this server.
> #
>
> # onlineoffline tag - don't remove
> Order Deny,Allow
> Deny from all
> Allow from 127.0.0.1
> # Allow from 127.0.0.1:8888
> </Directory>
>
> Ideally, once I have localhost:8888 working correctly I need to get 2 more
> Vhosts running. This is the essential part as I'm using Zend for
> development
> and have all of my zend assets in two vhost directories.
>
> The old configuration had the following entries in my hosts file:
> 127.0.0.1       ct.local
> 127.0.0.1       km.local
>
> and Matching Vhosts in http.conf. However, I've removed the vhosts for now
> as I don't want to muddy the waters on this part.
>
> I believe the directives should look like:
>
> <VirtualHost *:80>
> DocumentRoot "C:\Users\Public\Documents\CT"
> ServerName ct.local
>
> AllowOverride all
>
> Order Deny,Allow
> Deny from all
> Allow from 127.0.0.1
>
> </VirtualHost>
>
> Any help would be greatly appreciated.
> --
> View this message in context:
> http://old.nabble.com/Alternate-Ports-and-Virtual-Directories-tp33465842p33465842.html
> Sent from the Apache HTTP Server - Users mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Steve Swift
http://www.swiftys.org.uk

Re: [users@httpd] Alternate Ports and Virtual Directories

Posted by Crispen Smith <cr...@gmail.com>.
Awesome, thank you.  One last question; there's really no need to have 80
referenced at all as it's being used by my SSAS server, do you think it's
better to keep the 80's in there or take them out?


Tom Evans-3 wrote:
> 
> On Thu, Mar 8, 2012 at 4:35 PM, Crispen Smith <cr...@gmail.com>
> wrote:
>>
>> Thank you Simone,  but I feel that you're jumping to the end of the
>> story.
>> I'm quite happy to change the virtual posts to port 8888 once I get
>> localhost working correctly, but I'd like to understand that piece as
>> well.
>>
>> Does that make sense?
>>
> 
> It doesn't make sense to me. Do you want to run on port 8888 or port
> 80? You use them inter-changeably...
> 
> Personally, I would use this configuration
> 
> ServerName localhost
> Listen 80
> Listen 8888
> 
> DocumentRoot c:/empty
> 
> <Directory c:/empty>
>   Order allow,deny
>   Allow from all
> </Directory>
> 
> NameVirtualHost *:80
> NameVirtualHost *:8888
> 
> <VirtualHost *:80>
>   ServerName ct.local
>   DocumentRoot c:/sites/ct/htdocs
>   <Directory c:/sites/ct/htdocs>
>     Order Allow,Deny
>     Allow from localhost
>   </Directory>
> </VirtualHost>
> 
> <VirtualHost *:8888>
>   ServerName ct.local
>   DocumentRoot c:/sites/ct-high-port/htdocs
>   <Directory c:/sites/ct-high-port/htdocs>
>     Order Allow,Deny
>     Allow from localhost
>   </Directory>
> </VirtualHost>
> 
> So this sets up a blank empty default site, and then two vhosts. If
> you don't match a vhost by ServerName, you get the empty site.
> 
> If you want :8888 and :80 vhosts to behave the same, simply change all
> to '<VirtualHost *>' and 'NameVirtualHost *'.
> 
> Cheers
> 
> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Alternate-Ports-and-Virtual-Directories-tp33465842p33466312.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Alternate Ports and Virtual Directories

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Mar 8, 2012 at 4:35 PM, Crispen Smith <cr...@gmail.com> wrote:
>
> Thank you Simone,  but I feel that you're jumping to the end of the story.
> I'm quite happy to change the virtual posts to port 8888 once I get
> localhost working correctly, but I'd like to understand that piece as well.
>
> Does that make sense?
>

It doesn't make sense to me. Do you want to run on port 8888 or port
80? You use them inter-changeably...

Personally, I would use this configuration

ServerName localhost
Listen 80
Listen 8888

DocumentRoot c:/empty

<Directory c:/empty>
  Order allow,deny
  Allow from all
</Directory>

NameVirtualHost *:80
NameVirtualHost *:8888

<VirtualHost *:80>
  ServerName ct.local
  DocumentRoot c:/sites/ct/htdocs
  <Directory c:/sites/ct/htdocs>
    Order Allow,Deny
    Allow from localhost
  </Directory>
</VirtualHost>

<VirtualHost *:8888>
  ServerName ct.local
  DocumentRoot c:/sites/ct-high-port/htdocs
  <Directory c:/sites/ct-high-port/htdocs>
    Order Allow,Deny
    Allow from localhost
  </Directory>
</VirtualHost>

So this sets up a blank empty default site, and then two vhosts. If
you don't match a vhost by ServerName, you get the empty site.

If you want :8888 and :80 vhosts to behave the same, simply change all
to '<VirtualHost *>' and 'NameVirtualHost *'.

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Alternate Ports and Virtual Directories

Posted by Crispen Smith <cr...@gmail.com>.
Thank you Simone,  but I feel that you're jumping to the end of the story. 
I'm quite happy to change the virtual posts to port 8888 once I get
localhost working correctly, but I'd like to understand that piece as well.

Does that make sense?


Simone Caruso wrote:
> 
> 
>> <VirtualHost *:80> 
> 
> your virtualhost is on port 80, why don't u try name-bases virtualhosts?
> 
> http://httpd.apache.org/docs/2.0/vhosts/examples.html
> 
> -- 
> Simone Caruso
> IT Consultant
> +39 349 65 90 805
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Alternate-Ports-and-Virtual-Directories-tp33465842p33466096.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Alternate Ports and Virtual Directories

Posted by Simone Caruso <in...@simonecaruso.com>.
> <VirtualHost *:80> 

your virtualhost is on port 80, why don't u try name-bases virtualhosts?

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

-- 
Simone Caruso
IT Consultant
+39 349 65 90 805

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org