• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to install lamp on centos 7.5

  • 00:18 rpm -q centos-release
  • 00:31 yum install httpd
  • 01:43 yum install mariadb mariadb-server
  • 02:28 yum install php php-mbstring php-mcrypt php-gd php-mysql php-zip php-soap php-ldap php-curl
  • 02:47 mysql_secure_installation
  • 03:57 vim /var/www/html/info.php
  • 04:24 systemctl restart httpd
5438

Installation of lamp setup in centos 7.5

Check the centos version by using this command

[root@linuxhelp ~]# rpm -q centos-release
centos-release-7-5.1804.el7.centos.x86_64

Install the apache server by using the following command

 [root@linuxhelp ~]# yum install httpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.xeonbd.com
 * epel: mirrors.nipa.cloud
 * extras: mirror.xeonbd.com
 * remi-php70: remirepo.reloumirrors.net
 * remi-safe: remirepo.reloumirrors.net
 * updates: mirrors.nhanhoa.com
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-88.el7.centos will be installed
--> Finished Dependency Resolution
Installed size: 10 M
Is this ok [y/d/N]: y
.
.
.
Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7_4.1                           apr-util.x86_64 0:1.5.2-6.el7              
  httpd-tools.x86_64 0:2.4.6-88.el7.centos               mailcap.noarch 0:2.1.41-2.el7              
Complete!

Once the above step is completed start the apache service by using the following command

[root@linuxhelp ~]# systemctl start httpd

Once the apache service is started check the status of apache service

