Mailing List Archive

Logging issue
I have an issue where access messages and error messages are not logged to individual logs on a server hosting multiple public subdomains, eg 1.2.3.4/site1 and 1.2.3.4/site2, instead they end up in a central log. I would like to change the logging to files specific to each subdomain. This is a LAMP stack on CentOS 7 and running php 7.2.

Each subdomain, eg site1 and site2, has its own conf file. Below is an example called site1.conf which would control settings only for 1.2.3.4/site1. All conf files are in /etc/httpd/conf.d/.

<VirtualHost *:80>
        ServerAdmin xxx
        ServerName 1.2.3.4/site1
        DocumentRoot /var/www/html
        ErrorLog /var/log/httpd/site1-error.log
        CustomLog /var/log/httpd/site1-access.log combined
</VirtualHost>

1.2.3.4, of course, is not the real IP address but a placeholder.

I am missing something basic but what? Are the conf files incorrectly named?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
Is / valid in a ServerName directive? I thought it only included scheme,
host, and port?
Re: Logging issue [ In reply to ]
On 04/15/2021 08:50 PM, Jonathon Koyle wrote:
> Is / valid in a ServerName directive?  I thought it only included scheme, host, and port?

I see. I just checked and that seems to be correct, ie my approach does not work. I should go back to along what Dino suggested for another problem I have. I am changing a few things but he suggested something along the lines of:

<VirtualHost *:80>
        ServerAdmin xxx
        ServerName 1.2.3.4
        DocumentRoot /var/www/html/site1
        ErrorLog /var/log/httpd/site1-error.log
        CustomLog /var/log/httpd/site1-access.log combined

DirectoryIndex index.html index.php

<Directory "/site1">
Options none
AllowOverride all
Require all granted
</Directory>
</VirtualHost>

The conf files would still be in /etc/httpd/conf.d directory and still be called site1.conf, site2.conf etc.

Should that work?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
I'm not sure, but my understanding is that of you have multiple virtual
hosts on one machine, and they all listen on the same interfaces/ip
addresses then they have to have unique ServerName directive. If you have
duplicates, they will all be served by the first virtual host, with a
matching ServerName, read httpd.

I'm not really an expert, but you need to do something like:
A. Distinguish the servers (distinct hostname, IP, or port).
B. Have a single virtual host include the definitions for all paths as
locations or maybe directories, could possibly maintain separate files by
using the include directive, not sure.
C. Have a single virtual host that proxies to the other defined virtual
host - they still need a unique name, ip or port.
Re: Logging issue [ In reply to ]
> Date: Thursday, April 15, 2021 20:46:56 -0600
> From: Jonathon Koyle <litereader@gmail.com>
>
> I'm not sure, but my understanding is that of you have multiple
> virtual hosts on one machine, and they all listen on the same
> interfaces/ip addresses then they have to have unique ServerName
> directive. If you have duplicates, they will all be served by the
> first virtual host, with a matching ServerName, read httpd.
>
> I'm not really an expert, but you need to do something like:
> A. Distinguish the servers (distinct hostname, IP, or port).
> B. Have a single virtual host include the definitions for all paths
> as locations or maybe directories, could possibly maintain separate
> files by using the include directive, not sure.
> C. Have a single virtual host that proxies to the other defined
> virtual host - they still need a unique name, ip or port.

The OP may want to read up on apache name-/ip-based virtual host
configurations:

<https://httpd.apache.org/docs/current/vhosts/name-based.html>

If name-based each has to be a unique (resolvable) fqdn. If IP-based,
each has to have its own ipnumber.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/15/2021 11:00 PM, Richard wrote:
>
>> Date: Thursday, April 15, 2021 20:46:56 -0600
>> From: Jonathon Koyle <litereader@gmail.com>
>>
>> I'm not sure, but my understanding is that of you have multiple
>> virtual hosts on one machine, and they all listen on the same
>> interfaces/ip addresses then they have to have unique ServerName
>> directive. If you have duplicates, they will all be served by the
>> first virtual host, with a matching ServerName, read httpd.
>>
>> I'm not really an expert, but you need to do something like:
>> A. Distinguish the servers (distinct hostname, IP, or port).
>> B. Have a single virtual host include the definitions for all paths
>> as locations or maybe directories, could possibly maintain separate
>> files by using the include directive, not sure.
>> C. Have a single virtual host that proxies to the other defined
>> virtual host - they still need a unique name, ip or port.
> The OP may want to read up on apache name-/ip-based virtual host
> configurations:
>
> <https://httpd.apache.org/docs/current/vhosts/name-based.html>
>
> If name-based each has to be a unique (resolvable) fqdn. If IP-based,
> each has to have its own ipnumber.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
The OP, ie me, just read up on virtual host configuration. I now understand that it is not possible to have site1.conf and site2.conf as in my first e-mail where I wanted to access the different sites using 1.2.3.4/site1 and 1.2.3.4/site2 etc.

My reading suggests that instead accessing them as site1.1.2.3.4 and site2.1.2.3.4 should work with the following minimal conf files:

This is site1.conf:

<VirtualHost *:80>
        ServerAdmin xxx
        ServerName site1.1.2.3.4
        DocumentRoot /var/www/html/site1
        ErrorLog /var/log/httpd/site1-error.log
        CustomLog /var/log/httpd/site1-access.log combined

DirectoryIndex index.html index.php

<Directory "/site1">
Options none
AllowOverride all
Require all granted
</Directory>
</VirtualHost>

and this is site2.conf:

<VirtualHost *:80>
        ServerAdmin xxx
        ServerName site2.1.2.3.4
        DocumentRoot /var/www/html/site2
        ErrorLog /var/log/httpd/site2-error.log
        CustomLog /var/log/httpd/site2-access.log combined

DirectoryIndex index.html index.php

<Directory "/site2">
Options none
AllowOverride all
Require all granted
</Directory>
</VirtualHost>

Is my understanding now correct?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
> The OP, ie me, just read up on virtual host configuration. I now understand that it is not possible to have site1.conf and site2.conf as in my first e-mail where I wanted to access the different sites using 1.2.3.4/site1 and 1.2.3.4/site2 etc.
>
> My reading suggests that instead accessing them as site1.1.2.3.4 and site2.1.2.3.4 should work with the following minimal conf

