1. Before installing LAMP, install EPEL in order to install software other than the source, such as phpMyAdmin and other tools.
Tip: EPEL, the Extra Packages for Enterprise Linux, the enterprise version of linux additional package. This software repository has a lot of very commonly used software, and it is specially designed for RHEL. It is a good supplement to the RHEL standard yum source. It is completely free to use and maintained by the Fedora project, so if you are using RHEL, or CentOS , Scientific and other RHEL systems, you can use EPEL's yum source with confidence.
2. Install Apache
b) systemctl start httpd #Start Apache
c) systemctl enable httpd #Set startup
3. Install MYSQL (MariaDB)
b) systemctl start mariadb #start mariadb
c) systemctl enable mariadb #set startup
4. Set MariaDB password
5. Install PHP
6. Install phpMyAdmin
b) vim /etc/httpd/conf.d/phpMyAdmin.conf #You can modify the point of Alias in it.
c) chmod -R777 /var/lib/php/session #Modify session permissions so that phpmyadmin can access. This path is different for different system paths. You can find session.save_path in phpinfo()
#Visit http://youipaddress/phpmyadmin, if you can access it, then you are successful!
7. Modify the Apache configuration (domain name binding, if you do not need a domain name, it is only for testing purposes, you can skip it...)
//其实完全可以直接修改/etc/httpd/conf/httpd.conf文件,在最后一行来进行新增配置,但是为了不影响主配置,我们还是在/conf.d/文件夹下新增一个vhost.conf文件。
#如果有多个域名绑定,则新增多个VirtualHost,只有一个,则只需要填写一个VirtualHost
ServerName localhost
<VirtualHost *:80>
ServerName www.4jcms.com
DocumentRoot /var/www/html
</VirtualHost>
<VirtualHost *:80>
ServerName up.4jcms.com
DocumentRoot /var/www/html/uploads
</VirtualHost>
<VirtualHost *:80>
ServerName res.4jcms.com
DocumentRoot /var/www/html/resource
</VirtualHost>