How to find Apache version?

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

How to find Apache version?

Postby jfbart » 07. June 2016 22:44

I'm trying to set up Apache VirtualHosts so I can use Drupal multi-site. I'm having a lot of trouble because the online instructions I'm reading are for multiple platforms, out of date, and sometimes poorly written.

The first problem, stalling the whole effort, is that configuring Apache requires knowing which configuration file to edit. One document says that the configuration file for Apache on Mac is /etc/apache2/httpd.conf. But I have XAMPP installed and it appears to be using Applications/XAMPP/xamppfiles/etc/httpd.conf. These are different files. Which should I be using?

If I use the httpd -v command in Terminal, the output is "Server version: Apache/2.2.29 (Unix)". Doesn't this mean I should be using /etc/apache2/httpd.conf?

So now I'm suspicious that the httpd -v command isn't giving me the correct answer. If I could directly "ask" Apache which version is actually running, that would be a more authoritative answer. But I can't figure out how to get to the Apache "splash" screen. :roll: :twisted: :oops:

Any ideas?


XAMPP 5.6.20 MacOS X 10.8.5
jfbart
 
Posts: 2
Joined: 07. June 2016 21:58
XAMPP version: 5.6.20
Operating System: Mac OS X 10.8.5

Re: How to find Apache version?

Postby Nobbie » 08. June 2016 10:32

jfbart wrote: Which should I be using?


It depends on what you have installed. Did you install Xampp or did you install Apache somehow from OSX? You should know that.

jfbart wrote: If I use the httpd -v command in Terminal, the output is "Server version: Apache/2.2.29 (Unix)". Doesn't this mean I should be using /etc/apache2/httpd.conf?


That does not mean anything, but maybe you did not install Xampp, as Xampp installs a newer Apache release. Otherwise you may have an older Xampp. Dont you remember what you installed??

jfbart wrote: So now I'm suspicious that the httpd -v command isn't giving me the correct answer. If I could directly "ask" Apache which version is actually running, that would be a more authoritative answer. But I can't figure out how to get to the Apache "splash" screen. :roll: :twisted: :oops:


There is no Apache splash screen, what do you mean by that? Apache is a server, not a GUI.

jfbart wrote: XAMPP 5.6.20 MacOS X 10.8.5


Is it that what you installed? Due to Apache Friends Documentation, Xampp 5.6.20 installs Apache 2.4.x. So if you receive "Server version: Apache/2.2.29 (Unix)" that means, that you have screwed up your system, as you installed Apache twice. Did you succeed to start Apache from Xampp?? Enter "which httpd" in a terminal, what is the output?
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: How to find Apache version?

Postby jfbart » 08. June 2016 21:47

Thank you for your response, Nobbie. Let me start by answering your questions:

Did you install Xampp or did you install Apache somehow from OSX?

Don't you remember what you installed?


I installed Xampp 5.6.20 about a year ago and have been using it successfully since that time. I did not "install" Apache from OS X. OS X ships with the Apache files pre-installed - that is the source of the confusion here. Installing Xampp apparently installs a second set of Apache files.

To use the Apache shipped with OS X, one must configure it and then start it with the apachectl command. I have not done that. To start the Apache in Xampp, I use the Application Manager that ships with Xampp. This works great.

Enter "which httpd" in a terminal, what is the output?

/usr/sbin/httpd

There is no Apache splash screen, what do you mean by that? Apache is a server, not a GUI.

I've been Web programming for about 20 years - I understand what a server is.

---------------------------------------------
Let me restate the question: I am successfully using XAMPP 5.6.20. I want to start using the Apache VirtualHost feature, which requires changing the Apache configuration file. If I look for that file, I find two different files: one is /etc/apache2/httpd.conf and the other is /Applications/XAMPP/xamppfiles/etc/httpd.conf. Which one should I modify?

Since one configuration file is in an apache2 folder, I thought that asking Apache what version is actually running would point to the configuration file to modify. I naively thought that the Apache version in Xampp might be 1.3.x or something. I see now that that is obviously not the case: both the Apache shipped with OS X and the Apache running in Xampp are 2.x.x.

