Robert Nesius | 1 Jun 2012 05:10
Picon

Re: Getting apache to work...dumb question in here :)



On Thu, May 31, 2012 at 9:38 AM, Erik Anderson <erikerik <at> gmail.com> wrote:
On Thu, May 31, 2012 at 3:56 AM, Craig Rosenblum <crosenblum <at> gmail.com> wrote:
Edit the file that contains that line and add the following:

NameVirtualHost *:8082

Then all you need to do is start adding virtualhosts.

<VirtualHost *:8082>
   ServerName example.com
   DocumentRoot /path/to/web/root

   # add the following two lines if you want vhost-specific logging
   ErrorLog /ver/log/apache2/example.com-error
   CustomLog /var/log/apache2/example.com-access combined
</VirtualHost>


If my memory is working correctly, the argument to VirtualHost must match the argument to a NameVirtualHost directive. 

i.e.: Apache will complain about this (and likely won't work), even though intuitively you might think it's just fine.  

NameVirtualHost 192.168.1.1:8282

<VirtualHost *:8282>
</VirtualHost> 

-Rob

 
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
Erik Anderson | 1 Jun 2012 05:13
Picon
Gravatar

Re: Getting apache to work...dumb question in here :)

On Thu, May 31, 2012 at 10:10 PM, Robert Nesius <nesius <at> gmail.com> wrote:
> If my memory is working correctly, the argument to VirtualHost must match
> the argument to a NameVirtualHost directive.

Exactly. Which is why both of those cases in my example code use *:8082.

:)
Robert Nesius | 1 Jun 2012 05:17
Picon

Re: Getting apache to work...dumb question in here :)



On Thu, May 31, 2012 at 10:13 PM, Erik Anderson <erikerik <at> gmail.com> wrote:
On Thu, May 31, 2012 at 10:10 PM, Robert Nesius <nesius <at> gmail.com> wrote:
> If my memory is working correctly, the argument to VirtualHost must match
> the argument to a NameVirtualHost directive.

Exactly. Which is why both of those cases in my example code use *:8082.

:)

Oh - wasn't correcting you, Erik.  Just giving the original poster a heads up that those strings must fit up precisely. :)  I've puzzled over debugging named virtual host configurations where I thought things were logically the same only to realize they must be lexically identical. 

-Rob
 
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
Erik Anderson | 1 Jun 2012 05:20
Picon
Gravatar

Re: Getting apache to work...dumb question in here :)

On Thu, May 31, 2012 at 10:17 PM, Robert Nesius <nesius <at> gmail.com> wrote:
> Oh - wasn't correcting you, Erik.  Just giving the original poster a heads
> up that those strings must fit up precisely.

Got it. Nevermind then. :)

You're right, though, and I learned this the hard way early on in my
love/hate relationship with apache as well.
gregrwm | 1 Jun 2012 06:12

Re: Getting apache to work...dumb question in here :)

easier than NameVirtualHost:  VirtualDocumentRoot
eg:
#dynamic virtual hosts, see http://httpd.apache.org/docs-2.0/vhosts/mass.html
#                     and http://httpd.apache.org/docs-2.0/mod/mod_vhost_alias.html
#include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /web/%-2.0.%-1/pub

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
Craig Rosenblum | 1 Jun 2012 07:51
Picon
Gravatar

Re: Getting apache to work...dumb question in here :)

Having problems lol.


It keeps wanting me to specify a domain name, and i just want it to be just localhost:8082

For ease of folder permissions, i created a www folder inside my /home/username folder.

NameVirtualHost *:8082

<VirtualHost *:8082>
   ServerName localhost
   DocumentRoot /home/craig/www/wbm

   # add the following two lines if you want vhost-specific logging
   ErrorLog /ver/log/apache2/example.com-error
   CustomLog /var/log/apache2/example.com-access combined
</VirtualHost>


apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
Action 'start' failed.
The Apache error log may have more information.

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
Robert Nesius | 1 Jun 2012 07:58
Picon

Re: Getting apache to work...dumb question in here :)

I haven't tried this with localhost before. Try adding another alias to the machine in /etc/hosts and using that?  Looks like apache is having a hard time working backwards from the loopback ip to a hostname to match against your rule.  Hmm - come to think of it I think all of my VirtualHosts are in fact FQDNs, not singleton hostnames.  


