知识屋:更实用的电脑技术知识网站
所在位置:首页 > 操作系统 > linux

Centos下初始化系统的shell脚本

发布时间:2015-11-06 16:48:24作者:知识屋

根据参考网上的一些文章,总结出来一个系统初始化的shell脚本
#!/bin/bashcat << EOF+---------------------------------------------------------------------------+|  Initialize for the CentOS 6_installed.                                   |+---------------------------------------------------------------------------+EOFfunction format() {    #sleep 1    #echo -e "/033[42;37m ########### Finished ########### /033[0m/n"    echo -e "/033[32m Install Success!!!/033[0m/n"}########################################################################### Set time 时区/时间同步设置echo "Set time."/bin/cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &> /dev/nullyum -y install ntpdate &> /dev/nullntpdate  0.centos.pool.ntp.org &> /dev/nullhwclock -wformat########################################################################### Create Log 创建该脚本运行记录日志echo "Create log file."DATE1=`date +"%F %H:%M"`LOG=/var/log/sysinitinfo.logecho $DATE1 >> $LOGecho "------------------------------------------" >> $LOGformat############################################################################ Disabled Selinux 禁用Selinuxecho "Disabled SELinux."sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinuxformat############################################################################ Stop iptables 禁用iptablesecho "Stop iptables."service iptables stop &> /dev/nullchkconfig --level 235 iptables offformat############################################################################ Disable ipv6 禁用IPV6echo "Disable ipv6."cat << EOF > /etc/modprobe.confalias net-pf-10 offalias ipv6 offEOFchkconfig --level 2235 ip6tables offformat###########################################################################Set history commands  设置命令历史记录参数echo "Set history commands."sed -i 's/HISTSIZE=1000/HISTSIZE=100/' /etc/profilesed -i "8 s/^/alias vi='vim'/" /root/.bashrcgrep 'HISTFILESIZE' /etc/bashrc &>/dev/nullif [ $? -ne 0 ]thencat << EOF >> /etc/bashrcHISTFILESIZE=4000HISTSIZE=4000HISTTIMEFORMAT='%F/%T'EOFfisource /etc/bashrcformat########################################################################### set vimecho "Set Vim."cat << EOF > ~/.vimrcset numberset laststatus=2set shiftwidth=4set tabstop=4set noexpandtabset softtabstop=4set cmdheight=3set cursorlineset formatoptions=tcrqn set encoding=utf-8syntax oncolorscheme desertcolor ronset background=darkset ruler set rulerformat=%20(%2*%<%f%=/ %m%r/ %3l/ %c/ %p%%%)set statusline=%F%m%r%h%w/ [FORMAT=%{&ff}]/ [TYPE=%Y]/ [POS=%l,%v][%p%%]/ %{strftime(/"%d/%m/%y/ -/ %H:%M/")}nmap z :x<cr>nmap sp :set paste<cr>iEOFformat########################################################################### Epel 升级epel源echo "Install epel"rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm &> /dev/nullsed -i "s/^#base/base/g" /etc/yum.repos.d/epel.reposed -i "s/^mirr/#mirr/g" /etc/yum.repos.d/epel.repoformat###########################################################################Yum install Development tools  安装开发包组及必备软件echo "Install Development tools(It will be a moment)"yum groupinstall -y "Development tools" &> /dev/nullyum install -y bind-utils lrzsz wget gcc gcc-c++ vim htop openssl &>/dev/nullformat########################################################################### Yum update bash and openssl  升级bash/opensslecho "Update bash and openssl"yum -y update bash openssl &> /dev/nullformat############################################################################ Set ssh 设置ssh登录策略echo "Set sshd."sed -i "s/^#PermitEmptyPasswords/PermitEmptyPasswords/" /etc/ssh/sshd_configsed -i "s/^#LoginGraceTime 2m/LoginGraceTime 6m/" /etc/ssh/sshd_configgrep "UseDNS no" /etc/ssh/sshd_config &>/dev/nullif [ $? -ne 0 ]then    echo "UseDNS no" >> /etc/ssh/sshd_configfiformat############################################################################ Set default init 3  设置系统默认初始化echo "Default init 3."sed -i 's/^id:5:initdefault:/id:3:initdefault:/' /etc/inittabformat###########################################################################echo "Tunoff services."for i in `ls /etc/rc3.d/S*`do    servers=`echo $i|cut -c 15-`    echo $servers    case $servers in crond | irqbalance | microcode_ctl | network | random | postfix | sshd | rsyslog | local | smart | cpuspeed | mysqld | httpd | ntpd | php-fpm | nginx)        echo -e "/033[31m Base services, Skip!/033[0m"      ;;      *)        echo -e "/033[31m change $servers to off/033[0m"        chkconfig --level 235 $servers off        service $servers stop      ;;esacdoneformat############################################################################ Del unnecessary users 删除不必要的用户echo "Del unnecessary users."for USERS in adm lp sync shutdown halt mail news uucp operator games gopherdo    grep $USERS /etc/passwd &>/dev/null    if [ $? -eq 0 ]    then        userdel $USERS &> /dev/null    fidoneformat############################################################################ Del unnecessary groups 删除不必要的用户组echo "Del unnecessary groups."for GRP in adm lp mail news uucp games gopher mailnull floppy dip pppusers popusers slipusers daemondo    grep $GRP /etc/group &> /dev/null    if [ $? -eq 0 ]    then        groupdel $GRP &> /dev/null    fidoneformat############################################################################ Disabled reboot by keys ctlaltdelete 禁用ctlaltdelete重启功能echo "Disabled reboot by keys ctlaltdelete"sed -i 's/^exec/#exec/' /etc/init/control-alt-delete.confformat############################################################################ Set ulimit  设置文件句柄数echo "Set ulimit 1000000"cat << EOF > /etc/security/limits.conf*    soft    nofile  1000000*    hard    nofile  1000000*    soft    nproc 102400*    hard    nproc 102400EOFsed -i 's/102400/1000000/' /etc/security/limits.d/90-nproc.confformat############################################################################ Set login message 设置登录时显示的信息echo "Set login message."echo "This is not a public Server" > /etc/issueecho "This is not a public Server" > /etc/redhat-releaseformat############################################################################ Record SUID and SGID filesDATE2=`date +"%F"`echo "Record SUID and SGID files."echo "SUID --- " > /var/log/SuSg_"$DATE2".logfind / -path '/proc'  -prune -o -perm -4000 >> /var/log/SuSg_"$DATE2".logecho "------------------------------------------------------ " >> /var/log/SuSg_"$DATE2".logecho "SGID --- " >> /var/log/SuSg_"$DATE2".logfind / -path '/proc'  -prune -o -perm -2000 >> /var/log/SuSg_"$DATE2".logformat############################################################################ Disabled crontab send mail 禁用执行任务计划时向root发送邮件echo "Disable crontab send mail."sed -i 's/^MAILTO=root/MAILTO=""/' /etc/crontabsed -i 's/^mail/./*/mail/.err/' /etc/rsyslog.confformat############################################################################ Set ntp client 设置时间服务客户端echo "Set ntp client."SED() {    cp -p /etc/ntp.conf /etc/ntp.conf.bak    sed -i '/^server/d' /etc/ntp.conf    sed -i '/^includefile/ i/server 0.centos.pool.ntp.org iburst' /etc/ntp.conf    sed -i '/0.centos.pool.ntp.org/ a/server 1.centos.pool.ntp.org iburst' /etc/ntp.conf    sed -i '/1.centos.pool.ntp.org/ a/server 2.centos.pool.ntp.org iburst' /etc/ntp.conf    sed -i '/2.centos.pool.ntp.org/ a/server 3.centos.pool.ntp.org iburst' /etc/ntp.conf    chkconfig --level 35 ntpd on &> /dev/null}rpm -q ntp &> /dev/nullif [ $? -eq 0 ]then    SEDelse    yum -y install ntp &> /dev/null    SEDfiformat############################################################################ Set sysctl.conf 设置内核参数echo "Set sysctl.conf"#web应用中listen函数的backlog默认会将内核参数的net.core.somaxconn限制到128,而nginx定义的NGX_LISTEN_BACKLOG默认是511,所以必须调整,一般调整为2048cat << EOF > /etc/sysctl.confnet.core.somaxconn = 2048net.core.wmem_default = 262144net.core.rmem_max = 16777216net.core.wmem_max = 16777216net.ipv4.tcp_rmem = 4096 4096 16777216net.ipv4.tcp_wmem = 4096 4096 16777216net.ipv4.tcp_mem = 786432 2097152 3145728net.ipv4.tcp_max_syn_backlog = 16384net.core.netdev_max_backlog = 20000net.ipv4.tcp_fin_timeout = 15net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1net.ipv4.tcp_max_orphans = 131072net.ipv4.ip_local_port_range = 1024 65535net.ipv4.ip_forward = 0net.ipv4.conf.default.rp_filter = 1net.ipv4.conf.default.accept_source_route = 0kernel.sysrq = 0kernel.core_uses_pid = 1net.ipv4.tcp_syncookies = 1net.bridge.bridge-nf-call-ip6tables = 0net.bridge.bridge-nf-call-iptables = 0net.bridge.bridge-nf-call-arptables = 0kernel.msgmnb = 65536kernel.msgmax = 65536kernel.shmmax = 4294967295kernel.shmall = 26843545EOF#modprobe bridge  > /dev/null/sbin/sysctl  -p  > /dev/nullformat

 

 
还有一个nginx语法高亮的脚本
 
