LAMP guide

Issues related to applications and software problems and general support
Post Reply
JackBauer
Posts: 19
Joined: 2020/05/19 13:56:35

LAMP guide

Post by JackBauer » 2020/06/03 21:16:55

Hello,

Any good LAMP guide?

And to setup a firewall too?

Thanks

JackBauer
Posts: 19
Joined: 2020/05/19 13:56:35

Re: LAMP guide

Post by JackBauer » 2020/06/06 09:08:28

No one for this?

No official documents?

dgnzcn
Posts: 15
Joined: 2017/01/05 08:36:44

Re: LAMP guide

Post by dgnzcn » 2020/06/06 13:00:30

apache, mysql, php, phpmyadmin install on Localhost
Please folllow this guide works on me.

1. setup - Apache
sudo dnf update

sudo dnf install httpd httpd-tools
sudo systemctl enable httpd.service
sudo systemctl start httpd.service

2. setup - MySQL

sudo dnf -y install @mysql
sudo systemctl enable mysqld.service
sudo systemctl start mysqld.service

sudo mysql_secure_installation

3. setup - PHP

sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo dnf module reset php

sudo dnf module enable php:remi-7.4
sudo dnf install php php-mysqlnd
dnf install php-gd php-zip php-mcrypt php-json php-xml php-gettext php-curl php-intl

sudo systemctl restart httpd.service

4.setup - Firewalld
sudo firewall-cmd --zone=public --permanent --add-service=http

sudo firewall-cmd --zone=public --permanent --add-service=https

sudo firewall-cmd --reload


phpMyAdmin setup:


dnf install httpd wget unzip

dnf install php php-pdo php-pecl-zip php-json php-mbstring php-mysqlnd php-json php-mbstring

systemctl enable httpd.service

systemctl start httpd.service



2.install - phpMyAdmin

wget https://files.phpmyadmin.net/phpMyAdmin ... guages.zip

unzip phpMyAdmin-5.0.2-all-languages.zip

mv phpMyAdmin-5.0.2-all-languages /usr/share/phpmyadmin

3.setting up - phpMyAdmin

sudo nano /etc/httpd/conf.d/phpmyadmin.conf

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin/>

AddDefaultCharset UTF-8

<IfModule mod_authz_core.c>

# Apache 2.4

<RequireAny>

Require all granted

</RequireAny>

</IfModule>

</Directory>

<Directory /usr/share/phpmyadmin/setup/>

<IfModule mod_authz_core.c>

# Apache 2.4

<RequireAny>

Require all granted

</RequireAny>

</IfModule>

</Directory>

save and close...

chcon -Rv --type=httpd_sys_content_t /usr/share/phpmyadmin/*

systemctl restart httpd.service


4.setup - secure fire wall



firewall-cmd --permanent --add-service=http

firewall-cmd --reload

5.go to - PhpMyAdmin

http://localhost/phpmyadmin

JackBauer
Posts: 19
Joined: 2020/05/19 13:56:35

Re: LAMP guide

Post by JackBauer » 2020/06/07 08:55:47

Thanks, looks like a solid guide.

Why don't you use SELinux?

pjsr2
Posts: 483
Joined: 2014/03/27 20:11:07

Re: LAMP guide

Post by pjsr2 » 2020/06/07 12:52:56

Why don't you use SELinux?
What makes you think SELinux is not used?
From the command

Code: Select all

chcon -Rv --type=httpd_sys_content_t /usr/share/phpmyadmin/*
I would say dgnzcn is using SELinux.

JackBauer
Posts: 19
Joined: 2020/05/19 13:56:35

Re: LAMP guide

Post by JackBauer » 2020/06/07 18:30:28

Oh yes, most probably yes, thanks.

I am not sure I will enable it though.

dgnzcn
Posts: 15
Joined: 2017/01/05 08:36:44

Re: LAMP guide

Post by dgnzcn » 2020/06/08 08:11:45

If you are use only your personal desktop computer then you can disable SELinux.


To disable SELinux
vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# change value you'd like to set
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted


save and reboot

User avatar
TrevorH
Forum Moderator
Posts: 29113
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: LAMP guide

Post by TrevorH » 2020/06/08 10:25:07

But it's really not advised.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

gerry666uk
Posts: 52
Joined: 2020/02/10 19:06:06

Re: LAMP guide

Post by gerry666uk » 2020/06/08 19:25:53

Don't disable selinux.
The whole point of CentOS, is that you can run an enterprise grade operating system and be fully in line with RedHat.
Even for testing it's good to have selinux turned on; it protects the underlying subsystems from bad code, and helps to spot obvious bugs at an early stage.

Post Reply

Return to “CentOS 8 - General Support”