ServerName should either be a hostname or an IP Address. Httpd is
going to compare this value to the HOST header in an HTTP request and
it should match what you are putting in host section of the URL For
example, if you owned example.com the ServerName directives would
site1.example.com and site2.example.com.

If you are just testing and don't have a domain or DNS, you could just
set SeverName to site1 and site2 and add entries in your host file
that map to the IP address

1.2.3.4 site1
1.2.3.4 site2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/16/2021 08:23 PM, Jonathon Koyle wrote:
>> The OP, ie me, just read up on virtual host configuration. I now understand that it is not possible to have site1.conf and site2.conf as in my first e-mail where I wanted to access the different sites using 1.2.3.4/site1 and 1.2.3.4/site2 etc.
>>
>> My reading suggests that instead accessing them as site1.1.2.3.4 and site2.1.2.3.4 should work with the following minimal conf
> ServerName should either be a hostname or an IP Address. Httpd is
> going to compare this value to the HOST header in an HTTP request and
> it should match what you are putting in host section of the URL For
> example, if you owned example.com the ServerName directives would
> site1.example.com and site2.example.com.
>
> If you are just testing and don't have a domain or DNS, you could just
> set SeverName to site1 and site2 and add entries in your host file
> that map to the IP address
>
> 1.2.3.4 site1
> 1.2.3.4 site2
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
I am using one external IP -address for now so you are saying the ServerName should be site1.a.b.c.d and site2.a.b.c.d, respectively, where a.b.c.d is the same?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/16/2021 08:51 PM, H wrote:
> On 04/16/2021 08:23 PM, Jonathon Koyle wrote:
>>> The OP, ie me, just read up on virtual host configuration. I now understand that it is not possible to have site1.conf and site2.conf as in my first e-mail where I wanted to access the different sites using 1.2.3.4/site1 and 1.2.3.4/site2 etc.
>>>
>>> My reading suggests that instead accessing them as site1.1.2.3.4 and site2.1.2.3.4 should work with the following minimal conf
>> ServerName should either be a hostname or an IP Address. Httpd is
>> going to compare this value to the HOST header in an HTTP request and
>> it should match what you are putting in host section of the URL For
>> example, if you owned example.com the ServerName directives would
>> site1.example.com and site2.example.com.
>>
>> If you are just testing and don't have a domain or DNS, you could just
>> set SeverName to site1 and site2 and add entries in your host file
>> that map to the IP address
>>
>> 1.2.3.4 site1
>> 1.2.3.4 site2
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
> I am using one external IP -address for now so you are saying the ServerName should be site1.a.b.c.d and site2.a.b.c.d, respectively, where a.b.c.d is the same?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
The four sites I have are loading fine - and have through most of this testing BUT, the logging always goes to the access and error log defined in the conf file first in the /etc/httpd/conf.d directory. I understand this is because they are loaded in alphabetical order and defaults to the first one mentioned unless a later match is found.

Could there be some /very/ basic configuration I have missed to enable/disable and that's why this occurring?

I should also mention that once I have all sites loading and logging done correctly, the next step is to load php-fpm to be able to use different php versions for some of the sites. However, until I have the logging working as intended I am not working on that...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
With due respect, please STOP abusing the mailing list and using it like a 'chat room'. Please RTM as it’s all a bit lazy otherwise.

> On 17 Apr 2021, at 01:57, H <agents@meddatainc.com> wrote:
>
> On 04/16/2021 08:51 PM, H wrote:
>> On 04/16/2021 08:23 PM, Jonathon Koyle wrote:
>>>> The OP, ie me, just read up on virtual host configuration. I now understand that it is not possible to have site1.conf and site2.conf as in my first e-mail where I wanted to access the different sites using 1.2.3.4/site1 and 1.2.3.4/site2 etc.
>>>>
>>>> My reading suggests that instead accessing them as site1.1.2.3.4 and site2.1.2.3.4 should work with the following minimal conf
>>> ServerName should either be a hostname or an IP Address. Httpd is
>>> going to compare this value to the HOST header in an HTTP request and
>>> it should match what you are putting in host section of the URL For
>>> example, if you owned example.com the ServerName directives would
>>> site1.example.com and site2.example.com.
>>>
>>> If you are just testing and don't have a domain or DNS, you could just
>>> set SeverName to site1 and site2 and add entries in your host file
>>> that map to the IP address
>>>
>>> 1.2.3.4 site1
>>> 1.2.3.4 site2
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>> I am using one external IP -address for now so you are saying the ServerName should be site1.a.b.c.d and site2.a.b.c.d, respectively, where a.b.c.d is the same?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
> The four sites I have are loading fine - and have through most of this testing BUT, the logging always goes to the access and error log defined in the conf file first in the /etc/httpd/conf.d directory. I understand this is because they are loaded in alphabetical order and defaults to the first one mentioned unless a later match is found.
>
> Could there be some /very/ basic configuration I have missed to enable/disable and that's why this occurring?
>
> I should also mention that once I have all sites loading and logging done correctly, the next step is to load php-fpm to be able to use different php versions for some of the sites. However, until I have the logging working as intended I am not working on that...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On April 17, 2021 8:57:22 AM EDT, angel Hall-Coulston <rammsteinium@me.com.INVALID> wrote:
>With due respect, please STOP abusing the mailing list and using it
>like a 'chat room'. Please RTM as it’s all a bit lazy otherwise.
>
>> On 17 Apr 2021, at 01:57, H <agents@meddatainc.com> wrote:
>>
>> On 04/16/2021 08:51 PM, H wrote:
>>> On 04/16/2021 08:23 PM, Jonathon Koyle wrote:
>>>>> The OP, ie me, just read up on virtual host configuration. I now
>understand that it is not possible to have site1.conf and site2.conf as
>in my first e-mail where I wanted to access the different sites using
>1.2.3.4/site1 and 1.2.3.4/site2 etc.
>>>>>
>>>>> My reading suggests that instead accessing them as site1.1.2.3.4
>and site2.1.2.3.4 should work with the following minimal conf
>>>> ServerName should either be a hostname or an IP Address. Httpd is
>>>> going to compare this value to the HOST header in an HTTP request
>and
>>>> it should match what you are putting in host section of the URL
>For
>>>> example, if you owned example.com the ServerName directives would
>>>> site1.example.com and site2.example.com.
>>>>
>>>> If you are just testing and don't have a domain or DNS, you could
>just
>>>> set SeverName to site1 and site2 and add entries in your host file
>>>> that map to the IP address
>>>>
>>>> 1.2.3.4 site1
>>>> 1.2.3.4 site2
>>>>
>>>>
>---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>
>>> I am using one external IP -address for now so you are saying the
>ServerName should be site1.a.b.c.d and site2.a.b.c.d, respectively,
>where a.b.c.d is the same?
>>>
>>>
>>>
>---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>> The four sites I have are loading fine - and have through most of
>this testing BUT, the logging always goes to the access and error log
>defined in the conf file first in the /etc/httpd/conf.d directory. I
>understand this is because they are loaded in alphabetical order and
>defaults to the first one mentioned unless a later match is found.
>>
>> Could there be some /very/ basic configuration I have missed to
>enable/disable and that's why this occurring?
>>
>> I should also mention that once I have all sites loading and logging
>done correctly, the next step is to load php-fpm to be able to use
>different php versions for some of the sites. However, until I have the
>logging working as intended I am not working on that...
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org

