One-click installation of Apache2.4 php7 mariadb

Resource download (resources should not be divided): https://download.csdn.net/download/wanghaisheng/15849774

Usually it is too troublesome to install a WEB runtime environment. It is necessary to organize the script installation, or compile and install the original code, and then perform a lot of configuration, which is time-consuming and wastes a lot of energy, so I want to organize it and record it. It is convenient for everyone to use.

         installation steps:

  1. The environment requires centos7, because there is a special script for fire prevention, so it is only suitable for 7.0 and above. If it is other system version, please modify the script by yourself. Secondly, you must configure the network, because you need to use the YUM installation, so the network is definitely not working. Another point is that if you are as afraid of problems as I am, and you are a LINUX rookie, please use the Centos7.0-mini version to avoid conflicts.
  2. Put the downloaded resources into the LINUX system for decompression.
  3. Enter the decompression directory apm-install, execute the script, and enter sh apache_php7_mariadb.sh in the command line
  4. Wait for the execution process. If you are prompted whether to install, type y. When the database is installed, you will be prompted to configure the database, so please refer to the following:


NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current

password for the root user. If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none): <-- Press Enter for the first run

OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

Set root password? [Y/n] <– Whether to set the root user password, enter y and press Enter or press Enter directly

New password: <– set the password of the root user In order to better connect with the WEB later, the password here can be 1980root

Re-enter new password: <--- enter the password you set again

Password updated successfully!

Reloading privilege tables..

… Success!

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? [Y/n] <– Whether to delete anonymous users, it is recommended to delete them in the production environment, so press Enter directly

… Success!

Normally, root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely ? [Y/n] < –Whether to prohibit root remote login, choose Y/n according to your needs and press Enter, it is recommended to prohibit

… Success!

By default, MySQL comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] <– Whether to delete the test database, press Enter

- Dropping test database…

… Success!

- Removing privileges on test database…

… Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] <– Whether to reload the privilege tables, press Enter directly

… Success!

Cleaning up…

All done! If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!


      5. After the installation is complete, execute the command netstat -lntp|more. If you see that ports such as 80 3306 are all up, the installation is successful.

          If the command cannot be found, please install the net-tool tool ( tool download ) first. For further confirmation, please enter http://ip/info.php in the browser to   see if it is displayed.

          If you just saw it

             Explain that there is a problem with the PHP installation, why is it so? Because this is a network installation, it is possible that the network is not installed, you can execute the script again. If there is no success, it will be installed again, if it is already installed, it will be automatically ignored. When you reach the database setting, you can directly terminate with Ctrl + c

             After success, the following information will be displayed:

important point:

  1. If you want to modify the configuration of php before installation, you can modify the PHP.INI file in the directory before installation. This file is the configuration file of the installation. If you have completed the installation, please modify the /etc/php.ini file, restart after completion, and execute the command line:

systemctl restart httpd   

     2. The only requirement is CentOS7.0, because the firewall command cannot be used under 7.0. You can temporarily comment out the following commands in the script:

firewall-cmd --permanent --zone=public --add-port=8080-8081/tcp
firewall-cmd --permanent --zone=public --add-port=80-80/tcp
firewall-cmd --permanent --zone=public --add-port=3306-3306/tcp
firewall-cmd --permanent --zone=public --add-port=7272-7272/tcp
firewall-cmd --permanent --zone=public --add-port=6379-6379/tcp
firewall-cmd --permanent --zone=public --add-port=89-89/tcp
firewall-cmd --permanent --zone=public --add-port=1935-1935/tcp

firewall-cmd --reload

After the installation is complete, go to modify the firewall. I have opened many ports here. The main reason is that I have to install other services later, so I opened them together.

     3. Installation and important directories

          var/www/html/ web page script directory

          /var/lib/mysql/ Data directory of the database

         /var/lib/php/ php related cache directory, such as session file cache

Guess you like

Origin blog.csdn.net/wanghaisheng/article/details/114884965