-Rob


On Fri, Jun 1, 2012 at 12:51 AM, Craig Rosenblum <crosenblum <at> gmail.com> wrote:
Having problems lol.

It keeps wanting me to specify a domain name, and i just want it to be just localhost:8082

For ease of folder permissions, i created a www folder inside my /home/username folder.

NameVirtualHost *:8082

<VirtualHost *:8082>
   ServerName localhost
   DocumentRoot /home/craig/www/wbm

   # add the following two lines if you want vhost-specific logging
   ErrorLog /ver/log/apache2/example.com-error
   CustomLog /var/log/apache2/example.com-access combined
</VirtualHost>


apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
Action 'start' failed.
The Apache error log may have more information.


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
Craig Rosenblum | 1 Jun 2012 08:02
Picon
Gravatar

Re: Getting apache to work...dumb question in here :)

Hosts file already has localhost pointing to 127.0.0.1.


What are FQDN's or singletons?

On Fri, Jun 1, 2012 at 12:58 AM, Robert Nesius <nesius <at> gmail.com> wrote:
I haven't tried this with localhost before. Try adding another alias to the machine in /etc/hosts and using that?  Looks like apache is having a hard time working backwards from the loopback ip to a hostname to match against your rule.  Hmm - come to think of it I think all of my VirtualHosts are in fact FQDNs, not singleton hostnames.  

-Rob


On Fri, Jun 1, 2012 at 12:51 AM, Craig Rosenblum <crosenblum <at> gmail.com> wrote:
Having problems lol.

It keeps wanting me to specify a domain name, and i just want it to be just localhost:8082

For ease of folder permissions, i created a www folder inside my /home/username folder.

NameVirtualHost *:8082

<VirtualHost *:8082>
   ServerName localhost
   DocumentRoot /home/craig/www/wbm

   # add the following two lines if you want vhost-specific logging
   ErrorLog /ver/log/apache2/example.com-error
   CustomLog /var/log/apache2/example.com-access combined
</VirtualHost>


apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
Action 'start' failed.
The Apache error log may have more information.


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list



_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
Robert Nesius | 1 Jun 2012 08:14
Picon

Re: Getting apache to work...dumb question in here :)

FQDN = fully qualified domain name: 



singleton hostname (or, perhaps more accurately, just "hostname")  => foo 

-Rob


On Fri, Jun 1, 2012 at 1:02 AM, Craig Rosenblum <crosenblum <at> gmail.com> wrote:
Hosts file already has localhost pointing to 127.0.0.1.

What are FQDN's or singletons?

On Fri, Jun 1, 2012 at 12:58 AM, Robert Nesius <nesius <at> gmail.com> wrote:
I haven't tried this with localhost before. Try adding another alias to the machine in /etc/hosts and using that?  Looks like apache is having a hard time working backwards from the loopback ip to a hostname to match against your rule.  Hmm - come to think of it I think all of my VirtualHosts are in fact FQDNs, not singleton hostnames.  

-Rob


On Fri, Jun 1, 2012 at 12:51 AM, Craig Rosenblum <crosenblum <at> gmail.com> wrote:
Having problems lol.

It keeps wanting me to specify a domain name, and i just want it to be just localhost:8082

For ease of folder permissions, i created a www folder inside my /home/username folder.

NameVirtualHost *:8082

<VirtualHost *:8082>
   ServerName localhost
   DocumentRoot /home/craig/www/wbm

   # add the following two lines if you want vhost-specific logging
   ErrorLog /ver/log/apache2/example.com-error
   CustomLog /var/log/apache2/example.com-access combined
</VirtualHost>


apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts
[Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
Action 'start' failed.
The Apache error log may have more information.


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list



_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list



_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list <at> mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
John Gateley | 1 Jun 2012 15:19

Re: Getting apache to work...dumb question in here :)

Was the text copied and pasted in? Or typed? There's an interesting
item in the error messages:

> apache2: Could not reliably determine the server's fully qualified domain
> name, using 127.0.1.1 for ServerName
> [Fri Jun 01 00:51:20 2012] [warn] NameVirtualHost 127.0.0.1:0 has no
> VirtualHosts

The first error message says 127.0.1.1 the second says 127.0.0.1.
If you copied and pasted, I'd check the hosts file for a typo.

John

Gmane