So the answer to my original question is now obvious: since I'm successfully running Xampp and have not "started" the Apache shipped with OS X, I should configure Xammp's own Apache configuration file in /xamppfiles/etc/httpd.conf.

--------------------------------------
Further color on finding an application's version number: One could just look for the version number in the application's file-system metadata, but this may not be accurate in the case where there are multiple copies of the application in the file system. So the most reliable way is to ask the running application itself what its version number is.

For example, if I want an accurate answer to the question "what version of PHP am I running?" I simply execute the PHPInfo() function. It answers "PHP Version was 5.6.14."

Note that the "httpd -v" command and the "which httpd" command apparently just get the version number from the file system - they do not get the version number by asking the running copy of Apache (those commands work whether Apache is running or not).

Xampp's Application Manager does not have a feature that indicates what version of Apache Xampp contains and is launching. So in the original question, I was asking "how do I ask the running copy of Apache what version it is?" A splash screen would be a common way to find out, but as you say, Apache doesn't have one.
jfbart
 
Posts: 2
Joined: 07. June 2016 21:58
XAMPP version: 5.6.20
Operating System: Mac OS X 10.8.5

Re: How to find Apache version?

Postby Nobbie » 09. June 2016 13:10

jfbart wrote:If I look for that file, I find two different files: one is /etc/apache2/httpd.conf and the other is /Applications/XAMPP/xamppfiles/etc/httpd.conf. Which one should I modify?


In default configuration, Apache uses Port 80 for http and 443 for https. Each Port can only used by one active process. Therefore you can only run one of your both Apaches - edit that files, which matches to the running Apache. To be safe, you should also de-install the "unused" version (either the OSX Apache installation or the Xampp Installation).

jfbart wrote:I naively thought that the Apache version in Xampp might be 1.3.x or something. I see now that that is obviously not the case: both the Apache shipped with OS X and the Apache running in Xampp are 2.x.x.


Apache 1.3.x is extremely old, Xampp always ships the newest releases. As i told, youre Xampp Installation already ships Apache 2.4.x

jfbart wrote:So the answer to my original question is now obvious: since I'm successfully running Xampp and have not "started" the Apache shipped with OS X, I should configure Xammp's own Apache configuration file in /xamppfiles/etc/httpd.conf.


Thats what I assume as well, but to be honest, you never stated which Apache you are running. You cannot find out that by simply typing "httpd -v" in a terminal, you should remember whether you started Xampp or the OSX Apache.

jfbart wrote:Further color on finding an application's version number: One could just look for the version number in the application's file-system metadata, but this may not be accurate in the case where there are multiple copies of the application in the file system. So the most reliable way is to ask the running application itself what its version number is.


Simply provoke a runtime error for "localhost" (that is your local server, where Apache is listening), for example enter http://localhost/blablablbalba into your browser. You should receive an Error 404 and in the bottom line an extended information from your Apache server. When i do so on my Linux PC, the bottom line says "Apache/2.4.17 (Unix) OpenSSL/1.0.1p mod_perl/2.0.8-dev Perl/v5.16.3". Or run a phpinfo() (a function call from PHP, which shows extended statistics) on your local server, it shows up everything you need to know and even more. Probably you meant "splash screen" when you are thinking of simply http://localhost

jfbart wrote:For example, if I want an accurate answer to the question "what version of PHP am I running?" I simply execute the PHPInfo() function. It answers "PHP Version was 5.6.14."


OMG... exactly the same phpinfo() tells you the Apache release, simply watch out for the PHP Variable _SERVER["SERVER_SOFTWARE"]...

jfbart wrote:Note that the "httpd -v" command and the "which httpd" command apparently just get the version number from the file system - they do not get the version number by asking the running copy of Apache (those commands work whether Apache is running or not).


Exactly. But I simply wanted to know if you have installed Apache twice (what seems to be the case).
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 4 guests