nginx+apache+php5Word格式文档下载.docx
- 文档编号:20513460
- 上传时间:2023-01-23
- 格式:DOCX
- 页数:17
- 大小:21.73KB
nginx+apache+php5Word格式文档下载.docx
《nginx+apache+php5Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《nginx+apache+php5Word格式文档下载.docx(17页珍藏版)》请在冰豆网上搜索。
tarzxvfmcrypt-2.6.8.tar.gz
cdmcrypt-2.6.8/
tarzxfphp-5.2.14.tar.gz
gzip-cdphp-5.2.14-fpm-0.5.14.diff.gz|patch-dphp-5.2.14-p1
cdphp-5.2.14/
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-iconv-dir=/usr/local--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-discard-path--enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl--with-curlwrappers--enable-mbregex--enable-fastcgi--enable-fpm--enable-force-cgi-redirect--enable-mbstring--with-mcrypt--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets
makeZEND_EXTRA_LIBS='
-liconv'
cpphp.ini-dist/usr/local/php/etc/php.ini
//编译PHP
tarzxvfmemcache-2.2.6.tgz
cdmemcache-2.2.6/
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config
tarjxvfeaccelerator-0.9.6.1.tar.bz2
cdeaccelerator-0.9.6.1/
./configure--enable-eaccelerator=shared--with-php-config=/usr/local/php/bin/php-config
//编译php5扩展模块
Sed-i'
s#extension_dir="
./"
#extension_dir="
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
\nextension="
memcache.so"
\n#'
/usr/local/php/etc/php.ini
sed-i'
s#output_buffering=Off#output_buffering=On#'
//修改php.ini配置
mkdir-p/usr/local/eaccelerator_cache
vi/usr/local/php/etc/php.ini
#按shift+g键跳到配置文件的最末尾,加上以下配置信息:
[eaccelerator]
zend_extension="
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="
128"
eaccelerator.cache_dir="
/usr/local/eaccelerator_cache"
eaccelerator.enable="
1"
eaccelerator.optimizer="
eaccelerator.check_mtime="
eaccelerator.debug="
0"
eaccelerator.filter="
"
eaccelerator.shm_max="
eaccelerator.shm_ttl="
300"
eaccelerator.shm_prune_period="
120"
eaccelerator.shm_only="
press="
press_level="
9"
//配置eAccelerator加速PHP
创建www用户和组
/usr/sbin/groupaddwww
/usr/sbin/useradd-gwwwwww-s/sbin/nologin
创建php-fpm配置文件(php-fpm是为PHP打的一个FastCGI管理补丁,可以平滑变更php.ini配置而无需重启php-cgi):
在/usr/local/php/etc/目录中创建php-fpm.conf文件:
rm-f/usr/local/php/etc/php-fpm.conf
vi/usr/local/php/etc/php-fpm.conf
加入以下内容:
<
?
xmlversion="
1.0"
?
>
configuration>
Allrelativepathsinthisconfigarerelativetophp'
sinstallprefix
<
sectionname="
global_options"
Pidfile
valuename="
pid_file"
/usr/local/php/logs/php-fpm.pid<
/value>
Errorlogfile
error_log"
/usr/local/php/logs/php-fpm-error.log<
Loglevel
log_level"
notice<
WhenthisamountofphpprocessesexitedwithSIGSEGVorSIGBUS...
emergency_restart_threshold"
10<
...inalessthanthisintervaloftime,agracefulrestartwillbeinitiated.
Usefultoworkaroundaccidentalcurruptionsinaccelerator'
ssharedmemory.
emergency_restart_interval"
1m<
Timelimitonwaitingchild'
sreactiononsignalsfrommaster
process_control_timeout"
5s<
Setto'
no'
todebugfpm
daemonize"
yes<
/section>
workers>
pool"
Nameofpool.Usedinlogsandstats.
name"
default<
Addresstoacceptfastcgirequestson.
Validsyntaxis'
ip.ad.re.ss:
port'
orjust'
or'
/path/to/unix/socket'
listen_address"
127.0.0.1:
9000<
listen_options"
Setlisten
(2)backlog
backlog"
-1<
Setpermissionsforunixsocket,ifoneused.
InLinuxread/writepermissionsmustbesetinordertoallowconnectionsfromwebserver.
ManyBSD-derrivedsystemsallowconnectionsregardlessofpermissions.
owner"
group"
mode"
0666<
Additionalphp.inidefines,specifictothispoolofworkers.
php_defines"
sendmail_path"
/usr/sbin/sendmail-t-i<
display_errors"
1<
Unixuserofprocesses
user"
www<
Unixgroupofprocesses
Processmanagersettings
pm"
Setsstyleofcontrolingworkerprocesscount.
Validvaluesare'
static'
and'
apache-like'
style"
static<
Setsthelimitonthenumberofsimultaneousrequeststhatwillbeserved.
EquivalenttoApacheMaxClientsdirective.
EquivalenttoPHP_FCGI_CHILDRENenvironmentinoriginalphp.fcgi
Usedwithanypm_style.
max_children"
128<
Settingsgroupfor'
pmstyle
apache_like"
Setsthenumberofserverprocessescreatedonstartup.
Usedonlywhen'
pm_styleisselected
StartServers"
20<
Setsthedesiredminimumnumberofidleserverprocesses.
MinSpareServers"
5<
Setsthedesiredmaximumnumberofidleserverprocesses.
MaxSpareServers"
35<
Thetimeout(inseconds)forservingasinglerequestafterwhichtheworkerprocesswillbeterminated
Shouldbeusedwhen'
max_execution_time'
inioptiondoesnotstopscriptexecutionforsomereason
'
0s'
means'
off'
request_terminate_timeout"
0s<
Thetimeout(inseconds)forservingofsinglerequestafterwhichaphpbacktracewillbedumpedtoslow.logfile
request_slowlog_timeout"
Thelogfileforslowrequests
slowlog"
logs/slow.log<
Setopenfiledescrlimit
rlimit_files"
51200<
Setmaxcoresizerlimit
rlimit_core"
0<
Chroottothisdirectoryatthestart,absolutepath
chroot"
Chdirtothisdirectoryatthestart,absolutepath
chdir"
Redirectworkers'
stdoutandstderrintomainerrorlog.
Ifnotset,theywillberedirectedto/dev/null,accordingtoFastCGIspecs
catch_workers_output"
Howmuchrequestseachprocessshouldexecutebeforerespawn.
Usefultoworkaroundmemoryleaksin3rdpartylibraries.
Forendlessrequestprocessingpleasespecify0
EquivalenttoPHP_FCGI_MAX_REQUESTS
max_requests"
500<
Commaseparatedlistofipv4addressesofFastCGIclientsthatallowedtoconnect.
EquivalenttoFCGI_WEB_SERVER_ADDRSenvironmentinoriginalphp.fcgi(5.2.2+)
MakessenseonlywithAF_INETlisteningsocket.
allowed_clients"
127.0.0.1<
PassenvironmentvariableslikeLD_LIBRARY_PATH
All$VARIABLEsaretakenfromcurrentenvironment
environment"
HOSTNAME"
$HOSTNAME<
PATH"
/usr/local/bin:
/usr/bin:
/bin<
TMP"
/tmp<
TMPDIR"
TEMP"
OSTYPE"
$OSTYPE<
MACHTYPE"
$MACHTYPE<
MALLOC_CHECK_"
2<
/workers>
/configuration>
启动php-cgi进程,监听127.0.0.1的9000端口,进程数为200(如果服务器内存小于3GB,可以只开启64个进程),用户为www:
ulimit-SHn51200
/usr/local/php/sbin/php-fpmstart
usr/local/php/sbin/php-fpm还有其他参数,
包括:
start|stop|quit|restart|reload|logrotate,
修改php.ini后不重启php-cgi,重新加载配置文件使用reload。
rpm-qa|greppcre
cp/lib/libpcre.so.0/
rpm-e--nodeps`rpm-qa|greppcre`
tarzxvfpcre-8.10.tar.gz
cdpcre-8.10
cp/libpcre.so.0/lib/
make&
&
makeinstall
删除系统自带的pcre库,重新安装Nginx所需的pcre库
tarzxvfnginx-0.8.53.tar.gz
cdnginx-0.8.53/
./configure--user=www--group=www--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module
//安装nginx
mkdir-p/usr/local/nginx/logs
chmod+w/usr/local/nginx/logs
chown-Rwww:
www/usr/local/nginx/logs
//创建Nginx日志目录
在/usr/local/nginx/conf/目录中创建nginx.conf文件
rm-f/usr/local/nginx/conf/nginx.conf
vi/usr/local/nginx/conf/nginx.conf
输入以下内容:
userwwwwww;
w
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- nginx apache php5