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

Teach you to build personal / enterprise private cloud disks-kodexplorer

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

Share

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

Environment description:

System version: CentOS 6.9 x86x64

Software version: nginx-1.12.2

Php-5.5.38

But Yunyun kodexplorer4.37

1. Compilation and installation of nginx

1.1 create a directory

Mkdir-p / service/toolsmkdir / applicationcd / service/toolswget http://nginx.org/download/nginx-1.12.2.tar.gz download or upload nginx package

1.2 decompression

Tar zxvf nginx-1.12.2.tar.gz

1.3 compilation and installation

Yum install gcc gcc-c++ glibc-y # install compiler yum install pcre-devel zlib-devel openssl-devel-y

Install pcre to provide regular expression library for rewriting rewrite, install zlib to provide function library for data compression for gzip, and install openssl to provide cryptographic algorithm, certificate and SSL protocol functions for Nginx modules (such as ssl).

C language source code package, which needs to be compiled in order to use

Compilation and installation trilogy

. / configure (specify compilation parameters: installation directory and version) cd nginx-1.12.2./configure-- prefix=/application/nginx-1.12.2-- pid-path=/var/run/nginx.pid-- user=nginx-- group=nginx-- with-http_ssl_module./configure-help # View help

Generate Makefile file

Make

Make is used to compile. It reads instructions from Makefile and then compiles

Cc-c-pipe-O-W-Wall-Wpointer-arith-Wno-unused-parameter-Werror-I src/core-I src/event-I src/event/modules-I src/os/unix-I objs-I src/http-I src/http/modules\-o objs/src/http/modules/ngx_http_geo_module.o\ src/http/modules/ngx_http_geo_module.c

Make install

Make install is used to install. It also reads instructions from Makefile and installs to the specified location.

[root@Web01 nginx-1.12.2] # cd / application/nginx-1.12.2/ [root@Web01 nginx1.12.2] # ls-1conf # configuration file html # website html file logs # log sbin # binary execution file

1.4 configuration

Create a soft link

Ln-s / application/nginx-1.12.2 / application/nginxln-s / application/nginx/sbin/nginx / usr/bin/useradd-M-s / sbin/nologin-r-u 88 nginx # create user-M does not create a user's HOME directory-s shell specifies default login to shell-r to create a system account-u uid specifies a unique UIDconf directory fastcgi.conf with phpuwsgi_params and pythonnginx.conf for the account Master profile mime.types Multimedia Resource Type profile

Minimize Profil

Grep-Ev'^ $| # 'nginx.conf.default > nginx.conf [root@Web01 conf] # grep-Ev' ^ $| # 'nginx.conf.default > nginx.conf [root@Web01 conf] # cat nginx.confworker_processes 1; # number of working processes events {# event module worker_connections 1024; # default number of working connections} http {# http module, nginx core module include mime.types # loaded multimedia resource type profile default_type application/octet-stream; # default type (hexadecimal) sendfile on; # optimized configuration option keepalive_timeout 65; # persistent connection timeout 65 seconds server {listen 80; # default listening port server_name localhost; # website domain name location / {# website root directory location root html; # website file index index.html index.htm # website homepage} error_page 500502 503 504 / 50x.htl; # error page 500502.503.504 returns 50x.htmllocation = / 50x.html {root html;}}

1.5 start

/ application/nginx/sbin/nginx-t # Syntax check and Test / application/nginx/sbin/nginx # Startup / application/nginx/sbin/nginx-s reload # smooth restart without affecting user access to / application/nginx/sbin/nginx-s stop # shutdown / application/nginx/sbin/nginx-V # View version and installed modules

Several temp directories will be generated after startup

Browser access

Compilation and installation of Nginx completed

2. Compile and install php

2.1 download and install the relevant compiler

Mkdir-p / service/tools # create directory cd / service/tools/ wget http://mirrors.sohu.com/php/php-5.5.38.tar.gz # download package tar xf php-5.5.38.tar.gz # extract yum install gcc gcc-c++ glibc-y # install compiler If you have already compiled and installed nginx, you do not need this step to yum install-y libxml2-devel curl curl-devel libjpeg-devel libpng-devel freetype-devel to install the library cd php-5.5.38 # required at compile time to enter the php-5.5.38 directory

2.2 compilation and installation

Compile and generate makefile

/ configure-- prefix=/application/php-5.5.38-- with-jpeg-dir=/usr/lib64-- with-freetype-dir=/usr/lib64/-- with-curl-- enable-fpm-- enable-mbstring-- with-gd-- with-fpm-user=nginx-- with-fpm-group=nginx make & & make install3, Configure [root@Web02 php-5.5.38] # ln-s / application/php-5.5.38/ application/php # create soft link [root@Web02 php-5.5.38] # ln-s / application/php/bin/* / usr/bin/ # create command soft link [root@Web02 php-5.5.38] # cp php.ini-production / application/php-5.5.38/etc/php.ini copy default configuration text Piece [root@Web02 php-5.5.38] # cp / application/php-5.5.38/etc/php-fpm.conf.default / application/php-5.5.38/etc/php-fpm.conf copy default php-fpm configuration file Number of php-fpm startup processes 4. Launch [root@Web02 php-5.5.38] # / application/php/sbin/php-fpm # launch php [root@Web02 php-5.5.38] # netstat-lntup | grep 9000 # View process 9000 port tcp 00 127.0.0.1 application/php/sbin/php-fpm 9000 0.0.0.0 * LISTEN 97399/php-fpm5, configure nginx to support php

View the php section of nginx.conf.default (lines 65-71), add this to nginx.conf, and modify the fastcgi_param to specify the script filename documentrootdocumentrootfastcgi_script_name

Can be viewed at / application/nginx/conf/fastcgi.conf

65 # location ~\. Php$ {66 # root html;67 # fastcgi_pass 127.0.0.1 Discovery 9000X 68 # fastcgi_index index.php;69 # fastcgi_param SCRIPT_FILENAME / scripts$fastcgi_script_name;70 # include fastcgi_params;71 #} [root@Web02 php-5.5.38] # cd / application/nginx/conf/ [root@Web02 conf] # vim nginx.conf server {listen 80; server_name localhost Index index.php index.html index.htm; location / {root html;} location ~\ .php$ {root html; fastcgi_pass 127.0.0.1 location 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME documentrootdocumentrootfastcgi_script_name Include fastcgi_params;}

This configuration means that the .php file accessed in the browser actually reads the .php file under $document_root (the root directory of the website)-- that is, when you access 127.0.0.1/index.php, you need to read the index.php file under the root directory of the website. If this configuration item is not configured, nginx does not go back to the root directory of the website to access the .php file, so it returns blank.

Configuration project: the include fastcgi_params; fastcgi_params file contains the definition of each nginx constant. By default, SCRIPT_FILENAME = / scripts$fastcgi_script_name

Check the syntax nginx-t

6. Configure the network disk, download and decompress kodexplorer [root@Web02 conf] # cd.. / html/ # and go to the site directory [root@Web02 html] # ls 50x.html index.html [root@Web02 html] # rm-rf * # to delete the original site file [root@Web02 html] # wget http://static.kodcloud.com/update/download/kodexplorer4.37.zip

download

[root@Web02 html] # unzip kodexplorer4.37.zip # decompress [root@Web02 html] # nginx # start nginx

Browser access

Follow the prompts

Su-c 'setenforce 0' # closes the selinux,su-c specified command and executes chmod-R 777 / var/www/html/ # with root to modify permissions as prompted

Refresh the page to revisit, successfully, set the administrator user name and password, log in and follow up the graphical interface operation

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