Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
lempstack/include/tengine.sh at main · linuxeye/lempstack · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
linuxeye
lempstack
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
lempstack
/
include
/
tengine.sh
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
88 lines (81 loc) · 4.1 KB
main
Breadcrumbs
lempstack
/
include
/
tengine.sh
Copy path
Top
File metadata and controls
Code
Blame
88 lines (81 loc) · 4.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!
/bin/bash
#
Author: yeho <lj2007331 AT gmail.com>
#
BLOG: https://linuxeye.com
Install_Tengine
() {
pushd
${current_dir}
/src
>
/dev/null
id -g
${run_group}
>
/dev/null
2>&1
[
$?
-ne
0 ]
&&
groupadd
${run_group}
id -u
${run_user}
>
/dev/null
2>&1
[
$?
-ne
0 ]
&&
useradd -g
${run_group}
-M -s /sbin/nologin
${run_user}
tar xzf pcre-
${pcre_ver}
.tar.gz
tar xzf tengine-
${tengine_ver}
.tar.gz
tar xzf openssl-
${openssl_ver}
.tar.gz
pushd
tengine-
${tengine_ver}
>
/dev/null
#
Modify Tengine version
#
sed -i 's@TENGINE "/" TENGINE_VERSION@"Tengine/unknown"@' src/core/nginx.h
[
!
-d
"
${tengine_install_dir}
"
]
&&
mkdir -p
${tengine_install_dir}
./configure --prefix=
${tengine_install_dir}
--user=
${run_user}
--group=
${run_group}
--with-http_v2_module --with-http_ssl_module --with-stream --with-stream_ssl_preread_module --with-stream_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-
${openssl_ver}
--with-pcre=../pcre-
${pcre_ver}
--with-pcre-jit --with-jemalloc
${nginx_modules_options}
make
&&
make install
if
[
-e
"
${tengine_install_dir}
/conf/nginx.conf
"
]
;
then
popd
>
/dev/null
rm -rf pcre-
${pcre_ver}
openssl-
${openssl_ver}
tengine-
${tengine_ver}
echo
"
${CSUCCESS}
Tengine installed successfully!
${CEND}
"
else
rm -rf
${tengine_install_dir}
echo
"
${CFAILURE}
Tengine install failed, Please Contact the author!
${CEND}
"
kill
-9
$$
;
exit
1
;
fi
[
-z
"
`
grep ^
'
export PATH=
'
/etc/profile
`
"
]
&&
echo
"
export PATH=
${tengine_install_dir}
/sbin:
\$
PATH
"
>>
/etc/profile
[
-n
"
`
grep ^
'
export PATH=
'
/etc/profile
`
"
-a
-z
"
`
grep
${tengine_install_dir}
/etc/profile
`
"
]
&&
sed -i
"
s@^export PATH=\(.*\)@export PATH=
${tengine_install_dir}
/sbin:\1@
"
/etc/profile
.
/etc/profile
/bin/cp ../init.d/nginx.service /lib/systemd/system/
sed -i
"
s@/usr/local/nginx@
${tengine_install_dir}
@g
"
/lib/systemd/system/nginx.service
systemctl
enable
nginx
mv
${tengine_install_dir}
/conf/nginx.conf{,_bk}
if
[
"
${apache_flag}
"
==
'
y
'
]
||
[
-e
"
${apache_install_dir}
/bin/httpd
"
]
;
then
/bin/cp ../config/nginx_apache.conf
${tengine_install_dir}
/conf/nginx.conf
elif
{ [[
${tomcat_option}
=~
^[1-4]$ ]]
||
[
-e
"
${tomcat_install_dir}
/conf/server.xml
"
]
;
}
&&
{ [[
!
${php_option}
=~
^[1-9]$
|
^1[0-5]$ ]]
&&
[
!
-e
"
${php_install_dir}
/bin/php
"
]
;
}
;
then
/bin/cp ../config/nginx_tomcat.conf
${tengine_install_dir}
/conf/nginx.conf
else
/bin/cp ../config/nginx.conf
${tengine_install_dir}
/conf/nginx.conf
[[
"
${php_option}
"
=~
^[1-9]$
|
^1[0-5]$ ]]
&&
[
-z
"
`
grep
'
/php-fpm_status
'
${tengine_install_dir}
/conf/nginx.conf
`
"
]
&&
sed -i
"
s@index index.html index.php;@index index.html index.php;\n location ~ /php-fpm_status {\n #fastcgi_pass remote_php_ip:9000;\n fastcgi_pass unix:/dev/shm/php-cgi.sock;\n fastcgi_index index.php;\n include fastcgi.conf;\n allow 127.0.0.1;\n deny all;\n }@
"
${tengine_install_dir}
/conf/nginx.conf
fi
cat
>
${tengine_install_dir}
/conf/proxy.conf
<<
EOF
proxy_connect_timeout 300s;
proxy_send_timeout 900;
proxy_read_timeout 900;
proxy_buffer_size 32k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_redirect off;
proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';
proxy_set_header Referer
\$
http_referer;
proxy_set_header Cookie
\$
http_cookie;
proxy_set_header Host
\$
host;
proxy_set_header X-Real-IP
\$
remote_addr;
proxy_set_header X-Forwarded-For
\$
proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto
\$
scheme;
EOF
sed -i
"
s@/data/wwwroot/default@
${wwwroot_dir}
/default@
"
${tengine_install_dir}
/conf/nginx.conf
sed -i
"
s@/data/wwwlogs@
${wwwlogs_dir}
@g
"
${tengine_install_dir}
/conf/nginx.conf
sed -i
"
s@^user www www@user
${run_user}
${run_group}
@
"
${tengine_install_dir}
/conf/nginx.conf
#
logrotate nginx log
cat
>
/etc/logrotate.d/nginx
<<
EOF
${wwwlogs_dir}
/*nginx.log {
daily
rotate 5
missingok
dateext
compress
notifempty
sharedscripts
postrotate
[ -e /var/run/nginx.pid ] && kill -USR1
\`
cat /var/run/nginx.pid
\`
endscript
}
EOF
popd
>
/dev/null
ldconfig
systemctl start nginx
}
You can’t perform that action at this time.