milis/talimatname/genel/n/nginx/talimat

139 lines
4.7 KiB
Plaintext
Raw Normal View History

2017-10-27 20:46:27 +02:00
# Tanım: NGINX, ücretsiz, açık kaynaklı, yüksek performanslı bir HTTP sunucusu ve ters proxy yanı sıra bir IMAP / POP3 proxy sunucusudur.
2016-02-24 01:27:23 +01:00
# URL: http://nginx.net/
2017-10-27 20:46:27 +02:00
# Paketçi: milisarge
# Gerekler: libxml2 libxslt pcre
2017-04-05 13:48:35 +02:00
2017-10-28 14:10:23 +02:00
isim=nginx
2017-12-10 20:47:31 +01:00
surum=1.13.7
2017-10-28 14:10:23 +02:00
devir=1
2016-02-24 01:27:23 +01:00
2017-10-28 14:10:23 +02:00
kaynak=(http://nginx.org//download/$isim-$surum.tar.gz
2017-07-03 04:17:09 +02:00
nginx.servis
nginx.logrotate)
2016-02-24 01:27:23 +01:00
# change those if you prefer another setup
NGINXUSER=www
NGINXGROUP=www
2017-12-12 00:01:40 +01:00
HTMLDIR=/srv/http
2016-02-24 01:27:23 +01:00
# change those if you need those experimental modules
# (idea from slackbuilds.org)
if [ "${USE_SPDY:-no}" == "yes" ]; then
SPDY_MOD="--with-http_spdy_module"
else
SPDY_MOD=""
fi
if [ "${USE_GEOIP:-no}" == "yes" ]; then
GEOIP_MOD="--with-http_geoip_module"
else
GEOIP_MOD=""
fi
#
#
2017-10-27 23:59:41 +02:00
derle() {
2017-10-28 14:10:23 +02:00
cd $isim-$surum
2017-12-11 05:07:51 +01:00
./configure \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
--sbin-path=/usr/bin/nginx \
--pid-path=/run/nginx.pid \
--lock-path=/run/lock/nginx.lock \
--user=http \
--group=http \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=stderr \
--http-client-body-temp-path=/var/lib/nginx/client-body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-cc-opt="$CFLAGS $CPPFLAGS" \
--with-ld-opt="$LDFLAGS" \
2016-02-24 01:27:23 +01:00
./configure --prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/subsys \
--user=${NGINXUSER} \
--group=${NGINXGROUP} \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/lib/nginx/client_body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--http-scgi-temp-path=/var/lib/nginx/scgi \
2017-12-11 05:07:51 +01:00
--with-compat \
--with-debug \
--with-file-aio \
2016-02-24 01:27:23 +01:00
--with-ipv6 \
2017-12-11 05:07:51 +01:00
--with-pcre-jit \
--with-stream \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-threads \
2016-02-24 01:27:23 +01:00
--with-select_module \
--with-poll_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_degradation_module \
--with-http_stub_status_module \
2017-12-11 05:07:51 +01:00
--with-http_sub_module \
--with-http_v2_module \
2016-02-24 01:27:23 +01:00
--with-http_perl_module \
--with-http_auth_request_module \
--with-mail \
--with-mail_ssl_module \
2017-12-11 05:07:51 +01:00
--with-cc-opt="$CFLAGS $CPPFLAGS" \
--with-ld-opt="$LDFLAGS" \
2016-02-24 01:27:23 +01:00
$SPDY_MOD \
$GEOIP_MOD
make
make DESTDIR=$PKG install
# Make the temp path.
2017-10-28 14:10:23 +02:00
install -dm700 $PKG/var/lib/$isim
2016-02-24 01:27:23 +01:00
# Move html directory and do not use /srv/www as it is used by apache
mkdir -p $PKG/$HTMLDIR
mv $PKG/usr/html $PKG/$HTMLDIR
chown -v -R $NGINXUSER:$NGINXGROUP $PKG/$HTMLDIR
# Fix the nginx.conf file for html and virtual server directory.
sed -i \
-e '/root[ ]*html/s|html;|/srv/http/&|' \
-e '$s|.*| include /etc/nginx/conf.d/\*.conf;\n&|' \
2017-10-28 14:10:23 +02:00
$PKG/etc/nginx/$isim.conf
2016-02-24 01:27:23 +01:00
# install the nginx init script
2017-04-25 19:29:54 +02:00
install -Dm755 $SRC/nginx.servis $PKG/etc/rc.d/init.d/nginx
2016-02-24 01:27:23 +01:00
# install the logrotate file
install -Dm644 $SRC/nginx.logrotate $PKG/etc/logrotate.d/nginx
# fill the right user & group in the logrotate file
sed -e "s,@USER@,$NGINXUSER," -e "s,@GROUP@,$NGINXGROUP," \
$PKG/etc/logrotate.d/nginx
# Set the permissions for the log directory.
2017-10-28 14:10:23 +02:00
chown $NGINXUSER $PKG/var/log/$isim
chmod 750 $PKG/var/log/$isim
2016-02-24 01:27:23 +01:00
# Create sub-directory for virtual servers.
2017-10-28 14:10:23 +02:00
mkdir -p $PKG/etc/$isim/conf.d
2016-02-24 01:27:23 +01:00
# Remove perllocal.pod and .packlist if present in the package
for i in perllocal.pod .packlist; do
find $PKG -name "$i" -exec rm -rf {} \;
done
}