LAMP builds forum and blog platform

Article catalog

What is LAMP

LAMP refers to Linux (operating system) + Apache (HTTP server) + MySQL/MariaDB (database) and PHP (network programming language), which are generally used to build a web application platform.

Build Forum

1. First, make sure your linux can connect to the Internet

ping www.qq.com

2. Install the http service software and start the service

 yum install  httpd  httpd-devel  httpd-tools  -y

Start up: systemctl enable httpd

Start service: systemctl start httpd

3. Installing MariaDB and starting services

yum install  mariadb mariadb-devel  mariadb-server  -y

Start up: systemctl enable MariaDB 

Start service: systemctl start MariaDB 

4. Install php support

yum install php  php-mysql  php-devel  -y

5. Shut down the firewall and selLinux directly because it is a test environment

Stop firewall: systemctl stop firewalld.service
 Disable firewall startup: systemctl disable firewalld.service 


Turn off SELinux:
① Temporary closure:
##Set SELinux to permission mode
 ##setenforce 1 set SELinux to enforce mode
setenforce 0

② Permanent closure:
vi /etc/selinux/config
 Change SELinux = forcing to SELINUX=disabled
 Restart is required after setting to take effect

6. Create database and user rights

[root@dhcp ~]# mysql  -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| auth               |
| mysql              |
| performance_schema |
| test               |
| zabbix             |
+--------------------+
6 rows in set (0.02 sec)

MariaDB [(none)]> create  database  bbs charset=utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant  all   on  bbs.*   to   bbs@'localhost'   identified by  'bbs123';
Query OK, 0 rows affected (0.02 sec)

MariaDB [(none)]>


7. Test apache site directory location

vi  /var/www/html/test.php



<?php
phpinfo();
?>

=======
systemctl   restart  httpd

Client IE opens test web page http://ip/test.php

8. Will WIN's Discuz_X3.2_SC_UTF8.zip to Linux and unzip to / var/www/html/bbs

[root@dhcp ~]# unzip  Discuz_X3.2_SC_UTF8.zip   -d  /tmp
//Resolve directory move to / var/www/html/bbs
[root@dhcp ~]# mv  /tmp/upload      /var/www/html/bbs
[root@dhcp ~]# cd  /var/www/html/bbs
[root@dhcp bbs]# ls  -l   
//Set permissions for directory access
 [root@dhcp bbs]# chmod -R  757 {config/,data/,uc_client/,uc_server/}

9. Go to the installation page and complete the installation http://ip/bbs

Build a blog

1. The service is ready

2. Pass the compressed package to LINUX/tmp and extract it to / var/www/html/blog

[stay/tmp Next execution]
tar xf   wordpress-4.9.4-zh_CN.tar.gz   -C   /usr/src

mv    /usr/src/wordpress     /var/www/html/blog

3. Create a database to build a blog, and give the database permission to the user blog

4. Enter the installation page http://ip/blog

5. Because there is an empty WP in the system- config.php The installation system cannot create the file, so delete the file first and then enter the installation page to copy the contents to the new wp-config.php To start the installation.

6. Complete

Keywords: MariaDB PHP Database SELinux

Added by V34 on Sat, 13 Jun 2020 08:39:11 +0300