#!/bin/bash[ -d ~/.vim/syntax ] || mkdir -p ~/.vim/syntaxcat << EOF > ~/.vim/syntax/nginx.vim" Vim syntax file" Language: nginx.confif exists("b:current_syntax")  finishendsetlocal iskeyword+=.setlocal iskeyword+=/setlocal iskeyword+=:syn match ngxVariable '/$/w/w*'syn match ngxVariableBlock '/$/w/w*' containedsyn match ngxVariableString '/$/w/w*' containedsyn region ngxBlock start=+^+ end=+{+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString onelinesyn region ngxString start=+"+ end=+"+ skip=+/////|//"+ contains=ngxVariableString onelinesyn region ngxString start=+'+ end=+'+ skip=+/////|//'+ contains=ngxVariableString onelinesyn match ngxComment ' *#.*$'syn keyword ngxBoolean onsyn keyword ngxBoolean offsyn keyword ngxDirectiveBlock http         containedsyn keyword ngxDirectiveBlock mail         containedsyn keyword ngxDirectiveBlock events       containedsyn keyword ngxDirectiveBlock server       containedsyn keyword ngxDirectiveBlock types        containedsyn keyword ngxDirectiveBlock location     containedsyn keyword ngxDirectiveBlock upstream     containedsyn keyword ngxDirectiveBlock charset_map  containedsyn keyword ngxDirectiveBlock limit_except containedsyn keyword ngxDirectiveBlock if           containedsyn keyword ngxDirectiveBlock geo          containedsyn keyword ngxDirectiveBlock map          containedsyn keyword ngxDirectiveImportant includesyn keyword ngxDirectiveImportant rootsyn keyword ngxDirectiveImportant serversyn keyword ngxDirectiveImportant server_namesyn keyword ngxDirectiveImportant listensyn keyword ngxDirectiveImportant internalsyn keyword ngxDirectiveImportant proxy_passsyn keyword ngxDirectiveImportant memcached_passsyn keyword ngxDirectiveImportant fastcgi_passsyn keyword ngxDirectiveImportant try_filessyn keyword ngxDirectiveControl breaksyn keyword ngxDirectiveControl returnsyn keyword ngxDirectiveControl rewritesyn keyword ngxDirectiveControl setsyn keyword ngxDirectiveError error_pagesyn keyword ngxDirectiveError post_actionsyn keyword ngxDirectiveDeprecated connectionssyn keyword ngxDirectiveDeprecated imapsyn keyword ngxDirectiveDeprecated open_file_cache_retestsyn keyword ngxDirectiveDeprecated optimize_server_namessyn keyword ngxDirectiveDeprecated satisfy_anysyn keyword ngxDirective accept_mutexsyn keyword ngxDirective accept_mutex_delaysyn keyword ngxDirective access_logsyn keyword ngxDirective add_after_bodysyn keyword ngxDirective add_before_bodysyn keyword ngxDirective add_headersyn keyword ngxDirective addition_typessyn keyword ngxDirective aiosyn keyword ngxDirective aliassyn keyword ngxDirective allowsyn keyword ngxDirective ancient_browsersyn keyword ngxDirective ancient_browser_valuesyn keyword ngxDirective auth_basicsyn keyword ngxDirective auth_basic_user_filesyn keyword ngxDirective auth_httpsyn keyword ngxDirective auth_http_headersyn keyword ngxDirective auth_http_timeoutsyn keyword ngxDirective autoindexsyn keyword ngxDirective autoindex_exact_sizesyn keyword ngxDirective autoindex_localtimesyn keyword ngxDirective charsetsyn keyword ngxDirective charset_typessyn keyword ngxDirective client_body_buffer_sizesyn keyword ngxDirective client_body_in_file_onlysyn keyword ngxDirective client_body_in_single_buffersyn keyword ngxDirective client_body_temp_pathsyn keyword ngxDirective client_body_timeoutsyn keyword ngxDirective client_header_buffer_sizesyn keyword ngxDirective client_header_timeoutsyn keyword ngxDirective client_max_body_sizesyn keyword ngxDirective connection_pool_sizesyn keyword ngxDirective create_full_put_pathsyn keyword ngxDirective daemonsyn keyword ngxDirective dav_accesssyn keyword ngxDirective dav_methodssyn keyword ngxDirective debug_connectionsyn keyword ngxDirective debug_pointssyn keyword ngxDirective default_typesyn keyword ngxDirective degradationsyn keyword ngxDirective degradesyn keyword ngxDirective denysyn keyword ngxDirective devpoll_changessyn keyword ngxDirective devpoll_eventssyn keyword ngxDirective directiosyn keyword ngxDirective directio_alignmentsyn keyword ngxDirective empty_gifsyn keyword ngxDirective envsyn keyword ngxDirective epoll_eventssyn keyword ngxDirective error_logsyn keyword ngxDirective eventport_eventssyn keyword ngxDirective expiressyn keyword ngxDirective fastcgi_bindsyn keyword ngxDirective fastcgi_buffer_sizesyn keyword ngxDirective fastcgi_bufferssyn keyword ngxDirective fastcgi_busy_buffers_sizesyn keyword ngxDirective fastcgi_cachesyn keyword ngxDirective fastcgi_cache_keysyn keyword ngxDirective fastcgi_cache_methodssyn keyword ngxDirective fastcgi_cache_min_usessyn keyword ngxDirective fastcgi_cache_pathsyn keyword ngxDirective fastcgi_cache_use_stalesyn keyword ngxDirective fastcgi_cache_validsyn keyword ngxDirective fastcgi_catch_stderrsyn keyword ngxDirective fastcgi_connect_timeoutsyn keyword ngxDirective fastcgi_hide_headersyn keyword ngxDirective fastcgi_ignore_client_abortsyn keyword ngxDirective fastcgi_ignore_headerssyn keyword ngxDirective fastcgi_indexsyn keyword ngxDirective fastcgi_intercept_errorssyn keyword ngxDirective fastcgi_max_temp_file_sizesyn keyword ngxDirective fastcgi_next_upstreamsyn keyword ngxDirective fastcgi_paramsyn keyword ngxDirective fastcgi_pass_headersyn keyword ngxDirective fastcgi_pass_request_bodysyn keyword ngxDirective fastcgi_pass_request_headerssyn keyword ngxDirective fastcgi_read_timeoutsyn keyword ngxDirective fastcgi_send_lowatsyn keyword ngxDirective fastcgi_send_timeoutsyn keyword ngxDirective fastcgi_split_path_infosyn keyword ngxDirective fastcgi_storesyn keyword ngxDirective fastcgi_store_accesssyn keyword ngxDirective fastcgi_temp_file_write_sizesyn keyword ngxDirective fastcgi_temp_pathsyn keyword ngxDirective fastcgi_upstream_fail_timeoutsyn keyword ngxDirective fastcgi_upstream_max_failssyn keyword ngxDirective flvsyn keyword ngxDirective geoip_citysyn keyword ngxDirective geoip_countrysyn keyword ngxDirective google_perftools_profilessyn keyword ngxDirective gzipsyn keyword ngxDirective gzip_bufferssyn keyword ngxDirective gzip_comp_levelsyn keyword ngxDirective gzip_disablesyn keyword ngxDirective gzip_hashsyn keyword ngxDirective gzip_http_versionsyn keyword ngxDirective gzip_min_lengthsyn keyword ngxDirective gzip_no_buffersyn keyword ngxDirective gzip_proxiedsyn keyword ngxDirective gzip_staticsyn keyword ngxDirective gzip_typessyn keyword ngxDirective gzip_varysyn keyword ngxDirective gzip_windowsyn keyword ngxDirective if_modified_sincesyn keyword ngxDirective ignore_invalid_headerssyn keyword ngxDirective image_filtersyn keyword ngxDirective image_filter_buffersyn keyword ngxDirective image_filter_jpeg_qualitysyn keyword ngxDirective image_filter_transparencysyn keyword ngxDirective imap_authsyn keyword ngxDirective imap_capabilitiessyn keyword ngxDirective imap_client_buffersyn keyword ngxDirective indexsyn keyword ngxDirective ip_hashsyn keyword ngxDirective keepalive_requestssyn keyword ngxDirective keepalive_timeoutsyn keyword ngxDirective kqueue_changessyn keyword ngxDirective kqueue_eventssyn keyword ngxDirective large_client_header_bufferssyn keyword ngxDirective limit_connsyn keyword ngxDirective limit_conn_log_levelsyn keyword ngxDirective limit_ratesyn keyword ngxDirective limit_rate_aftersyn keyword ngxDirective limit_reqsyn keyword ngxDirective limit_req_log_levelsyn keyword ngxDirective limit_req_zonesyn keyword ngxDirective limit_zonesyn keyword ngxDirective lingering_timesyn keyword ngxDirective lingering_timeoutsyn keyword ngxDirective lock_filesyn keyword ngxDirective log_formatsyn keyword ngxDirective log_not_foundsyn keyword ngxDirective log_subrequestsyn keyword ngxDirective map_hash_bucket_sizesyn keyword ngxDirective map_hash_max_sizesyn keyword ngxDirective master_processsyn keyword ngxDirective memcached_bindsyn keyword ngxDirective memcached_buffer_sizesyn keyword ngxDirective memcached_connect_timeoutsyn keyword ngxDirective memcached_next_upstreamsyn keyword ngxDirective memcached_read_timeoutsyn keyword ngxDirective memcached_send_timeoutsyn keyword ngxDirective memcached_upstream_fail_timeoutsyn keyword ngxDirective memcached_upstream_max_failssyn keyword ngxDirective merge_slashessyn keyword ngxDirective min_delete_depthsyn keyword ngxDirective modern_browsersyn keyword ngxDirective modern_browser_valuesyn keyword ngxDirective msie_paddingsyn keyword ngxDirective msie_refreshsyn keyword ngxDirective multi_acceptsyn keyword ngxDirective open_file_cachesyn keyword ngxDirective open_file_cache_errorssyn keyword ngxDirective open_file_cache_eventssyn keyword ngxDirective open_file_cache_min_usessyn keyword ngxDirective open_file_cache_validsyn keyword ngxDirective open_log_file_cachesyn keyword ngxDirective output_bufferssyn keyword ngxDirective override_charsetsyn keyword ngxDirective perlsyn keyword ngxDirective perl_modulessyn keyword ngxDirective perl_requiresyn keyword ngxDirective perl_setsyn keyword ngxDirective pidsyn keyword ngxDirective pop3_authsyn keyword ngxDirective pop3_capabilitiessyn keyword ngxDirective port_in_redirectsyn keyword ngxDirective postpone_gzippingsyn keyword ngxDirective postpone_outputsyn keyword ngxDirective protocolsyn keyword ngxDirective proxysyn keyword ngxDirective proxy_bindsyn keyword ngxDirective proxy_buffersyn keyword ngxDirective proxy_buffer_sizesyn keyword ngxDirective proxy_bufferingsyn keyword ngxDirective proxy_bufferssyn keyword ngxDirective proxy_busy_buffers_sizesyn keyword ngxDirective proxy_cachesyn keyword ngxDirective proxy_cache_keysyn keyword ngxDirective proxy_cache_methodssyn keyword ngxDirective proxy_cache_min_usessyn keyword ngxDirective proxy_cache_pathsyn keyword ngxDirective proxy_cache_use_stalesyn keyword ngxDirective proxy_cache_validsyn keyword ngxDirective proxy_connect_timeoutsyn keyword ngxDirective proxy_headers_hash_bucket_sizesyn keyword ngxDirective proxy_headers_hash_max_sizesyn keyword ngxDirective proxy_hide_headersyn keyword ngxDirective proxy_ignore_client_abortsyn keyword ngxDirective proxy_ignore_headerssyn keyword ngxDirective proxy_intercept_errorssyn keyword ngxDirective proxy_max_temp_file_sizesyn keyword ngxDirective proxy_methodsyn keyword ngxDirective proxy_next_upstreamsyn keyword ngxDirective proxy_pass_error_messagesyn keyword ngxDirective proxy_pass_headersyn keyword ngxDirective proxy_pass_request_bodysyn keyword ngxDirective proxy_pass_request_headerssyn keyword ngxDirective proxy_read_timeoutsyn keyword ngxDirective proxy_redirectsyn keyword ngxDirective proxy_send_lowatsyn keyword ngxDirective proxy_send_timeoutsyn keyword ngxDirective proxy_set_bodysyn keyword ngxDirective proxy_set_headersyn keyword ngxDirective proxy_ssl_session_reusesyn keyword ngxDirective proxy_storesyn keyword ngxDirective proxy_store_accesssyn keyword ngxDirective proxy_temp_file_write_sizesyn keyword ngxDirective proxy_temp_pathsyn keyword ngxDirective proxy_timeoutsyn keyword ngxDirective proxy_upstream_fail_timeoutsyn keyword ngxDirective proxy_upstream_max_failssyn keyword ngxDirective random_indexsyn keyword ngxDirective read_aheadsyn keyword ngxDirective real_ip_headersyn keyword ngxDirective recursive_error_pagessyn keyword ngxDirective request_pool_sizesyn keyword ngxDirective reset_timedout_connectionsyn keyword ngxDirective resolversyn keyword ngxDirective resolver_timeoutsyn keyword ngxDirective rewrite_logsyn keyword ngxDirective rtsig_overflow_eventssyn keyword ngxDirective rtsig_overflow_testsyn keyword ngxDirective rtsig_overflow_thresholdsyn keyword ngxDirective rtsig_signosyn keyword ngxDirective satisfysyn keyword ngxDirective secure_link_secretsyn keyword ngxDirective send_lowatsyn keyword ngxDirective send_timeoutsyn keyword ngxDirective sendfilesyn keyword ngxDirective sendfile_max_chunksyn keyword ngxDirective server_name_in_redirectsyn keyword ngxDirective server_names_hash_bucket_sizesyn keyword ngxDirective server_names_hash_max_sizesyn keyword ngxDirective server_tokenssyn keyword ngxDirective set_real_ip_fromsyn keyword ngxDirective smtp_authsyn keyword ngxDirective smtp_capabilitiessyn keyword ngxDirective smtp_client_buffersyn keyword ngxDirective smtp_greeting_delaysyn keyword ngxDirective so_keepalivesyn keyword ngxDirective source_charsetsyn keyword ngxDirective ssisyn keyword ngxDirective ssi_ignore_recycled_bufferssyn keyword ngxDirective ssi_min_file_chunksyn keyword ngxDirective ssi_silent_errorssyn keyword ngxDirective ssi_typessyn keyword ngxDirective ssi_value_lengthsyn keyword ngxDirective sslsyn keyword ngxDirective ssl_certificatesyn keyword ngxDirective ssl_certificate_keysyn keyword ngxDirective ssl_cipherssyn keyword ngxDirective ssl_client_certificatesyn keyword ngxDirective ssl_crlsyn keyword ngxDirective ssl_dhparamsyn keyword ngxDirective ssl_enginesyn keyword ngxDirective ssl_prefer_server_cipherssyn keyword ngxDirective ssl_protocolssyn keyword ngxDirective ssl_session_cachesyn keyword ngxDirective ssl_session_timeoutsyn keyword ngxDirective ssl_verify_clientsyn keyword ngxDirective ssl_verify_depthsyn keyword ngxDirective starttlssyn keyword ngxDirective stub_statussyn keyword ngxDirective sub_filtersyn keyword ngxDirective sub_filter_oncesyn keyword ngxDirective sub_filter_typessyn keyword ngxDirective tcp_nodelaysyn keyword ngxDirective tcp_nopushsyn keyword ngxDirective thread_stack_sizesyn keyword ngxDirective timeoutsyn keyword ngxDirective timer_resolutionsyn keyword ngxDirective types_hash_bucket_sizesyn keyword ngxDirective types_hash_max_sizesyn keyword ngxDirective underscores_in_headerssyn keyword ngxDirective uninitialized_variable_warnsyn keyword ngxDirective usesyn keyword ngxDirective usersyn keyword ngxDirective useridsyn keyword ngxDirective userid_domainsyn keyword ngxDirective userid_expiressyn keyword ngxDirective userid_marksyn keyword ngxDirective userid_namesyn keyword ngxDirective userid_p3psyn keyword ngxDirective userid_pathsyn keyword ngxDirective userid_servicesyn keyword ngxDirective valid_refererssyn keyword ngxDirective variables_hash_bucket_sizesyn keyword ngxDirective variables_hash_max_sizesyn keyword ngxDirective worker_connectionssyn keyword ngxDirective worker_cpu_affinitysyn keyword ngxDirective worker_prioritysyn keyword ngxDirective worker_processessyn keyword ngxDirective worker_rlimit_coresyn keyword ngxDirective worker_rlimit_nofilesyn keyword ngxDirective worker_rlimit_sigpendingsyn keyword ngxDirective worker_threadssyn keyword ngxDirective working_directorysyn keyword ngxDirective xclientsyn keyword ngxDirective xml_entitiessyn keyword ngxDirective xslt_stylesheetsyn keyword ngxDirective xslt_types" 3rd party module list:" http://wiki.nginx.org/Nginx3rdPartyModules" Accept Language Module <http://wiki.nginx.org/NginxAcceptLanguageModule>" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.syn keyword ngxDirectiveThirdParty set_from_accept_language" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule>" Denies access unless the request URL contains an access key.syn keyword ngxDirectiveThirdParty accesskeysyn keyword ngxDirectiveThirdParty accesskey_argsyn keyword ngxDirectiveThirdParty accesskey_hashmethodsyn keyword ngxDirectiveThirdParty accesskey_signature" Auth PAM Module <http://web.iti.upv.es/~sto/nginx/>" HTTP Basic Authentication using PAM.syn keyword ngxDirectiveThirdParty auth_pamsyn keyword ngxDirectiveThirdParty auth_pam_service_name" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/>" Module adding ability to purge content from FastCGI and proxy caches.syn keyword ngxDirectiveThirdParty fastcgi_cache_purgesyn keyword ngxDirectiveThirdParty proxy_cache_purge" Chunkin Module <http://wiki.nginx.org/NginxHttpChunkinModule>" HTTP 1.1 chunked-encoding request body support for Nginx.syn keyword ngxDirectiveThirdParty chunkinsyn keyword ngxDirectiveThirdParty chunkin_keepalivesyn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_bufsyn keyword ngxDirectiveThirdParty chunkin_resume" Circle GIF Module <http://wiki.nginx.org/NginxHttpCircleGifModule>" Generates simple circle images with the colors and size specified in the URL.syn keyword ngxDirectiveThirdParty circle_gifsyn keyword ngxDirectiveThirdParty circle_gif_max_radiussyn keyword ngxDirectiveThirdParty circle_gif_min_radiussyn keyword ngxDirectiveThirdParty circle_gif_step_radius" Drizzle Module <http://github.com/chaoslawful/drizzle-nginx-module>" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle.syn keyword ngxDirectiveThirdParty drizzle_connect_timeoutsyn keyword ngxDirectiveThirdParty drizzle_dbnamesyn keyword ngxDirectiveThirdParty drizzle_keepalivesyn keyword ngxDirectiveThirdParty drizzle_module_headersyn keyword ngxDirectiveThirdParty drizzle_passsyn keyword ngxDirectiveThirdParty drizzle_querysyn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeoutsyn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeoutsyn keyword ngxDirectiveThirdParty drizzle_send_query_timeoutsyn keyword ngxDirectiveThirdParty drizzle_server" Echo Module <http://wiki.nginx.org/NginxHttpEchoModule>" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file.syn keyword ngxDirectiveThirdParty echosyn keyword ngxDirectiveThirdParty echo_after_bodysyn keyword ngxDirectiveThirdParty echo_before_bodysyn keyword ngxDirectiveThirdParty echo_blocking_sleepsyn keyword ngxDirectiveThirdParty echo_duplicatesyn keyword ngxDirectiveThirdParty echo_endsyn keyword ngxDirectiveThirdParty echo_execsyn keyword ngxDirectiveThirdParty echo_flushsyn keyword ngxDirectiveThirdParty echo_foreach_splitsyn keyword ngxDirectiveThirdParty echo_locationsyn keyword ngxDirectiveThirdParty echo_location_asyncsyn keyword ngxDirectiveThirdParty echo_read_request_bodysyn keyword ngxDirectiveThirdParty echo_request_bodysyn keyword ngxDirectiveThirdParty echo_reset_timersyn keyword ngxDirectiveThirdParty echo_sleepsyn keyword ngxDirectiveThirdParty echo_subrequestsyn keyword ngxDirectiveThirdParty echo_subrequest_async" Events Module <http://docs.dutov.org/nginx_modules_events_en.html>" Privides options for start/stop events.syn keyword ngxDirectiveThirdParty on_startsyn keyword ngxDirectiveThirdParty on_stop" EY Balancer Module <http://github.com/ry/nginx-ey-balancer>" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.syn keyword ngxDirectiveThirdParty max_connectionssyn keyword ngxDirectiveThirdParty max_connections_max_queue_lengthsyn keyword ngxDirectiveThirdParty max_connections_queue_timeout" Fancy Indexes Module <https://connectical.com/projects/ngx-fancyindex/wiki>" Like the built-in autoindex module, but fancier.syn keyword ngxDirectiveThirdParty fancyindexsyn keyword ngxDirectiveThirdParty fancyindex_exact_sizesyn keyword ngxDirectiveThirdParty fancyindex_footersyn keyword ngxDirectiveThirdParty fancyindex_headersyn keyword ngxDirectiveThirdParty fancyindex_localtimesyn keyword ngxDirectiveThirdParty fancyindex_readmesyn keyword ngxDirectiveThirdParty fancyindex_readme_mode" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule>" Country code lookups via the MaxMind GeoIP API.syn keyword ngxDirectiveThirdParty geoip_country_file" Headers More Module <http://wiki.nginx.org/NginxHttpHeadersMoreModule>" Set and clear input and output headers...more than "add"!syn keyword ngxDirectiveThirdParty more_clear_headerssyn keyword ngxDirectiveThirdParty more_clear_input_headerssyn keyword ngxDirectiveThirdParty more_set_headerssyn keyword ngxDirectiveThirdParty more_set_input_headers" HTTP Push Module <http://pushmodule.slact.net/>" Turn Nginx into an adept long-polling HTTP Push (Comet) server.syn keyword ngxDirectiveThirdParty push_buffer_sizesyn keyword ngxDirectiveThirdParty push_listenersyn keyword ngxDirectiveThirdParty push_message_timeoutsyn keyword ngxDirectiveThirdParty push_queue_messagessyn keyword ngxDirectiveThirdParty push_sender" HTTP Redis Module <http://people.FreeBSD.ORG/~osa/ngx_http_redis-0.3.1.tar.gz>>" Redis <http://code.google.com/p/redis/> support.>syn keyword ngxDirectiveThirdParty redis_bindsyn keyword ngxDirectiveThirdParty redis_buffer_sizesyn keyword ngxDirectiveThirdParty redis_connect_timeoutsyn keyword ngxDirectiveThirdParty redis_next_upstreamsyn keyword ngxDirectiveThirdParty redis_passsyn keyword ngxDirectiveThirdParty redis_read_timeoutsyn keyword ngxDirectiveThirdParty redis_send_timeout" HTTP JavaScript Module <http://wiki.github.com/kung-fu-tzu/ngx_http_js_module>" Embedding SpiderMonkey. Nearly full port on Perl module.syn keyword ngxDirectiveThirdParty jssyn keyword ngxDirectiveThirdParty js_filtersyn keyword ngxDirectiveThirdParty js_filter_typessyn keyword ngxDirectiveThirdParty js_loadsyn keyword ngxDirectiveThirdParty js_maxmemsyn keyword ngxDirectiveThirdParty js_requiresyn keyword ngxDirectiveThirdParty js_setsyn keyword ngxDirectiveThirdParty js_utf8" Log Request Speed <http://wiki.nginx.org/NginxHttpLogRequestSpeed>" Log the time it took to process each request.syn keyword ngxDirectiveThirdParty log_request_speed_filtersyn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule>" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.syn keyword ngxDirectiveThirdParty memc_buffer_sizesyn keyword ngxDirectiveThirdParty memc_cmds_allowedsyn keyword ngxDirectiveThirdParty memc_connect_timeoutsyn keyword ngxDirectiveThirdParty memc_flags_to_last_modifiedsyn keyword ngxDirectiveThirdParty memc_next_upstreamsyn keyword ngxDirectiveThirdParty memc_passsyn keyword ngxDirectiveThirdParty memc_read_timeoutsyn keyword ngxDirectiveThirdParty memc_send_timeoutsyn keyword ngxDirectiveThirdParty memc_upstream_fail_timeoutsyn keyword ngxDirectiveThirdParty memc_upstream_max_fails" Mogilefs Module <http://www.grid.net.ru/nginx/mogilefs.en.html>" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS.syn keyword ngxDirectiveThirdParty mogilefs_connect_timeoutsyn keyword ngxDirectiveThirdParty mogilefs_domainsyn keyword ngxDirectiveThirdParty mogilefs_methodssyn keyword ngxDirectiveThirdParty mogilefs_noverifysyn keyword ngxDirectiveThirdParty mogilefs_passsyn keyword ngxDirectiveThirdParty mogilefs_read_timeoutsyn keyword ngxDirectiveThirdParty mogilefs_send_timeoutsyn keyword ngxDirectiveThirdParty mogilefs_tracker" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite>" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.syn keyword ngxDirectiveThirdParty mp4" Nginx Notice Module <http://xph.us/software/nginx-notice/>" Serve static file to POST requests.syn keyword ngxDirectiveThirdParty noticesyn keyword ngxDirectiveThirdParty notice_type" Phusion Passenger <http://www.modrails.com/documentation.html>" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers.syn keyword ngxDirectiveThirdParty passenger_base_urisyn keyword ngxDirectiveThirdParty passenger_default_usersyn keyword ngxDirectiveThirdParty passenger_enabledsyn keyword ngxDirectiveThirdParty passenger_log_levelsyn keyword ngxDirectiveThirdParty passenger_max_instances_per_appsyn keyword ngxDirectiveThirdParty passenger_max_pool_sizesyn keyword ngxDirectiveThirdParty passenger_pool_idle_timesyn keyword ngxDirectiveThirdParty passenger_rootsyn keyword ngxDirectiveThirdParty passenger_rubysyn keyword ngxDirectiveThirdParty passenger_use_global_queuesyn keyword ngxDirectiveThirdParty passenger_user_switchingsyn keyword ngxDirectiveThirdParty rack_envsyn keyword ngxDirectiveThirdParty rails_app_spawner_idle_timesyn keyword ngxDirectiveThirdParty rails_envsyn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_timesyn keyword ngxDirectiveThirdParty rails_spawn_method" RDS JSON Module <http://github.com/agentzh/rds-json-nginx-module>" Help ngx_drizzle and other DBD modules emit JSON data.syn keyword ngxDirectiveThirdParty rds_jsonsyn keyword ngxDirectiveThirdParty rds_json_content_typesyn keyword ngxDirectiveThirdParty rds_json_formatsyn keyword ngxDirectiveThirdParty rds_json_ret" RRD Graph Module <http://wiki.nginx.org/NginxNgx_rrd_graph>" This module provides an HTTP interface to RRDtool's graphing facilities.syn keyword ngxDirectiveThirdParty rrd_graphsyn keyword ngxDirectiveThirdParty rrd_graph_root" Secure Download <http://wiki.nginx.org/NginxHttpSecureDownload>" Create expiring links.syn keyword ngxDirectiveThirdParty secure_downloadsyn keyword ngxDirectiveThirdParty secure_download_fail_locationsyn keyword ngxDirectiveThirdParty secure_download_path_modesyn keyword ngxDirectiveThirdParty secure_download_secret" SlowFS Cache Module <http://labs.frickle.com/nginx_ngx_slowfs_cache/>" Module adding ability to cache static files.syn keyword ngxDirectiveThirdParty slowfs_big_file_sizesyn keyword ngxDirectiveThirdParty slowfs_cachesyn keyword ngxDirectiveThirdParty slowfs_cache_keysyn keyword ngxDirectiveThirdParty slowfs_cache_min_usessyn keyword ngxDirectiveThirdParty slowfs_cache_pathsyn keyword ngxDirectiveThirdParty slowfs_cache_purgesyn keyword ngxDirectiveThirdParty slowfs_cache_validsyn keyword ngxDirectiveThirdParty slowfs_temp_path" Strip Module <http://wiki.nginx.org/NginxHttpStripModule>" Whitespace remover.syn keyword ngxDirectiveThirdParty strip" Substitutions Module <http://wiki.nginx.org/NginxHttpSubsModule>" A filter module which can do both regular expression and fixed string substitutions on response bodies.syn keyword ngxDirectiveThirdParty subs_filtersyn keyword ngxDirectiveThirdParty subs_filter_types" Supervisord Module <http://labs.frickle.com/nginx_ngx_supervisord/>" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand.syn keyword ngxDirectiveThirdParty supervisordsyn keyword ngxDirectiveThirdParty supervisord_inherit_backend_statussyn keyword ngxDirectiveThirdParty supervisord_namesyn keyword ngxDirectiveThirdParty supervisord_startsyn keyword ngxDirectiveThirdParty supervisord_stop" Upload Module <http://www.grid.net.ru/nginx/upload.en.html>" Parses multipart/form-data allowing arbitrary handling of uploaded files.syn keyword ngxDirectiveThirdParty upload_aggregate_form_fieldsyn keyword ngxDirectiveThirdParty upload_buffer_sizesyn keyword ngxDirectiveThirdParty upload_cleanupsyn keyword ngxDirectiveThirdParty upload_limit_ratesyn keyword ngxDirectiveThirdParty upload_max_file_sizesyn keyword ngxDirectiveThirdParty upload_max_output_body_lensyn keyword ngxDirectiveThirdParty upload_max_part_header_lensyn keyword ngxDirectiveThirdParty upload_passsyn keyword ngxDirectiveThirdParty upload_pass_argssyn keyword ngxDirectiveThirdParty upload_pass_form_fieldsyn keyword ngxDirectiveThirdParty upload_set_form_fieldsyn keyword ngxDirectiveThirdParty upload_storesyn keyword ngxDirectiveThirdParty upload_store_access" Upload Progress Module <http://wiki.nginx.org/NginxHttpUploadProgressModule>" Tracks and reports upload progress.syn keyword ngxDirectiveThirdParty report_uploadssyn keyword ngxDirectiveThirdParty track_uploadssyn keyword ngxDirectiveThirdParty upload_progresssyn keyword ngxDirectiveThirdParty upload_progress_content_typesyn keyword ngxDirectiveThirdParty upload_progress_headersyn keyword ngxDirectiveThirdParty upload_progress_json_outputsyn keyword ngxDirectiveThirdParty upload_progress_template" Upstream Fair Balancer <http://wiki.nginx.org/NginxHttpUpstreamFairModule>" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.syn keyword ngxDirectiveThirdParty fairsyn keyword ngxDirectiveThirdParty upstream_fair_shm_size" Upstream Consistent Hash <http://wiki.nginx.org/NginxHttpUpstreamConsistentHash>" Select backend based on Consistent hash ring.syn keyword ngxDirectiveThirdParty consistent_hash" Upstream Hash Module <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>" Provides simple upstream load distribution by hashing a configurable variable.syn keyword ngxDirectiveThirdParty hashsyn keyword ngxDirectiveThirdParty hash_again" XSS Module <http://github.com/agentzh/xss-nginx-module>" Native support for cross-site scripting (XSS) in an nginx.syn keyword ngxDirectiveThirdParty xss_callback_argsyn keyword ngxDirectiveThirdParty xss_getsyn keyword ngxDirectiveThirdParty xss_input_typessyn keyword ngxDirectiveThirdParty xss_output_type" highlighthi link ngxComment Commenthi link ngxVariable Identifierhi link ngxVariableBlock Identifierhi link ngxVariableString PreProchi link ngxBlock Normalhi link ngxString Stringhi link ngxBoolean Booleanhi link ngxDirectiveBlock Statementhi link ngxDirectiveImportant Typehi link ngxDirectiveControl Keywordhi link ngxDirectiveError Constanthi link ngxDirectiveDeprecated Errorhi link ngxDirective Identifierhi link ngxDirectiveThirdParty Speciallet b:current_syntax = "nginx"EOFecho "au BufRead,BufNewFile /etc/nginx/vhosts/*.conf  set ft=nginx" > ~/.vim/filetype.vim

 


(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