Well, if my problem is so easily solved, perhaps you can tell me what I am doing wrong? That would solve two issues, I no longer have to post questions on this topic and you could show that you are helpful and knowledgable... Obviously I have consulted other sources, including the documentation.

This is a user support list, is it not? And, you can always ignore posts... Perhaps i misremember, but was not your previous post a suggestion to switch to MAMP??

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
1) My previous answer to use MAMP was to a different person and problem, not yours.
2) Yes you’re quite correct, this IS a user support mailing list, BUT NOT A HELP DESK !
3) With DUE respect I am ONE GUY with little time to be providing free WORK to LARGE companies with employed sysadmins who I feel are being paid to ask questions of those who should have the job instead !
4) I have the absolute BEST equipment and software and the most secure website, running from the front room of my HOME. Yes, I serve my own site, code it all, system maintain it all and all from my home. I also run ALL of the available Mac Software, ALL of Adobe Software, SLACK, Live Chat, Registered Apple Business Chat… I know several computer languages, I program software…. Build Computers…. The list is endless…. Do you understand the effort this takes ? So you see, I’m probably in the top tier of the MOST TALENTED subscribers here: BUT… I ALSO look after my autistic son… medals must be scarce as I surely deserve one… and so please don’t imply that I couldn’t work out your 'problem'… I simply don’t have the time. I was merely calling a spade, a spade… Every time a game of ping-pong-back-and-forth-question-game happens… EVERYONE on the list get’s notifications ! Thank you and have a nice day !



"The road to hell is paved with 'good intentions' "

> On 17 Apr 2021, at 15:35, H <agents@meddatainc.com> wrote:
>
> On April 17, 2021 8:57:22 AM EDT, angel Hall-Coulston <rammsteinium@me.com.INVALID> wrote:
>> With due respect, please STOP abusing the mailing list and using it
>> like a 'chat room'. Please RTM as it’s all a bit lazy otherwise.
>>
>>> On 17 Apr 2021, at 01:57, H <agents@meddatainc.com> wrote:
>>>
>>> On 04/16/2021 08:51 PM, H wrote:
>>>> On 04/16/2021 08:23 PM, Jonathon Koyle wrote:
>>>>>> The OP, ie me, just read up on virtual host configuration. I now
>> understand that it is not possible to have site1.conf and site2.conf as
>> in my first e-mail where I wanted to access the different sites using
>> 1.2.3.4/site1 and 1.2.3.4/site2 etc.
>>>>>>
>>>>>> My reading suggests that instead accessing them as site1.1.2.3.4
>> and site2.1.2.3.4 should work with the following minimal conf
>>>>> ServerName should either be a hostname or an IP Address. Httpd is
>>>>> going to compare this value to the HOST header in an HTTP request
>> and
>>>>> it should match what you are putting in host section of the URL
>> For
>>>>> example, if you owned example.com the ServerName directives would
>>>>> site1.example.com and site2.example.com.
>>>>>
>>>>> If you are just testing and don't have a domain or DNS, you could
>> just
>>>>> set SeverName to site1 and site2 and add entries in your host file
>>>>> that map to the IP address
>>>>>
>>>>> 1.2.3.4 site1
>>>>> 1.2.3.4 site2
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>>
>>>> I am using one external IP -address for now so you are saying the
>> ServerName should be site1.a.b.c.d and site2.a.b.c.d, respectively,
>> where a.b.c.d is the same?
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>
>>> The four sites I have are loading fine - and have through most of
>> this testing BUT, the logging always goes to the access and error log
>> defined in the conf file first in the /etc/httpd/conf.d directory. I
>> understand this is because they are loaded in alphabetical order and
>> defaults to the first one mentioned unless a later match is found.
>>>
>>> Could there be some /very/ basic configuration I have missed to
>> enable/disable and that's why this occurring?
>>>
>>> I should also mention that once I have all sites loading and logging
>> done correctly, the next step is to load php-fpm to be able to use
>> different php versions for some of the sites. However, until I have the
>> logging working as intended I am not working on that...
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>
> Well, if my problem is so easily solved, perhaps you can tell me what I am doing wrong? That would solve two issues, I no longer have to post questions on this topic and you could show that you are helpful and knowledgable... Obviously I have consulted other sources, including the documentation.
>
> This is a user support list, is it not? And, you can always ignore posts... Perhaps i misremember, but was not your previous post a suggestion to switch to MAMP??
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Re: Logging issue [ In reply to ]
You are supposed to define ServerName with its specific name in each
Virtualhost, once there you define customlog and errorlog in each
virtualhost, then you have log for each virtualhost in every case.

If this is not what happens chances are you have a virtualhost
somewhere, with a greedy servername or not at all, catching all
requests.

