views:

128

answers:

3

Hello,

I am not much into linux, so can any body please guide me how can I check whether the apache is installed with php and mysql on ubuntu server through ssh. Also if installed in which directory.

And if in case some other package is installed like lighttpd.

Thank You.

+3  A: 

Type aptitude to start the package manager. There you can see which applications are installed.

Use / to search for packages. Try searching for apache2 and php5 (or whatever versions you want to use). If they are installed, they should be bold and have an i in front of them. If they are not installed (p in front of the line) and you want to install them (and you have root permissions), use + to select them and then g (twice) to install it.

Word of warning: Before doing that, it might be wise to have a quick look at some aptitude tutorial on the web.

Heinzi
It shows perl python etc but not php and apache does this mean it is not installed?
Shishant
See above, I've extended my answer.
Heinzi
Thanks a lot apache was not installed. I will find some tutorial on setting up a ubuntu server
Shishant
A: 

You could inspect the available apache2 modules:

$ ls /usr/lib/apache2/modules/

Or try to enable the php module, if you have the appropriate access:

$ a2enmod
Which module would you like to enable?
Your choices are: actions alias asis ...
... php5 proxy_ajp proxy_balancer proxy_connect ..
The MYYN
After trying this i get no such file or directory
Shishant
This means apache2 is not installed. Use sudo aptitude install apache2 to install it.
Peter Stuifzand
+1  A: 

Another way to find out if a program is installed is by using the which command. It will show the path of the program you're searching for. For example if when your searching for apache you can use the following command:

$ which apache2ctl
/usr/sbin/apache2ctl

And if you searching for PHP try this:

$ which php
/usr/bin/php
Peter Stuifzand
theres no response when i try this
Shishant
That means that those programs are not installed or are called by a different name. But if you use Ubuntu, this should work. Also if the first one (for apache) doesn't work, probably the second also won't work.
Peter Stuifzand