Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailing the Construction of LNMP Architecture + Discuz Forum in Linux system

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Interpretation of LNMP Architecture LNMP platform is the combined architecture of Linux, Ngnix, MySQL and PHP, which requires Linux server, MySQL database and PHP parsing environment to build Nginx services.

Download Nginx source package Nginx source package download

Mount the directory where the source package is stored in the Linux virtual machine [root@localhost ~] # mount.cifs / / 192.168.100.10/lnmp / mnt/ mount directory Password for root@//192.168.100.10/lnmp: [root@localhost ~] # cd / mnt/ [root@localhost mnt] # lsDiscuz_X3.4_SC_UTF8.zip mysql-boost-5.7.20.tar.gz nginx-1.12.2.tar.gz php- 7.1.20.tar.gz [root@localhost mnt] # yum install gcc gcc-c++ make pcre-devel zlib-devel-y / / the installation environment package has loaded plug-ins: fastestmirror LangpacksLoading mirror speeds from cached hostfile * base: ftp.sjtu.edu.cn...// omits part of the content. Installed: gcc.x86_64 0VOR 4.8.5-39.el7 gcc-c++.x86_64 0VOR 4.8.5-39.el7 pcre-devel.x86_64 0RH 8.32-17.el7 zlib-devel.x86_64 0RO 1.2.7-18.el7 installed as a dependency: cpp.x86_64 0RO 4.8.5-39.el7 Glibc-devel.x86_64 0VOR 2.17-292.el7 glibc-headers.x86_64 0RU 2.17-292.el7 kernel-headers.x86_64 0RU 3.10.0-1062.4.1.el7 libmpc.x86_64 0Rl 1.0.1-3.el7 libstdc++-devel.x86_64 0Rl 4.8. 5-39.el7 update completed: make.x86_64 124.el7 3.82-24.el7 upgraded as dependency: glibc.x86_64 0VOR 2.17-292.el7 glibc-common.x86_64 0RU 2.17-292.el7 Libgcc.x86_64 0VOR 4.8.5-39.el7 libgomp.x86_64 0RU 4.8.5-39.el7 libstdc++.x86_64 0RU 4.8.5-39.el7 zlib.x86_64 0RV 1.2.7-18.el7 over! [root@localhost mnt] # tar zvxf nginx-1.12.2.tar.gz-C / opt/ decompress the environment package [root@localhost mnt] # cd / opt/ [root@localhost opt] # lsnginx-1.12.2 rh [root@localhost opt] # cd nginx-1.12.2/ [root@localhost nginx-1.12.2] # lsauto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src [root@localhost nginx-1.12.2] # useradd-M -s / sbin/nologin nginx / / create Nginx program user Unable to log on to the system Do not create a home directory [root@localhost nginx-1.12.2] #. / configure\ / configure nginx >-- prefix=/usr/local/nginx\ / / specify installation directory >-- user=nginx\ / / specified user >-- group=nginx\ / / specified group >-- with-http_stub_status_module / / associated statistics module. / / omit some of the contents. Nginx http access log file: "/ usr/local/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" [root@localhost nginx-1.12.2] # make & & make install / / make and install nginx... / / omit some contents... test-d'/ usr/local/nginx/html'\ | | cp-R html' / usr/local/nginx'test-d'/ usr/local/nginx/logs'\ | | mkdir-p'/ usr/local/nginx/logs'make [1]: leave the directory "/ opt/nginx-1.12.2" [root@localhost nginx-1.12.2] # ln-s / usr/local/nginx/sbin/* / usr/local/sbin/ put the command into the system command [root@localhost nginx-1.12.2] # cd / lib/systemd/system / / enter the system management directory [root@localhost system] # vim nginx.service / / create a nginx program management script [Unit] Description=nginxAfter=network.ta rget [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= truth [install] WantedBy=multi-user.target:wq [root@localhost system] # chmod 754 nginx.service / / add execution permission [root@localhost system] # systemctl start nginx.service / / start the service [root@localhost system] # netstat-ntap | grep 80 / / check whether the port is open tcp 0 0 0. .0: * LISTEN 4593/nginx: master [root@localhost system] # systemctl stop firewalld.service / / turn off the firewall [root@localhost system] # setenforce 0 / / turn off the enhanced security feature and test whether the web page can be accessed properly on the client.

Set up a Discuz forum to download Discuz, and put it into the directory that has been mounted to Linux. Download [root@localhost html] # mysql-u root-p / / enter the mysql database Enter password: / / enter the password Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 6Server version: 5.7.20 Source distributionCopyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'c'to clear the current input statement.mysql > CREATE DATABASE bbs; / / create bbs database Query OK, 1 row affected (0.02 sec) mysql > GRANT all ON bbs.* TO 'bbsuser'@'%' IDENTIFIED BY' admin123';// elevate the rights of database user bbsuser as administrator and set password Query OK, 0 rows affected, 1 warning (0.01 sec) mysql > GRANT all ON bbs.* TO 'bbsuser'@'localhost' IDENTIFIED BY' admin123' Query OK, 0 rows affected, 1 warning (0.00 sec) mysql > flush privileges; / / refresh database Query OK, 0 rows affected (0.00 sec) mysql > show databases / / View database content +-+ | Database | +-+ | information_schema | | bbs | | mysql | | performance_schema | | sys | +- -+ 5 rows in set (0.00 sec) mysql > quit / / exit Bye [root@localhost html] # cd / mnt [root@localhost mnt] # lsDiscuz_X3.4_SC_UTF8.zip mysql-boost-5.7.20.tar.gz nginx-1.12.2.tar.gz php-7.1.20.tar.gz [root@localhost mnt] # unzip Discuz_X3.4_SC_UTF8.zip-d / opt/ extract to the opt directory [root@localhost mnt] # cd / opt/ [root@localhost opt] # lsdir_SC_UTF8 mysql-5.7.20 nginx-1.12.2 php-7.1.20 rh description .htm [root@localhost opt] # cd dir_SC_UTF8/ enter the forum directory [root@localhost dir_SC_UTF8] # lsreadme upload utility [root@localhost dir_SC_UTF8] # cp-r Upload/ / usr/local/nginx/html/bbs/ / copy / opt directory to the bbs directory of the html site [root@localhost dir_SC_UTF8] # cd / usr/local/nginx/html/bbs/ enter the bbs site directory [root@localhost bbs] # chown-R root:nginx. / config/ modify the group [root@localhost bbs] # chown-R root:nginx. / data/ [root@localhost] Bbs] # chown-R root:nginx. / uc_client/ [root @ localhost bbs] # root-R root:nginx. / uc_server/ [root @ localhost bbs] # chmod-R 777. / config/ modify all permissions [root@localhost bbs] # chmod-R 777. / data/ [root@localhost bbs] # chmod-R 777. / uc_client/ [root @ localhost bbs] # chmod-R 777. / uc_server/ uses the client to access the site Install Discuz forums

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report