Apache works like this, when a request comes it looks at the name and
delivers the request to the first match, if several names match, the
first one defined wins in the order they have been defined, if there
are several files involved (Include) IIRC they will be loaded
alphabetically.

In any case, use "apachectl -S" to check how your servernames are distributed.


El sáb, 17 abr 2021 a las 18:00, angel Hall-Coulston
(<rammsteinium@me.com.invalid>) escribió:
>
> 1) My previous answer to use MAMP was to a different person and problem, not yours.
> 2) Yes you’re quite correct, this IS a user support mailing list, BUT NOT A HELP DESK !
> 3) With DUE respect I am ONE GUY with little time to be providing free WORK to LARGE companies with employed sysadmins who I feel are being paid to ask questions of those who should have the job instead !
> 4) I have the absolute BEST equipment and software and the most secure website, running from the front room of my HOME. Yes, I serve my own site, code it all, system maintain it all and all from my home. I also run ALL of the available Mac Software, ALL of Adobe Software, SLACK, Live Chat, Registered Apple Business Chat… I know several computer languages, I program software…. Build Computers…. The list is endless…. Do you understand the effort this takes ? So you see, I’m probably in the top tier of the MOST TALENTED subscribers here: BUT… I ALSO look after my autistic son… medals must be scarce as I surely deserve one… and so please don’t imply that I couldn’t work out your 'problem'… I simply don’t have the time. I was merely calling a spade, a spade… Every time a game of ping-pong-back-and-forth-question-game happens… EVERYONE on the list get’s notifications ! Thank you and have a nice day !
>
>
>
> "The road to hell is paved with 'good intentions' "
>
> On 17 Apr 2021, at 15:35, H <agents@meddatainc.com> wrote:
>
> On April 17, 2021 8:57:22 AM EDT, angel Hall-Coulston <rammsteinium@me.com.INVALID> wrote:
>
> With due respect, please STOP abusing the mailing list and using it
> like a 'chat room'. Please RTM as it’s all a bit lazy otherwise.
>
> On 17 Apr 2021, at 01:57, H <agents@meddatainc.com> wrote:
>
> On 04/16/2021 08:51 PM, H wrote:
>
> On 04/16/2021 08:23 PM, Jonathon Koyle wrote:
>
> The OP, ie me, just read up on virtual host configuration. I now
>
> understand that it is not possible to have site1.conf and site2.conf as
> in my first e-mail where I wanted to access the different sites using
> 1.2.3.4/site1 and 1.2.3.4/site2 etc.
>
>
> My reading suggests that instead accessing them as site1.1.2.3.4
>
> and site2.1.2.3.4 should work with the following minimal conf
>
> ServerName should either be a hostname or an IP Address. Httpd is
> going to compare this value to the HOST header in an HTTP request
>
> and
>
> it should match what you are putting in host section of the URL
>
> For
>
> example, if you owned example.com the ServerName directives would
> site1.example.com and site2.example.com.
>
> If you are just testing and don't have a domain or DNS, you could
>
> just
>
> set SeverName to site1 and site2 and add entries in your host file
> that map to the IP address
>
> 1.2.3.4 site1
> 1.2.3.4 site2
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
> I am using one external IP -address for now so you are saying the
>
> ServerName should be site1.a.b.c.d and site2.a.b.c.d, respectively,
> where a.b.c.d is the same?
>
>
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
> The four sites I have are loading fine - and have through most of
>
> this testing BUT, the logging always goes to the access and error log
> defined in the conf file first in the /etc/httpd/conf.d directory. I
> understand this is because they are loaded in alphabetical order and
> defaults to the first one mentioned unless a later match is found.
>
>
> Could there be some /very/ basic configuration I have missed to
>
> enable/disable and that's why this occurring?
>
>
> I should also mention that once I have all sites loading and logging
>
> done correctly, the next step is to load php-fpm to be able to use
> different php versions for some of the sites. However, until I have the
> logging working as intended I am not working on that...
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
> Well, if my problem is so easily solved, perhaps you can tell me what I am doing wrong? That would solve two issues, I no longer have to post questions on this topic and you could show that you are helpful and knowledgable... Obviously I have consulted other sources, including the documentation.
>
> This is a user support list, is it not? And, you can always ignore posts... Perhaps i misremember, but was not your previous post a suggestion to switch to MAMP??
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


