LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2006, 09:25 AM   #1
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Rep: Reputation: 30
Apache version


In Windows, Apache -v will give
Code:
Server version: Apache/2.0.58
Server built:   Apr 29 2006 17:47:10
What do I have to enter to get this in Linux ?

I tried many options with httpd, apache - but shows command not found.

Thanks
 
Old 06-22-2006, 10:04 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
Try, "apachectl -v". On my system I get
Code:
Server version: Apache/2.2.0
Server built:   May 26 2006 07:34:53
 
Old 06-22-2006, 10:18 AM   #3
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
Code:
-bash: apachectl: command not found
Im pretty sure its Apache 2.x because it shows Apache 2.0 handler in phpinfo - but Im trying to figure out the exact version.
 
Old 06-22-2006, 01:09 PM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
If its not in your path, use "find" or "locate" to search for its location and then run it using the full path e.g. on my system its in /usr/local/apache2/bin.
 
Old 06-22-2006, 07:53 PM   #5
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
apachectl -v doesn't tell me my apache version. However, you can find the exact version with a GET method like so:

Code:
telnet localhost 80
GET / HTTP/1.1
<hit enter here>
Now, you should see information regarding your apache server along with the documentroot page that you just requested.

-twantrd
 
Old 06-23-2006, 12:31 PM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
Another way is to use php. Just do
PHP Code:
print phpinfo(); 
If you look at the apache handler section, it tells you the version of apache you are running.
 
Old 06-23-2006, 01:09 PM   #7
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
Code:
HTTP/1.1 400 Bad Request
Date: Fri, 23 Jun 2006 17:08:16 GMT
Server:
Content-Length: 292
Connection: close
Content-Type: text/html; charset=iso-8859-1
phpinfo() shows only Apache 2 handler - not the exact version number.
 
Old 06-23-2006, 01:27 PM   #8
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
When I use phpinfo() on my Suse 10.1 box and go to the apache2handler section, I get
Code:
Apache/2.2.0 (Unix) DAV/2 PHP/5.1.4
On my CentOS 4.3 (RHEL 4.3) server, apachectl shows the version number of apache as follows
Code:
[root@mulberry ~]# apachectl -v
Server version: Apache/2.0.52
Server built:   Jan  5 2006 12:31:31
[root@mulberry ~]#

Last edited by reddazz; 06-23-2006 at 01:32 PM.
 
Old 06-23-2006, 02:09 PM   #9
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
Apparently, I had to give the full path /usr/sbin/apachectl -v to get it to work.
Shows Server version: Apache/2.0.51
Thanks.

BTW, reddazz, you are using Apache 2.2.x and not 2.0.x on your Suse 10.1 box which is probably why you are getting the version number in phpinfo. So far I havent seen the version number for Apache 2.0.x in phpinfo.
On my phpinfo page, Apache Version shows blank while Apache API Version shows 20020903.
 
Old 10-05-2006, 05:30 AM   #10
prasanna_cpw
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Rep: Reputation: 0
Hi i am using apache vertion 3.Apache/2.0.40 which does not support html page to post with the server
after that I install apache 1.3.33 which support posting just by submitng the page but getting error message

Method Not Allowed

The requested method POST is not allowed for the URL /~extranet/ut/frt_tmp.php.

pls help me
 
Old 10-05-2006, 05:45 AM   #11
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
I think you're talking about html pages not parsing PHP code.
Add this line to httpd.conf file or to your .htaccess file
Code:
AddType application/x-httpd-php .htm
 
Old 10-05-2006, 10:36 AM   #12
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
Code:
httpd2 -V
Works on my suse (from any dir)(as root).
It gives the apache version.
 
Old 10-09-2006, 02:31 AM   #13
prasanna_cpw
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Rep: Reputation: 0
I did what you asked me to do

AddType application/x-httpd-php .htm
in httpd.con file and restart the httpd server


but problem remian same

pls help me
 
Old 10-09-2006, 03:11 AM   #14
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
@prasanna_cpw: which linux distribution are you on?
- apache 1.33 is somewhat older. You could update it (not essential for your problem maybe).
- I'd say your php might not be installed (or configured) correctly.
If you have rpm packages on your distro do this to check what you have installed for php:
Code:
$ rpm -qa |grep php
php4-gd-4.4.0-6.18
apache2-mod_php4-4.4.0-6.18
php4-mysql-4.4.0-6
php4-4.4.0-6.18
php4-devel-4.4.0-6.18
php4-zlib-4.4.0-6
php4-session-4.4.0-6.18
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
which version of apache should i use? seow_ming Linux - Networking 3 09-12-2005 08:47 AM
how to know the apache version skyblue Linux - Newbie 16 05-25-2005 09:20 AM
how to know apache version? varala_kanth Linux - Newbie 1 06-14-2004 01:03 AM
Apache Version red118a Linux - General 1 02-02-2004 01:14 PM
How do I Install the new version of Apache? TransAmJugo Linux - Newbie 5 08-13-2003 05:11 PM


All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration