Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have Linux Mint on my computer but I don't know how to find out whether Apache2 is on it or where it is actually installed. I run my web browser (PHP installed) with http://localhost as a URL and it works.

share|improve this question

migrated from stackoverflow.com Feb 9 '12 at 14:14

This question came from our site for professional and enthusiast programmers.

    
what do you mean by PHP installed? –  onemach Feb 9 '12 at 14:06
    
How is that related to c, c# or unix? –  ThiefMaster Feb 9 '12 at 14:08

4 Answers 4

up vote 10 down vote accepted

I would recommend

dpkg --get-selections | grep apache

It lists all installed packages that contain "apache" in their name. For example:

apache2                                         install
apache2-doc                                     install
apache2-mpm-prefork                             install
apache2-utils                                   install
apache2.2-bin                                   install
apache2.2-common                                install
libapache2-mod-php5                             install
libapache2-svn                                  install

It indicates that the package apache2 is installed on the system.

Another approach, to find any running HTTP daemon on the default port would be:

sudo lsof -nPi | grep ":80 (LISTEN)"

Which lists something like:

apache2    1026     root    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
apache2    3966 www-data    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
apache2    4014 www-data    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
apache2    4015 www-data    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
apache2    4016 www-data    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
share|improve this answer

As I recall, Mint is based on Ubuntu, so you should be able to check apt-cache policy apache2:

$ apt-cache policy apache2
apache2:
  Installed: (none)
  Candidate: 2.2.20-1ubuntu1.1
  Version table:
     2.2.20-1ubuntu1.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ oneiric-security/main amd64 Packages
     2.2.20-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages

In this case, you can see it's not installed on my system. If you haven't asked for it to be installed, it's probably not -- I doubt it's part of the default distribution.

share|improve this answer

Just do a which httpd as user root.

share|improve this answer
    
Afraid to say, but on Mint (a Debian derivative) it would be apache or apache2, but not httpd ... –  0xC0000022L Feb 9 '12 at 14:12

Try the which command:

# which apache2

In my experience, the Apache binary is located in /usr/sbin on most installations.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.