How to check LAMP is installed or not? - ssh

I am newbie in vps. I installed centos 6.5 64bit. one hour ago and installed Apache, php, mysql successfully. now I have to install phpmyadmin. It requires something called LAMP. I don't know if LAMP is already installed by default with centos or I have to manually install it. What is the ssh command to check it if LAMP installed or just answer yes or no.
UPDATE:
[understood]
That blogger confused me by separating LAMP with comma.

If LAMP was correctly installed, i.e., PATH is already set for php,mysql and apache2, then run following commands from terminal:-
php -v // Return PHP version
apache2 -v // Returns apache version
mysql --version // Returns mysql version
if all of the above command returns their respective versions, then it means LAMP is installed.
BUT if it doesn't then there might be two cases:-
1) LAMP might be installed but is not added to path.
2) LAMP is not installed, Install it.
As for the first case, if it is installed but not runnable from terminal, then just run following commands to see where LAMP components are installed:-
1) Find file with name "apache2" in your pc. It will return list of path where a file name called "apache2" exists. You can then cross examine it further.
sudo find / -name apache2
2) Run the above same command to find file "mysql" and follow the same procedure further.
sudo find / -name mysql
3) For PHP:-
sudo find / -name php

LAMP stands for Linux, apache, Mysql, PHP, if you've installed apache, mysql and PHP correctly on a linux system you have LAMP already set up.

If you want to check whether the above mentioned dependecies are installed or not
To check whether php is installed or not
php5 -v
For Apchae
/usr/sbin/apache2 -V
If any of the mentioned dependencies are not install and you want to install the LAMP use the following command,
sudo apt-get install lamp-server^

Related

Check the version of Apache web server on Suse Linux ES 12

does anyone know how I could check the version of apache2 web server on Linux Suse Enterprise Server 12?
I tried httpd -v and apache2 -v but those options don't work on this version of linux.
I would like to update the apache server, but unfortunately I have not worked with this version of linux until now.
Thanks in advance for your help.
Just check the installed rpm package by
rpm -q -i apache2
and also check the changelog of the package by
rpm -q --changelog apache2
because current security fixes are backported to the originally released version.

Set php7 location to Apache (Macports)

I've installed php7 via MacPorts to the El Capitan using this tutorial.
Is it possible to execute php7 with default OSX Apache (not Apache from MacPorts)? If yes, where should I set php7 location in Apache?
MacPorts will build all modules only for the Apache httpd provided by MacPorts itself and not for the system version.
See the notes for the php70-apache2handler port how you can enable the module:
$ port notes php70-apache2handler
php70-apache2handler has the following notes:
If this is your first install, you need to enable php70-apache2handler in your web server.
To enable php70-apache2handler, run:
cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n php7 mod_php70.so
If someone had the same problem, this tutorial helped to solve my problem.

How to Install mod_wsgi in a virtual Environement