--
Daniel Ferradal
HTTPD Project
#httpd help at Freenode

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/17/2021 03:59 PM, Daniel Ferradal wrote:
> You are supposed to define ServerName with its specific name in each
> Virtualhost, once there you define customlog and errorlog in each
> virtualhost, then you have log for each virtualhost in every case.
>
> If this is not what happens chances are you have a virtualhost
> somewhere, with a greedy servername or not at all, catching all
> requests.
>
> Apache works like this, when a request comes it looks at the name and
> delivers the request to the first match, if several names match, the
> first one defined wins in the order they have been defined, if there
> are several files involved (Include) IIRC they will be loaded
> alphabetically.
>
> In any case, use "apachectl -S" to check how your servernames are distributed.
>
>
> El sáb, 17 abr 2021 a las 18:00, angel Hall-Coulston
> (<rammsteinium@me.com.invalid>) escribió:
>> 1) My previous answer to use MAMP was to a different person and problem, not yours.
>> 2) Yes you’re quite correct, this IS a user support mailing list, BUT NOT A HELP DESK !
>> 3) With DUE respect I am ONE GUY with little time to be providing free WORK to LARGE companies with employed sysadmins who I feel are being paid to ask questions of those who should have the job instead !
>> 4) I have the absolute BEST equipment and software and the most secure website, running from the front room of my HOME. Yes, I serve my own site, code it all, system maintain it all and all from my home. I also run ALL of the available Mac Software, ALL of Adobe Software, SLACK, Live Chat, Registered Apple Business Chat… I know several computer languages, I program software…. Build Computers…. The list is endless…. Do you understand the effort this takes ? So you see, I’m probably in the top tier of the MOST TALENTED subscribers here: BUT… I ALSO look after my autistic son… medals must be scarce as I surely deserve one… and so please don’t imply that I couldn’t work out your 'problem'… I simply don’t have the time. I was merely calling a spade, a spade… Every time a game of ping-pong-back-and-forth-question-game happens… EVERYONE on the list get’s notifications ! Thank you and have a nice day !
>>
>>
>>
>> "The road to hell is paved with 'good intentions' "
>>
>> On 17 Apr 2021, at 15:35, H <agents@meddatainc.com> wrote:
>>
>> On April 17, 2021 8:57:22 AM EDT, angel Hall-Coulston <rammsteinium@me.com.INVALID> wrote:
>>
>> With due respect, please STOP abusing the mailing list and using it
>> like a 'chat room'. Please RTM as it’s all a bit lazy otherwise.
>>
>> On 17 Apr 2021, at 01:57, H <agents@meddatainc.com> wrote:
>>
>> On 04/16/2021 08:51 PM, H wrote:
>>
>> On 04/16/2021 08:23 PM, Jonathon Koyle wrote:
>>
>> The OP, ie me, just read up on virtual host configuration. I now
>>
>> understand that it is not possible to have site1.conf and site2.conf as
>> in my first e-mail where I wanted to access the different sites using
>> 1.2.3.4/site1 and 1.2.3.4/site2 etc.
>>
>>
>> My reading suggests that instead accessing them as site1.1.2.3.4
>>
>> and site2.1.2.3.4 should work with the following minimal conf
>>
>> ServerName should either be a hostname or an IP Address. Httpd is
>> going to compare this value to the HOST header in an HTTP request
>>
>> and
>>
>> it should match what you are putting in host section of the URL
>>
>> For
>>
>> example, if you owned example.com the ServerName directives would
>> site1.example.com and site2.example.com.
>>
>> If you are just testing and don't have a domain or DNS, you could
>>
>> just
>>
>> set SeverName to site1 and site2 and add entries in your host file
>> that map to the IP address
>>
>> 1.2.3.4 site1
>> 1.2.3.4 site2
>>
>>
>> ---------------------------------------------------------------------
>>
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>> I am using one external IP -address for now so you are saying the
>>
>> ServerName should be site1.a.b.c.d and site2.a.b.c.d, respectively,
>> where a.b.c.d is the same?
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>>
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>> The four sites I have are loading fine - and have through most of
>>
>> this testing BUT, the logging always goes to the access and error log
>> defined in the conf file first in the /etc/httpd/conf.d directory. I
>> understand this is because they are loaded in alphabetical order and
>> defaults to the first one mentioned unless a later match is found.
>>
>>
>> Could there be some /very/ basic configuration I have missed to
>>
>> enable/disable and that's why this occurring?
>>
>>
>> I should also mention that once I have all sites loading and logging
>>
>> done correctly, the next step is to load php-fpm to be able to use
>> different php versions for some of the sites. However, until I have the
>> logging working as intended I am not working on that...
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>> Well, if my problem is so easily solved, perhaps you can tell me what I am doing wrong? That would solve two issues, I no longer have to post questions on this topic and you could show that you are helpful and knowledgable... Obviously I have consulted other sources, including the documentation.
>>
>> This is a user support list, is it not? And, you can always ignore posts... Perhaps i misremember, but was not your previous post a suggestion to switch to MAMP??
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
> --
> Daniel Ferradal
> HTTPD Project
> #httpd help at Freenode
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Yes, I (believe) I understand and find many examples how to configure virtual name hosts when you have a domain name. BUT, I have yet to find any examples where this works with /one/ single IP address rather than a domain name.

The former pertains to defining various virtual hosts such as site1.thisismydomain.com, site2.thisismydomain.com where the domain name is the same.

However, my current setup does not have a domain name associated with it, only an IP address. Thus the virtual hosts I am trying to work would be site1.aaa.bbb.ccc.ddd and site2.aaa.bbb.ccc.ddd where the IP address is the same.

Note that the sites are on an external server and accessed remotely, not on a local computer, and need to be accessed by multiple computers.

Is this perhaps not possible??


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
> Yes, I (believe) I understand and find many examples how to configure virtual name hosts when you have a domain name. BUT, I have yet to find any examples where this works with /one/ single IP address rather than a domain name.

This is because it's not applicable. The feature you're trying to use
allows the server to respond two different ways to two different
hostnames.
Without two or more hostnames it is meaningless.

>
> The former pertains to defining various virtual hosts such as site1.thisismydomain.com, site2.thisismydomain.com where the domain name is the same.
>
> However, my current setup does not have a domain name associated with it, only an IP address. Thus the virtual hosts I am trying to work would be site1.aaa.bbb.ccc.ddd and site2.aaa.bbb.ccc.ddd where the IP address is the same.

The configurations for these virtual hosts would only be used if the
client requests http://site1.aaa.bbb.ccc.ddd/* which will never
happen.

> Note that the sites are on an external server and accessed remotely, not on a local computer, and need to be accessed by multiple computers.
>
> Is this perhaps not possible??

Try the obscure ServerPath directive if you can't arrange for 2
hostnames to resolve to your IP address.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
> Date: Saturday, April 17, 2021 17:37:43 -0400
> From: H <agents@meddatainc.com>
>
> Yes, I (believe) I understand and find many examples how to
> configure virtual name hosts when you have a domain name. BUT, I
> have yet to find any examples where this works with /one/ single IP
> address rather than a domain name.
>
> The former pertains to defining various virtual hosts such as
> site1.thisismydomain.com, site2.thisismydomain.com where the domain
> name is the same.
>
> However, my current setup does not have a domain name associated
> with it, only an IP address. Thus the virtual hosts I am trying to
> work would be site1.aaa.bbb.ccc.ddd and site2.aaa.bbb.ccc.ddd where
> the IP address is the same.
>
> Note that the sites are on an external server and accessed
> remotely, not on a local computer, and need to be accessed by
> multiple computers.
>

That's because it doesn't:

> BUT, I have yet to find any examples where this works
> with /one/ single IP address rather than a domain name.

In the documentation I pointed to previously:

<https://httpd.apache.org/docs/current/vhosts/name-based.html>

the first line has ...

