In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
The following content mainly brings you the interpretation of LNMP architecture and the installation of MySQL. The knowledge mentioned is slightly different from books. It is summed up by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing. I hope to bring help to the majority of readers.
First, LNMP architecture interpretation LNMP platform is a combination of Linux, Ngnix, MySQL, PHP architecture, requires Linux CVM, MySQL database, PHP parsing environment. This case mainly introduces the installation method of LNMP framework and the deployment of Discuz! Community forum application. LNMP deployment ideas: install Nginx services install MySQL services install configuration PHP parsing environment deploy Discuz! Community forum Web application 2, the environment is ready to connect remotely my IP:192.168.56.1 has a shared file lamp7 there is a LNMP installation package if there is an installation package, do not need to download, can not go to this file in the next three, set up Nginx
1. Install compilation tools: gcc, gcc-c++, make, pcre, pcre-devel, zlib-devel, and turn off the firewall.
[root@localhost ~] # systemctl stop firewalld.service [root@localhost ~] # setenforce 0 [root@localhost ~] # yum install gcc gcc-c++ pcre pcre-devel make zlib-devel-y2 and mount mount shared files to / abc, and decompress nginx package mkdir / abcmount.cifs / / 192.168.56.1/lamp7 / abccd / opt/LNMPtar zxvf nginx-1.12.2.tar.gz-C / opt/
)\ 1577426501771.png)
3. Create and run user and group Nginx service programs run as nobody by default. It is recommended to create special user accounts for them in order to more accurately control their access rights, increase flexibility and reduce security risks.
/ / create a user named nginx that does not establish a host folder and forbids logging in to the Shell environment. Useradd-M-s / sbin/nilogin nginx4, compile and configure cd / opt/nginx-1.12.2/./configure\-- prefix=/usr/local/nginx\-- user=nginx\-- group=nginx\-- with-http_stub_status_module5, make & & make installmake & & make install6, nginx commands to perform path optimization, making it easy for the system to identify ln-s / usr/local/nginx/sbin/nginx / usr/local/sbin/ ls-1 / usr/local/sbin/nginx
7. There are two ways to add Nginx system services: service or systemctl. In order to make the Nginx service start, stop, reload and other operations more convenient You can write Nginx service control files based on CentOS 7.6.Use systemctl tools to manage cd / lib/systemd/systemvim nginx.service- configuration parameters-[Unit] Description=nginxAfter= network.target [service] Type=forkingPIDFile=/usr/local/nginx/logs/nginx.pidExecStart=/usr/local/nginx/sbin/nginxExecReload=/usr/bin/kill-s HUP $MAINPIDExecStop=/usr/bin/kill-s QUIT $MAINPIDPrivateTmp= true [install] WantedBy=multi-user.target
8. Set the permissions of the service startup file chmod 754 nginx.service9, and open the nginx server systemctl start nginx.servicenetstat-anpt | grep 80
10. Verify the installed nginx input 192.168.111.141 on your own browser with centos7, and "Welcome to nginx!" appears. That is, success
4. Installation of MySQL 1. Install the package of Mysql environment dependency package yum install ncurses ncurses-devel bison cmake-y---ncurses / / character terminal to facilitate terminal operation of 'bison / / function library' cmake / / without configure Use cmake'2, extract to / opt/cd / abc/LNMPtar zxvf mysql-boost-5.7.20.tar.gz-C / opt/3, create the database running user useradd-s / sbin/nologin mysql4, Compile and configure cd / opt/mysql-5.7.20/cmake\-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock\-DSYSCONFDIR=/etc\-DSYSTEMD_PID_DIR=/usr/local/mysql\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_ARCHIVE_STORAGE_ENGINE=1\-DWITH-BLACKHOLE_STORAGE_ENGINE=1\-DWITH-PERFSCHEMA_STORAGE_ENGINE=1\-DMYSQL_DATADIR= / usr/local/mysql/data\-DWITH_BOOST=boost\-DWITH_SYSTEMD=1
5. Make compiles make & & make install6, adjusts chown-R mysql:mysql / usr/local/mysql/7 to the directory of the database, and deletes all the original files in the configuration file vim / etc/my.cnf//. Add the following content: [client] port = 3306default-character-set=utf8socket = / usr/local/mysql/mysql.sock [mysql] port = 3306default-character-set=utf8socket = / usr/local/mysql/ mysql.sock [mysqld] user = mysql basedir = / usr/local/mysqldatadir = / usr/local/mysql/dataport = 3306character_set_server=utf8pid-file = / usr/local/mysql/mysql.pidsocket = / usr/local/mysql/mysql.sockserver-id = 1sqlstores modeworthy NONGEINENGENGENGINE SUBSTITUTIONMICTRANS.TABLESno automatic creator user NO_AUTO_VALUE_ON_ZERO,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,PIPES_AS_CONCAT,ANSI_QUOTES----chown-R mysql.mysql / etc/my.cnf
8. Set the environment variable of / etc/profile You can use the mysql command echo 'PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH' > > / etc/profileecho' export PATH' > > / etc/profilesource / etc/profile---source / etc/profile// to make variables take effect in any directory. You can see appended variables in vim / etc/profile.
9. Under the initialization database cd / usr/local/mysql/ bin directory, there is a mysqldbin/mysqld\-- initialize-insecure\-- user=mysql\-- basedir=/usr/local/mysql\-- datadir=/usr/local/mysql/data.
10. Copy the service file to the system directory. You can use the systemctl command to enable the MySQL service cp usr/lib/systemd/system/mysqld.service / usr/lib/systemd/system/11, enable the database to boot self-boot systemctl enable mysqld//, open the mysql service systemctl start mysqld.service// view port netstat-anpt | grep 330612, set the Mysql password # set the Mysql password # enter the password directly, enter the password abc123, and confirm abc123 again. Then there is the password mysqladmin-u root-p password
13. Log in to the database # Log in to the database, prompt for the password and enter the password "abc123" mysql-u root-p just set.
For the above interpretation of LNMP architecture and the installation of MySQL, if you need to know more, you can continue to pay attention to the innovation of our industry. If you need professional answers, you can contact the pre-sales and after-sales on the official website. I hope this article can bring you some knowledge updates.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.