Introduction
I have a Web API writtten in python 3 and it uses flask. The code runs fine when I run the web API from the terminal and it is hosted from the following line in the code.
if __name__ == '__main__':
app.run(host='', port=8010, debug='true')
Current Situation
The code runs perfectly and I want to set it up on an Apache Server. However the Apache server already has websites that were built using python 2 and need mod_wsgi for python 2.
I looked up if there was a way to set up both mod-wsgi on the apache server but according to the following source you can't
mod_wsgi for Python 2 as well as Python 3 on one Apache server
Attempt at a solution
I 'm trying to install mod-wsgi into a virtual environment. I downloaded the package from here and tried to install it into the environment after activating it.
I ran sudo python setup.py install from the terminal but I got the error below
File "setup.py", line 139, in
'missing Apache httpd server packages.' % APXS)
RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.
So I opened the Read Me file that was part of zipped package and found the following
If you wish to use a version of Apache which is installed into a non
standard location, you can set and export the APXS environment
variable to the location of the Apache apxs script for your Apache
installation before performing the installation.
Note that nothing will be copied into your Apache installation at this
point. As a result, you do not need to run this as the root user
unless installing it into a site wide Python installation rather than
a Python virtual environment.
To verify that the installation was successful, run the
mod_wsgi-express script with the start-server command::
mod_wsgi-express start-server
It seems to tackle my situation since Apache is not installed in the virtual environment that I'm running the command from but I have no idea how to do it
I presume they are talking about the setup.py file and that I should change the path but I do not know how to do it syntax wise or where my APXS script is located.
Here is snippet of the code that I think needs to be modified
APXS = os.environ.get('APXS')
WITH_HTTPD_PACKAGE = False
if APXS is None:
APXS = find_program(['mod_wsgi-apxs'],
paths=[os.path.dirname(sys.executable)])
if APXS is not None:
WITH_HTTPD_PACKAGE = True
if APXS is None:
APXS = find_program(['mod_wsgi-apxs', 'apxs2', 'apxs'],
'apxs', ['/usr/sbin', os.getcwd()])
elif not os.path.isabs(APXS):
APXS = find_program([APXS], APXS, ['/usr/sbin', os.getcwd()])
if not WITH_TARBALL_PACKAGE:
if not os.path.isabs(APXS) or not os.access(APXS, os.X_OK):
raise RuntimeError('The %r command appears not to be installed or '
'is not executable. Please check the list of prerequisites '
'in the documentation for this package and install any '
'missing Apache httpd server packages.' % APXS)
The Question
I'm doing all of this on a server running Ubuntu 12.04LTS if it helps. My question at the end are the following
Where is the APXS located usually in Ubuntu
How do I change the code snippet to make use the APXS script there
Thank you so much for Your time
Sorry for the inconvenience
Turns out I forgot to install APXS on my apache server. I simply ran the code from the terminal and it worked
sudo apt-get apache2-threaded-dev
Update
For Ubuntu 18 its (thank you #MagicLAMP)
sudo apt-get install apache2-dev
For Centos 7: (thank you #User)
yum install httpd-devel
For Centos 7:
yum install httpd-devel

Remove phpmyadmin from Centos7

I did a general yum install command on my Centos7 server, and got phpmyadmin 4.4 - I want version 4.6
How do I cleanly remove phpmyadmin version 4.4 before installing the new version? I am running php7, and the phpmyadmin 4.4 added many php5.4 files, some of which conflict with my php installation.
Remove phpmyadmin:
yum remove phpmyadmin
Be aware:
It will not delete the /etc/httpd/conf.d/phpMyAdmin.conf file but it will change it to phpMyAdmin.conf.rpmsave
Same for /etc/phpMyAdmin/config.inc.php.rpmsave
I you are using centos 7 I believe you are using apache web server Apache/2.4.6 (CentOS). I usually provision centos with the epel repositories.
the version that is installed by default (using the terminal is 4.4.15)
when you install phpmyadmin using terminal it creates a file in /etc/httpd/conf.d/phpMyAdmin.conf
If you take a closer look to this file it has the php configuration where the phpmyadmin files are located in the server. (/usr/share/phpMyAdmin).
Phpmyadmin configuration
this are possible solutions:
1) download the version that you would like to have (phpMyadmin 4.6) and download it to the root of the web folder (var/www/html/phpMyAdmin) restart the server and you will be able to access phpmyadmin directly
2) you can download the php source from phpmyadmin official page to this folder /usr/share/phpMyadmin4.6
2.1) edit the configuration file to point to 4.6 php myadmin /etc/httpd/conf.d/phpMyAdmin.conf.
2.2) restar the server and try http://ip-to-server/phpMyAdmin
Hope it helps
There are two ways to delete phpMyadmin
yum remove phpMyAdmin.noarch
remove phpMyAdmin
Or
rpm -qa |grep phpMyAdmin
rpm -e rpm -e phpMyAdmin-4.4.15.10-2.el7.noarch
Remove phpMyAdmin with rpm

Installing Apache server

How to install Apache server on your computer? I have downloaded the file from here: http://httpd.apache.org/download.cgi but there is no installation file in this archive. What file should I be looking for or is there some other way to go about it completely and I am being totally wrong?
You could read the documentation : http://httpd.apache.org/docs/2.4/install.html
If you're Windows user, I would like to suggest you to install XAMPP from
(apache, mysql and php5)
https://www.apachefriends.org/download.html
If you're Linux user, type following command (Ubuntu or Debian)
$ sudo apt-get install apache2