IP-based virtual hosts use the IP address of the connection to
determine the correct virtual host to serve. Therefore you need
to have a separate IP address for each host.

An IPnumber is just that -- (in IPv4) just the 4 octets, nothing
else. I.e., you can't append or prepend anything to that. [.a port
number can be included as indicated in the documentation, but that's
a separate issue.]

> ... I am trying to work would be site1.aaa.bbb.ccc.ddd


The apache server has to have *something* to use to differentiate
among the virtual hosts that are configured.

- In the name-based approach, the IP number is the same but
the FQDN (the "domain" doesn't have to be the same) will be
different for each virtual host (any number of FQDNs can point
to a single IPnumber).

- With IP-based virtual hosting, *each* virtual host has to have
a different IPnumber.

Please be certain to read the documentation carefully. When showing
examples of code or configurations you should include real examples
where you have not unnecessarily obscured what you are doing. With
something like a virtual host setup where how the first differs from
the second matters, you should show more than just the first.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/17/2021 06:09 PM, Eric Covener wrote:
>> Yes, I (believe) I understand and find many examples how to configure virtual name hosts when you have a domain name. BUT, I have yet to find any examples where this works with /one/ single IP address rather than a domain name.
> This is because it's not applicable. The feature you're trying to use
> allows the server to respond two different ways to two different
> hostnames.
> Without two or more hostnames it is meaningless.
>
>> The former pertains to defining various virtual hosts such as site1.thisismydomain.com, site2.thisismydomain.com where the domain name is the same.
>>
>> However, my current setup does not have a domain name associated with it, only an IP address. Thus the virtual hosts I am trying to work would be site1.aaa.bbb.ccc.ddd and site2.aaa.bbb.ccc.ddd where the IP address is the same.
> The configurations for these virtual hosts would only be used if the
> client requests http://site1.aaa.bbb.ccc.ddd/* which will never
> happen.
>
>> Note that the sites are on an external server and accessed remotely, not on a local computer, and need to be accessed by multiple computers.
>>
>> Is this perhaps not possible??
> Try the obscure ServerPath directive if you can't arrange for 2
> hostnames to resolve to your IP address.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Here is my current understanding after bloodying my forehead:

My ultimate goal is to be able to run different php apps each potentially requiring its unique php version using php-fpm. I would also like so separate access and error logs by app, ie app1-access.log, app2-access.log etc.

My original expectation was to call them through the same IP address followed by the directory of the app, ie aaa.bbb.ccc.ddd/app1, aaa.bbb.ccc.ddd/app2 etc. This does not work.

My understanding is now that:

- To use unique php versions would require separating the apps into individual VirtualHosts directives. Each VirtualHost directive can then call its unique php-fpm handler.

- I now understand this cannot be done using just an IP address in the VirtualHost directive followed by app1, app2 etc. A domain name must be used.

- There are workarounds which however do /not/ allow for different VirtualHost directives which my objective would requires, such as using ProxyPass, ProxyPass and Alias. Thus not a useable workaround.

Therefore, it seems I need to pivot and use a common domain name instead of IP address:

- Create multiple VirtualHost directives where the ServerName would be app1.domain.com, app2.domain.com. These can then be mapped to different directory trees.

- This should allow for using a different php-fpm handler in each VirtualHost directive.

Hopefully I made myself understandable but is my understanding correct?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
> Date: Saturday, April 17, 2021 20:14:02 -0400
> From: H <agents@meddatainc.com>
>
> My ultimate goal is to be able to run different php apps each
> potentially requiring its unique php version using php-fpm. I would
> also like so separate access and error logs by app, ie
> app1-access.log, app2-access.log etc.

...

> - To use unique php versions would require separating the apps into
> individual VirtualHosts directives. Each VirtualHost directive can
> then call its unique php-fpm handler.
>
> - I now understand this cannot be done using just an IP address in
> the VirtualHost directive followed by app1, app2 etc. A domain name
> must be used.

...

> Therefore, it seems I need to pivot and use a common domain name
> instead of IP address:


Your site-level logging issue and likely also your problem getting
the different versions of php to be invoked were probably both due to
your mal-configuration of the ServerName on the VirtualHost. When
things aren't configured correctly the first VirtualHost instance
will be used.

This is not required:

> use a common domain name

I.e., when using the name-based approach the host names used for the
ServerName directive don't have to be subdomains under a single
domainname. They can be any (resolvable) FQDN that points to your
IPnumber.





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/18/2021 12:14 PM, Richard wrote:
>> Date: Saturday, April 17, 2021 20:14:02 -0400
>> From: H <agents@meddatainc.com>
>>
>> My ultimate goal is to be able to run different php apps each
>> potentially requiring its unique php version using php-fpm. I would
>> also like so separate access and error logs by app, ie
>> app1-access.log, app2-access.log etc.
> ...
>
>> - To use unique php versions would require separating the apps into
>> individual VirtualHosts directives. Each VirtualHost directive can
>> then call its unique php-fpm handler.
>>
>> - I now understand this cannot be done using just an IP address in
>> the VirtualHost directive followed by app1, app2 etc. A domain name
>> must be used.
> ...
>
>> Therefore, it seems I need to pivot and use a common domain name
>> instead of IP address:
>
> Your site-level logging issue and likely also your problem getting
> the different versions of php to be invoked were probably both due to
> your mal-configuration of the ServerName on the VirtualHost. When
> things aren't configured correctly the first VirtualHost instance
> will be used.
>
> This is not required:
>
> > use a common domain name
>
> I.e., when using the name-based approach the host names used for the
> ServerName directive don't have to be subdomains under a single
> domainname. They can be any (resolvable) FQDN that points to your
> IPnumber.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Yes, you are correct and that's why I put the php-fpm issues aside since I could not get logging to work correctly. The plan is to understand and solve the latter before returning to the former.

You are also correct about the domain name and I was sloppy in my writing. I meant that in my situation it should suffice to have only one domain name and then access the different apps through app1.domain1.com, app2.domain1.com etc. I did not intend to mean that there is a restriction on having only one single domain name.

I have pointed one of my domain names to that server and am waiting for it to propagate down.

I also understand that I should be able to use curl to check /response header/ from app1.domain1.com, app2.domain1.com so I can make sure that the responses get matched to the correct VirtualHost directives etc. This would be "curl -I app1.domain1.com" and run either on the server itself or on an external computer?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
I'm intrigued but maybe it was said but I missed it.

You say you can´t do: "aaa.bbb.ccc.ddd/app1, aaa.bbb.ccc.ddd/app2¨

Well, you can, but in the same virtualhost, and you can even point to
multiple fpm pools for each

Did you try something like this? :

<Virtualhost *:port>
Servername ip # no paths here just the ip
Documentroot /path/to/docroot

<Directory /path/to/docroot/app1>
<FilesMatch ^/\.php>
SetHandler "proxy:unix:/path/to/app1.sock|fcgi://localhost/"
# or SetHandler "proxy:fcgi://localhost:9000"
</FilesMatch>


<Directory /path/to/docroot/app2>
<FilesMatch ^/\.php>
SetHandler "proxy:unix:/path/to/app2.sock|fcgi://localhost/"
# or SetHandler "proxy:fcgi://localhost:9001"
</FilesMatch>

...
</VirtualHost>

Or you really need two separate virtualhosts to ease the choice for
the user just define different ports for each virtualhost and the
corresponding Listen directives.

El dom, 18 abr 2021 a las 2:14, H (<agents@meddatainc.com>) escribió:
>
> On 04/17/2021 06:09 PM, Eric Covener wrote:
> >> Yes, I (believe) I understand and find many examples how to configure virtual name hosts when you have a domain name. BUT, I have yet to find any examples where this works with /one/ single IP address rather than a domain name.
> > This is because it's not applicable. The feature you're trying to use
> > allows the server to respond two different ways to two different
> > hostnames.
> > Without two or more hostnames it is meaningless.
> >
> >> The former pertains to defining various virtual hosts such as site1.thisismydomain.com, site2.thisismydomain.com where the domain name is the same.
> >>
> >> However, my current setup does not have a domain name associated with it, only an IP address. Thus the virtual hosts I am trying to work would be site1.aaa.bbb.ccc.ddd and site2.aaa.bbb.ccc.ddd where the IP address is the same.
> > The configurations for these virtual hosts would only be used if the
> > client requests http://site1.aaa.bbb.ccc.ddd/* which will never
> > happen.
> >
> >> Note that the sites are on an external server and accessed remotely, not on a local computer, and need to be accessed by multiple computers.
> >>
> >> Is this perhaps not possible??
> > Try the obscure ServerPath directive if you can't arrange for 2
> > hostnames to resolve to your IP address.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> Here is my current understanding after bloodying my forehead:
>
> My ultimate goal is to be able to run different php apps each potentially requiring its unique php version using php-fpm. I would also like so separate access and error logs by app, ie app1-access.log, app2-access.log etc.
>
> My original expectation was to call them through the same IP address followed by the directory of the app, ie aaa.bbb.ccc.ddd/app1, aaa.bbb.ccc.ddd/app2 etc. This does not work.
>
> My understanding is now that:
>
> - To use unique php versions would require separating the apps into individual VirtualHosts directives. Each VirtualHost directive can then call its unique php-fpm handler.
>
> - I now understand this cannot be done using just an IP address in the VirtualHost directive followed by app1, app2 etc. A domain name must be used.
>
> - There are workarounds which however do /not/ allow for different VirtualHost directives which my objective would requires, such as using ProxyPass, ProxyPass and Alias. Thus not a useable workaround.
>
> Therefore, it seems I need to pivot and use a common domain name instead of IP address:
>
> - Create multiple VirtualHost directives where the ServerName would be app1.domain.com, app2.domain.com. These can then be mapped to different directory trees.
>
> - This should allow for using a different php-fpm handler in each VirtualHost directive.
>
> Hopefully I made myself understandable but is my understanding correct?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


--
Daniel Ferradal
HTTPD Project
#httpd help at Freenode

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/20/2021 09:06 AM, Daniel Ferradal wrote:
> I'm intrigued but maybe it was said but I missed it.
>
> You say you can´t do: "aaa.bbb.ccc.ddd/app1, aaa.bbb.ccc.ddd/app2¨
>
> Well, you can, but in the same virtualhost, and you can even point to
> multiple fpm pools for each
>
> Did you try something like this? :
>
> <Virtualhost *:port>
> Servername ip # no paths here just the ip
> Documentroot /path/to/docroot
>
> <Directory /path/to/docroot/app1>
> <FilesMatch ^/\.php>
> SetHandler "proxy:unix:/path/to/app1.sock|fcgi://localhost/"
> # or SetHandler "proxy:fcgi://localhost:9000"
> </FilesMatch>
>
>
> <Directory /path/to/docroot/app2>
> <FilesMatch ^/\.php>
> SetHandler "proxy:unix:/path/to/app2.sock|fcgi://localhost/"
> # or SetHandler "proxy:fcgi://localhost:9001"
> </FilesMatch>
>
> ...
> </VirtualHost>
>
> Or you really need two separate virtualhosts to ease the choice for
> the user just define different ports for each virtualhost and the
> corresponding Listen directives.
>
> El dom, 18 abr 2021 a las 2:14, H (<agents@meddatainc.com>) escribió:
>> On 04/17/2021 06:09 PM, Eric Covener wrote:
>>>> Yes, I (believe) I understand and find many examples how to configure virtual name hosts when you have a domain name. BUT, I have yet to find any examples where this works with /one/ single IP address rather than a domain name.
>>> This is because it's not applicable. The feature you're trying to use
>>> allows the server to respond two different ways to two different
>>> hostnames.
>>> Without two or more hostnames it is meaningless.
>>>
>>>> The former pertains to defining various virtual hosts such as site1.thisismydomain.com, site2.thisismydomain.com where the domain name is the same.
>>>>
>>>> However, my current setup does not have a domain name associated with it, only an IP address. Thus the virtual hosts I am trying to work would be site1.aaa.bbb.ccc.ddd and site2.aaa.bbb.ccc.ddd where the IP address is the same.
>>> The configurations for these virtual hosts would only be used if the
>>> client requests http://site1.aaa.bbb.ccc.ddd/* which will never
>>> happen.
>>>
>>>> Note that the sites are on an external server and accessed remotely, not on a local computer, and need to be accessed by multiple computers.
>>>>
>>>> Is this perhaps not possible??
>>> Try the obscure ServerPath directive if you can't arrange for 2
>>> hostnames to resolve to your IP address.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>> Here is my current understanding after bloodying my forehead:
>>
>> My ultimate goal is to be able to run different php apps each potentially requiring its unique php version using php-fpm. I would also like so separate access and error logs by app, ie app1-access.log, app2-access.log etc.
>>
>> My original expectation was to call them through the same IP address followed by the directory of the app, ie aaa.bbb.ccc.ddd/app1, aaa.bbb.ccc.ddd/app2 etc. This does not work.
>>
>> My understanding is now that:
>>
>> - To use unique php versions would require separating the apps into individual VirtualHosts directives. Each VirtualHost directive can then call its unique php-fpm handler.
>>
>> - I now understand this cannot be done using just an IP address in the VirtualHost directive followed by app1, app2 etc. A domain name must be used.
>>
>> - There are workarounds which however do /not/ allow for different VirtualHost directives which my objective would requires, such as using ProxyPass, ProxyPass and Alias. Thus not a useable workaround.
>>
>> Therefore, it seems I need to pivot and use a common domain name instead of IP address:
>>
>> - Create multiple VirtualHost directives where the ServerName would be app1.domain.com, app2.domain.com. These can then be mapped to different directory trees.
>>
>> - This should allow for using a different php-fpm handler in each VirtualHost directive.
>>
>> Hopefully I made myself understandable but is my understanding correct?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>
Thank you for your suggestion. Although I would be the only person administering the server, splitting the settings for different apps into individual conf files would be for my convenience.

However, I do have a desire to have separate error and access files for each app and when I tried your suggestion with one single virtualhost conf file, apachectl configtest complained when I had both an ErrorLog and a CustomLog directive inside each Directory directive in the single VirtualHost conf file.

Hence, unless I misunderstood something, your suggestion is therefore unfortunately a no-go...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/18/2021 12:14 PM, Richard wrote:
>> Date: Saturday, April 17, 2021 20:14:02 -0400
>> From: H <agents@meddatainc.com>
>>
>> My ultimate goal is to be able to run different php apps each
>> potentially requiring its unique php version using php-fpm. I would
>> also like so separate access and error logs by app, ie
>> app1-access.log, app2-access.log etc.
> ...
>
>> - To use unique php versions would require separating the apps into
>> individual VirtualHosts directives. Each VirtualHost directive can
>> then call its unique php-fpm handler.
>>
>> - I now understand this cannot be done using just an IP address in
>> the VirtualHost directive followed by app1, app2 etc. A domain name
>> must be used.
> ...
>
>> Therefore, it seems I need to pivot and use a common domain name
>> instead of IP address:
>
> Your site-level logging issue and likely also your problem getting
> the different versions of php to be invoked were probably both due to
> your mal-configuration of the ServerName on the VirtualHost. When
> things aren't configured correctly the first VirtualHost instance
> will be used.
>
> This is not required:
>
> > use a common domain name
>
> I.e., when using the name-based approach the host names used for the
> ServerName directive don't have to be subdomains under a single
> domainname. They can be any (resolvable) FQDN that points to your
> IPnumber.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Follow-up question as I am again spending some time on this issue:

I read on one webpage that the locations (ie app1, app2 etc) have to have their own A records. Does that mean that I need to have app1.mydomain.com, app2.mydomain.com etc. registered individually with my domain registrar for each of them to get its own A record?

Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
> Date: Thursday, April 22, 2021 16:53:56 -0400
> From: H <agents@meddatainc.com>
>
> I read on one webpage that the locations (ie app1, app2 etc) have
> to have their own A records. Does that mean that I need to have
> app1.mydomain.com, app2.mydomain.com etc. registered individually
> with my domain registrar for each of them to get its own A record?

Yes, the sub-domains need A-records, that is done through the DNS
records you set up for the domain. Only the *domain* (e.g.,
example.com) is registered with the registrar.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
On 04/22/2021 06:02 PM, Richard wrote:
>> Date: Thursday, April 22, 2021 16:53:56 -0400
>> From: H <agents@meddatainc.com>
>>
>> I read on one webpage that the locations (ie app1, app2 etc) have
>> to have their own A records. Does that mean that I need to have
>> app1.mydomain.com, app2.mydomain.com etc. registered individually
>> with my domain registrar for each of them to get its own A record?
> Yes, the sub-domains need A-records, that is done through the DNS
> records you set up for the domain. Only the *domain* (e.g.,
> example.com) is registered with the registrar.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Great, thank you. I just did that and another piece of knowledge fell into place... :-) I will let it propagate overnight and look at it again tomorrow.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Logging issue [ In reply to ]
> Date: Thursday, April 22, 2021 20:24:02 -0400
> From: H <agents@meddatainc.com>
>
> On 04/22/2021 06:02 PM, Richard wrote:
>>> Date: Thursday, April 22, 2021 16:53:56 -0400
>>> From: H <agents@meddatainc.com>
>>>
>>> I read on one webpage that the locations (ie app1, app2 etc) have
>>> to have their own A records. Does that mean that I need to have
>>> app1.mydomain.com, app2.mydomain.com etc. registered individually
>>> with my domain registrar for each of them to get its own A record?
>> Yes, the sub-domains need A-records, that is done through the DNS
>> records you set up for the domain. Only the *domain* (e.g.,
>> example.com) is registered with the registrar.
>>
> Great, thank you. I just did that and another piece of knowledge
> fell into place... :-) I will let it propagate overnight and look
> at it again tomorrow.
>

DNS is a query and cache system, records don't "propagate". If done
properly, once you have entered a record and the zone has been loaded
a query should result in an accurate answer. "Properly" includes
bringing down the TTL if you are changing details on an existing
record, and of course updating the serial so that secondaries know to
update.




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

1 2  View All