[root@linuxhelp ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-04-10 12:42:26 IST; 14s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 6264 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
    Tasks: 6
 .
.
Apr 10 12:42:26 linuxhelp systemd[1]: Starting The Apache HTTP Server...
Apr 10 12:42:26 linuxhelp httpd[6264]: AH00558: httpd: Could not reliably determine the serve...sage
Apr 10 12:42:26 linuxhelp systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

After completing the above step enable the apache by using the following commad

[root@linuxhelp ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

Install the mariadb server by using the following command

[root@linuxhelp ~]# yum install mariadb mariadb-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.xeonbd.com
 * epel: mirrors.nipa.cloud
 * extras: mirror.xeonbd.com
 * remi-php70: remirepo.reloumirrors.net
 * remi-safe: remirepo.reloumirrors.net
 * updates: mirrors.nhanhoa.com
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.60-1.el7_5 will be installed
.
.
.
Installed:
  mariadb.x86_64 1:5.5.60-1.el7_5               mariadb-server.x86_64 1:5.5.60-1.el7_5              
Dependency Installed:
  perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7      perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7     
  perl-DBD-MySQL.x86_64 0:4.023-6.el7               perl-DBI.x86_64 0:1.627-4.el7                   
  perl-Data-Dumper.x86_64 0:2.145-3.el7             perl-IO-Compress.noarch 0:2.061-2.el7           
  perl-Net-Daemon.noarch 0:0.48-5.el7               perl-PlRPC.noarch 0:0.2020-14.el7               
Dependency Updated:
  mariadb-libs.x86_64 1:5.5.60-1.el7_5                                                              
Complete!

Once the above step is completed start the mariadb service by using the following command

[root@linuxhelp ~]# systemctl start mariadb
Once the apache service is started check the status of mariadb service
 [root@linuxhelp ~]# systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-04-10 12:44:40 IST; 11s ago
  Process: 6747 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 6668 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 6746 (mysqld_safe)
    Tasks: 20
   CGroup: /system.slice/mariadb.service
           ├─6746 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─6908 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/l...
.
.
Hint: Some lines were ellipsized, use -l to show in full.

After completing the above step enable the mariadb by using the following commad

[root@linuxhelp ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

After enabling the service we need to secure the root password for mysql database

 [root@linuxhelp ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): 
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
 ... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
 ... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

Once it completed install php7.0 by using this command

[root@linuxhelp ~]# yum install php php-mbstring php-mcrypt php-gd php-mysql php-zip php-soap php-ldap php-curl
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.xeonbd.com
 * epel: mirrors.nipa.cloud
 * extras: mirror.xeonbd.com
 * remi-php70: remirepo.reloumirrors.net
 * remi-safe: remirepo.reloumirrors.net
 * updates: mirrors.nhanhoa.com
Package php-mysql is obsoleted by php-mysqlnd, trying to install php-mysqlnd-7.0.33-7.el7.remi.x86_64 instead
Resolving Dependencies
--> Running transaction check
.
.
.
Installed:
  php.x86_64 0:7.0.33-7.el7.remi                 php-common.x86_64 0:7.0.33-7.el7.remi             
  php-gd.x86_64 0:7.0.33-7.el7.remi              php-ldap.x86_64 0:7.0.33-7.el7.remi               
  php-mbstring.x86_64 0:7.0.33-7.el7.remi        php-mcrypt.x86_64 0:7.0.33-7.el7.remi             
  php-mysqlnd.x86_64 0:7.0.33-7.el7.remi         php-pecl-zip.x86_64 0:1.15.4-1.el7.remi.7.0       
  php-soap.x86_64 0:7.0.33-7.el7.remi           
Dependency Installed:
  gd-last.x86_64 0:2.2.5-8.el7.remi                libmcrypt.x86_64 0:2.5.8-13.el7                  
  libwebp7.x86_64 0:1.0.2-1.el7.remi               libzip5.x86_64 0:1.5.2-1.el7.remi                
  php-cli.x86_64 0:7.0.33-7.el7.remi               php-json.x86_64 0:7.0.33-7.el7.remi              
  php-pdo.x86_64 0:7.0.33-7.el7.remi              
Complete!

Configure the info.php by using the following command

[root@linuxhelp ~]# vim /var/www/html/info.php

Once the all step is completed restart the apache service

[root@linuxhelp ~]# systemctl restart httpd

Switch to your browser and enter your domain name

The apache test page snap1 The php and it information page snap2

With this the Method to install lamp on centos 7.5 comes to end

Tags:
lucas
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What are the alternatives to lamp stack?

A

These are the alternatives LEMP, XAMMP and much more.

Q

How to configure the host entry

A

enter into



vim /etc/hosts



configure the ip address and domain name

Q

What is the Purpose of using the LAMP setup?

A

LAMP is a server configuration for various web applications. It helps in running servers and dynamic web sites. It is a web development platform that uses Linux operating system, Apache web s

Q

How to configure port-based virtual host?

A

Go to the location /etc/httpd/conf/httpd.conf





listen :

Q

How to check the apache MariaDB and PHP version?

A

Check the version by using the following command

httpd -v , mysql -V ,php -v

Related Tutorials in How to install lamp on centos 7.5

Related Tutorials in How to install lamp on centos 7.5

How To Install AnyDesk on Centos 7
How To Install AnyDesk on Centos 7
Apr 2, 2018
How to install Tiki Wiki CMS Groupware on CentOS 7
How to install Tiki Wiki CMS Groupware on CentOS 7
May 31, 2018
How to install PHP ImageMagick on CentOS 7
How to install PHP ImageMagick on CentOS 7
Nov 4, 2017
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
Jun 4, 2019
How to install Apache from Source Code on CentOS 7
How to install Apache from Source Code on CentOS 7
Oct 21, 2017
How to enable or disable repositories in CentOS
How to enable or disable repositories in CentOS
Mar 28, 2018
How to install AWStats on CentOS 7
How to install AWStats on CentOS 7
Dec 8, 2017
How to install Apache JMeter in CentOS 7
How to install Apache JMeter in CentOS 7
Mar 24, 2017

Related Forums in How to install lamp on centos 7.5

Related Forums in How to install lamp on centos 7.5

CentOS
connor class=
How To Completely Remove Apache package On CentOS 7.6
May 14, 2019
CentOS
ceriaimmaculate class=
setfacl : command not found
Jan 3, 2018
CentOS
mason class=
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
Nov 20, 2018
CentOS
landon class=
Command to find SNMP Version
May 28, 2018
CentOS
arjitharon class=
cannot start minio service help
Mar 10, 2018
Apache tomcat
AadrikaAnshu class=
Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program
Jun 17, 2019
gitlab
caden class=
Insufficient space in download directory /var/cache/yum/x86_64/6/base/packages
Jul 22, 2019
OpenVAS
frank class=
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Dec 20, 2018
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Ryan ?
how to use visual traceroute tool

Am using traceroute command to check for the route. i got this tool while surfing. So pls help me out installation and usage of Visual traceroute tool.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.