Install LAMP on CentOS 7

Install LAMP on CentOS 7

1. Clear and upgrade the system
yum clean all
yum -y update
hostname localhost
systemctl stop firewalld
systemctl disable firewalld

2. Install CSF
cd /usr/src
rm -fv csf.tgz
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

3. Configure CSF
nano /etc/csf/csf.conf

enter
csf -r

Save and exit.

4. Change the OpenSSH default port (optional)
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
nano /etc/ssh/sshd_config
Find Port 22, change it to another port, and allow it in CSF.

Save and exit.
Restart the service:
systemctl restart sshd.service

5. Install Apache

a. Clear old services:
yum -y install httpd

b. Set up the domain name directory (change example.com to your own domain name)
mkdir -p /var/www/example.com/public_html
chown -R $USER:$USER /var/www/example.com/public_html
chmod -R 755 /var/www
mkdir /etc/httpd/sites-available
mkdir /etc/httpd/sites-enabled

c. Edit the configuration file
nano /etc/httpd/conf/httpd.conf
Put IncludeOptional sites-enabled/*.conf at the bottom of the file

d. Save and exit.
nano /etc/httpd/sites-available/example.com.conf

e. Add the following to the website configuration file (change example.com to your own domain name)

 ServerName www.example.com ServerAlias example.com DocumentRoot /var/www/example.com/public_html ErrorLog /var/www/example.com/error.log CustomLog /var/www/example.com/requests.log combined

f. Save and exit.
ln -s /etc/httpd/sites-available/example.com.conf /etc/httpd/sites-enabled/example.com.conf
apachectl restart

6. Install CertBot (Use lets-encrypt to create SSL certificates)
yum install epel-release
yum install certbot
certbot certonly

Here are the installation commands:
certbot renew –dry-run
certbot renew –quiet

7. Install PHP 5.6
yum -y update
yum -y install epel-release
wget https://dl.fedoraproject.org/pub/epe…t-7.noarch.rpm
wget https://centos7.iuscommunity.org/ius-release.rpm
rpm -Uvh ius-release*.rpm
yum -y update
yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath

8. Install MySQL
yum -y install mariadb-server mariadb
systemctl start mariadb
mysql_secure_installation

9. Install phpMyAdmin
yum -y install phpmyadmin
nano /etc/httpd/conf.d/phpMyAdmin.conf
Change 127.0.0.1 to your independent IP
Alias ​​/phpMyAdmin /usr/share/phpMyAdmin (change /phpMyAdmin to /usr/share/phpMyAdmin)

10. Restart the service
systemctl restart httpd.service

via: http://www.webhostingtalk.com/showthread.php?t=1588551

<<:  CloudAtCost 512MB memory vmware vps Canada simple review

>>:  IdeaStack: $5/month/1GB memory/30GB space/1TB traffic/KVM/Seattle/windows

Recommend

NyaVM: $50/year/4GB memory/60GB space/3TB traffic/KVM/San Jose

NyaVM, a Chinese hosting provider. There is a spe...

$79/month dedicated server - iWeb

iWeb Inc has been providing hosting services sinc...

Rackedge: $2/month/2GB memory/30GB space/unlimited traffic/100Mbps port/OVZ/UK

Rackedge, an Indian merchant, was established in ...

DesiVPS: $2/month/2GB RAM/20GB SSD space/unlimited traffic/1Gbps/KVM/Los Angeles

DesiVPS, an Indian merchant (GST no: 27ADTFS5681D...

AutoVM: VPS management system based on VMware ESXi

AutoVM is an open source VPS management system ba...

ServerRoom: $79/year/8GB RAM/32GB SSD space/unlimited traffic/New York

ServerRoom, an American hosting company, was foun...

Creating a Squid3 Proxy with Multiple IPs

Environment: CentOS 1. Install on VPS Log in to t...

HiFormance: $10/month/4G memory/150GB space/2TB traffic/KVM/Los Angeles CN2

HiFormance, an American hosting company located i...