当前位置:网站首页>Summary method of lamp environment deployment
Summary method of lamp environment deployment
2022-06-12 10:26:00 【We met at the edge of the mountain】
1. First of all to see linux Whether the firewall of the environment is turned off
systemctl status firewalld - If the status parameter of the firewall is inactive, The firewall is closed .
- If the status parameter of the firewall is active, The firewall is on . In this example, the firewall is on , So you need to turn off the firewall .
1.1 Turn off firewall
systemctl disable firewalld2. close SELinux.
vi /etc/selinux/config
Edit bottom SELINUX It is amended as follows disabled Then press In parentheses ( :wq! ) Save and exit
3 install apache
yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql3.1 function httpd -v The command can be viewed Apache Version number of
3.2 Run the following commands in sequence to start Apache Service and set the service startup and self startup
systemctl start httpdsystemctl enable httpd In the browser address bar of the local machine , Input http:// Instance public network IP The following figure shows that the configuration is successful

4. Install and configure MySQL
Run the following command to update YUM Source
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpmRun the following command to install MySQL.
yum -y install mysql-community-serverRun the following command to see MySQL Version number
mysql -VRun the following command to start MySQL
systemctl start mysqldRun the following command to set the boot up MySQL.
systemctl enable mysqldsystemctl daemon-reloadRun the following command to see MySQL The initial password for . After executing the following statement Half of the password is the last value
grep "password" /var/log/mysqld.logFirst, you need to log in to according to the default password obtained above mysql Execute the following statement perhaps
Here you can get the default password or directly modify it and enter it
update user set password=password( " Your own password " ) where user= 'root' ;Or you can directly use the following statement to configure mysql The security of ( Recommend the above ) You don't have to worry about the bottom
mysql_secure_installationThe following statement will show the information Knowledge disclosure
Reset root Password of account
Enter password for user root: # Enter the root User initial password
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration of the plugin.
Using existing password for root.
Estimated strength of the password: 100
Change the password for root ? (Press y|Y for Yes, any other key for No) : Y # Whether or not to change root User password , Input Y
New password: # Enter the new password , The length is 8 to 30 Characters , Must contain both uppercase and lowercase letters 、 Numbers and special symbols . The special symbol can be ()` [email protected]#$%^&*-+=|{}[]:;‘<>,.?/
Re-enter new password: # Enter the new password again
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : YInput Y Delete anonymous user account .
By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : Y # Whether to delete anonymous users , Input Y
Success.Input Y prohibit root Account remote login .
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y # prohibit root Remote login , Input Y
Success.Input Y Delete test Library and pair test Library access .
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y # Whether or not to delete test Library and access to it , Input Y
- Dropping test database...
Success.Input Y Reload authorization table .
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y # Whether to reload the authorization table , Input Y
Success.
All done!5 install PHP
to update YUM Source .
Run the following command to add epel Source
yum install -y \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmRun the following command to add Webtatic Source .
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmRun the following command to install PHP.
yum -y install php70w-devel php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-pdo.x86_64 php70w-mysqlnd php70w-fpm php70w-opcache php70w-pecl-redis php70w-pecl-mongodbRun the following command to see PHP edition .
php -vThe return result is as follows , Indicates successful installation .
Run the following command , stay Apache Create a test file from the root of the website .
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.phpRun the following command to restart Apache service .
systemctl restart httpd In the browser address bar of the local machine , Input http:// Instance public network IP/phpinfo.php And press Enter key .
The display page indicates that the installation was successful .
6. install phpMyAdmin
phpMyAdmin It's a MySQL Database management tools , adopt Web Interface management database is convenient and fast .
Run the following command to prepare phpMyAdmin Data storage directory .
mkdir -p /var/www/html/phpmyadmindownload phpMyAdmin Compressed package
cd
wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zipdecompression phpMyAdmin Compressed package
yum install -y unzip
unzip phpMyAdmin-4.0.10.20-all-languages.zipRun the following command to copy phpMyAdmin File to the prepared data storage directory .
mv phpMyAdmin-4.0.10.20-all-languages/* /var/www/html/phpmyadmin In the local machine browser address bar , Input http:// Instance public network IP/phpmyadmin And press Enter key , visit phpMyAdmin The login page Then login root + Operate with a password
边栏推荐
- How PLC constructs shift function block (FC) by itself
- 原始套接字使用
- [MySQL] index invalidation and index optimization
- 【机器学习】基于鸢尾花(iris)数据集的逻辑回归分类实践
- Chapter 3 search
- MySQL III Configuration file & log file
- Halcon combined with C # to detect surface defects -- affine transformation (III)
- C break continue return
- VSCode代码调试技巧
- How to refund the pre-sale deposit of JD 618 in 2022? Can JD 618 deposit be refunded?
猜你喜欢

MySQL 7 affair

JVM (VI) Virtual machine bytecode execution engine (with stack execution process and bytecode instruction table)

Raw socket usage

Add jar package under idea2018 web project

Student management system

Chapter 3 search

Halcon combined with C # to detect surface defects -- affine transformation (III)

2022淘宝618超级喵运会玩法来了 超级喵运会有哪些攻略方法

tp6调试(trace)

机器学习不是你想用,想用就能用
随机推荐
[CEGUI] log system
Golang start service background daemon
2022 Taobao 618 Super Cat Games introduction 618 super cat games playing skills
conda 安装tensorflow 测试tensorflow
How high can C language reach by self-study alone?
Implementation principle of redisson distributed lock
PHP wechat red packet allocation logic
np.meshgrid()函数 以及 三维空间中的坐标位置生成 以及 numpy.repeat()函数介绍
How to play the 618 super cat games on Taobao? Here comes the introduction to the overall activities of the Super Cat Games
原始套接字使用
[DDS] ddsi-rtps specification
Redis (II) Memory mapped data structure
MySQL 4 Database table storage structure & tablespace
[Mozilla] basic concept analysis of IPDL
PHP: seven cattle cloud upload file
Detailed explanation and use of redis data types: key and string types
FPGA VGA display based on de2-115 platform
高通平台如何修改特殊电压
MySQL III Configuration file & log file
数组,整型,字符变量在全局和局部的存在形式