CmsTop 大众版运行环境搭建 (CentOS+Nginx+PHP FastCGI)
2014-04-18 14:04
579 查看
一、CentOS5.5操作系统的安装
操作系统这里我们仍采用CentOS5.5来说明Linux下的Nginx安装与配置。关于CentOS的安装与注意事项请大家点击这里:(其中包含配置yum的步骤,因为我们接下来会使用到yum)。
二、准备工作
和Apache的配置相同,我们就来进行一些准备工作,譬如创建网站目录,日志目录等。然后安装服务器的相关软件。
(1)创建网站目录和日志目录
shell>mkdir-p/www/mysql#MySQL数据库文件
shell>mkdir-p/www/htdocs#网站主目录
shell>mkdir-p/var/log/php#PHP日志目录
shell>mkdir-p/var/log/mysql#MySQL日志目录
(2)改变MySQL属主和用户组
shell>chown-Rmysql:mysql/www/mysql
shell>chown-Rmysql:mysql/var/log/mysql
(3)改变网站目录属主和用户组
shell>chown-Rwww:www/www/htdocs
shell>chown-Rwww:www/var/log/php
注:如果mysql等用户不存在,则需要事先通过useradd指令创建。这里我们创建的www用户和用户组,用于Nginx守护进程。
shell>useradd-s/sbin/nologin-Mmysql
#安装系统组件,这些大都是一些编译环境、PHP扩展等等,如果这些都使用源代码安装,那是一个痛苦的过程。
shell>yum-yinstallgccgcc-c++autoconfmake
shell>yum-yinstalllibjpeglibjpeg-devellibpng
libpng-develfreetypefreetype-devellibxml2libxml2-develzlibzlib-devel
glibcglibc-develglib2glib2-develbzip2bzip2-develncursesncurses-devel
curlcurl-devele2fsprogse2fsprogs-develkrb5krb5-devellibidnlibidn-devel
opensslopenssl-developenldapopenldap-developenldap-clientsopenldap-servers
shell>yum-yinstallmysqlmysql-develmysql-server
在安装过程中,我们看到使用了上述我们的非官方源进行更新,通过这种方式安装的软件版本分别为:MySQL5.1.50(截止到2010-09-16)
2.MySQL的启动与基本配置
系统已经安装好了
MySQL数据库,我们来稍作配置后然后启动它,因为初次启动会安装数据库文件,所以要对my.cnf里的配置进行一些修改,尤其是数据库文件存放位置。
#复制一个样本,/usr/share/mysql目录下有好多样本,请自主选择。
shell>cp/usr/share/mysql/my-medium.cnf/etc/my.cnf
修改配置文件,我们稍作修改
#注:是在原有my.cnf基础上进行修改,没有的选项添加
shell>vi/etc/my.cnf
[client]
port=3306
socket=/var/lib/mysql/mysql.sock
default-character-set=utf8
[mysqld]
user=mysql
datadir=/www/mysql
log-error=/var/log/mysql/mysql_error.log
log-bin=/var/log/mysql/mysql-bin
character-set-server=utf8
启动
MySQL,或者使用servicemysqldstart,系统会提示安装数据库,然后启动成功。否则请查看由log-error配置项定义的错误信息。
shell>/etc/init.d/mysqldstart
MySQL初始安装启动后是可以用匿名空密码登陆的,我们需要删除匿名用户,更改root账户密码
shell>mysql
mysql>UPDATEmysql.userSETpassword=PASSWORD(""cmstop"")
WHEREuser=""root"";
mysql>DELETEFROMmysql.userWHEREuser="""";
mysql>FLUSHPRIVILEGES;
#查看MySQL支持插件情况注:这种方式安装的MySQL默认支持
InnoDB,查看该值后面是否为YES
mysql>SHOWVARIABLESLIKE""%have%"";
#查看MySQL字符集,应该都是
utf8
mysql>SHOWVARIABLESLIKE""%char%"";
3.安装Nginx
接下来我们采用源代码的方式安装Nginx+PHP,首先下载程序所需源码包:
shell>cd~
(感谢张宴为大家提供的源码包镜像,原文出处:http://blog.s135.com/nginx_php_v6/)
wgethttp://blog.s135.com/soft/linux/nginx_php/nginx/nginx-0.8.46.tar.gz
wgethttp://blog.s135.com/soft/linux/nginx_php/php/php-5.2.14.tar.gz
wgethttp://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.14-fpm-0.5.14.diff.gz
wgethttp://blog.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.1.tar.gz
wgethttp://blog.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz
wgethttp://blog.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz
wgethttp://blog.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz
wgethttp://blog.s135.com/soft/linux/nginx_php/pcre/pcre-8.10.tar.gz
wgethttp://blog.s135.com/soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz
(1)安装Nginx所需的pcre库
shell>tarzxvfpcre-8.10.tar.gz
shell>cdpcre-8.10/
shell>./configure
shell>make&&makeinstall
shell>cd..
(2)安装Nginx
shell>tarzxvfnginx-0.8.46.tar.gz
shell>cdnginx-0.8.46
shell>./configure--user=www--group=www
--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module
shell>make&&makeinstall
shell>cd..
#做个Nginx的指令软链接,方便我们启动,停止
shell>ln-s/usr/local/nginx/sbin/nginx/usr/sbin/nginx
#Nginx的启动,停止,平滑重启指令。仅限0.8.*系列
shell>nginx-s{reload|start|stop}
Nginx0.8.46我们已经安装好了,直接启动,在浏览器中输入服务器IP。看到了这样的界面是不是有点兴奋了?
4.安装PHP
(1)安装libiconv
shell>cd~
shell>tarzxvflibiconv-1.13.1.tar.gz
shell>cdlibiconv-1.13.1/
shell>./configure--prefix=/usr/local
shell>make&&makeinstall
shell>cd..
(2)安装PHP
shell>tarzxvfphp-5.2.14.tar.gz
shell>gzip-cdphp-5.2.14-fpm-0.5.14.diff.gz|patch-d
php-5.2.14-p1
shell>cdphp-5.2.14/
shell>./configure--prefix=/usr/local/php
--with-config-file-path=/usr/local/php/etc--with-mysql--with-mysqli
--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-gd--enable-gd-native-ttf--with-openssl
--enable-pcntl--enable-sockets--with-ldap--with-ldap-sasl--with-xmlrpc
--enable-zip--enable-soap
shell>makeZEND_EXTRA_LIBS=""-liconv""
(注:这里可能会报错。报未找到liconv,.so库等等。按照下面几种方法解决,再重新makeinstall:
I.errorwhileloadingsharedlibraries:libiconv.so.2.....
shell>vi/etc/ld.so.conf在文件最后加入
/usr/local/lib這一行
shell>ldconfig-v
II.64位操作系统,还可能会报liconv路径不对,尝试以下方法,
shell>ln-s/usr/local/lib/libiconv.so.2
/usr/local/lib64/libiconv.so.2
shell>ln-s/usr/local/lib/libiconv.so.2
/usr/lib64/libiconv.so.2)
shell>makeinstall
shell>cpphp.ini-dist/usr/local/php/etc/php.ini
shell>cd..
(3)安装PDO_mysql扩展
shell>tarzxvfPDO_MYSQL-1.0.2.tgz
shell>cdPDO_MYSQL-1.0.2/
shell>/usr/local/php/bin/phpize
shell>./configure
--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql
shell>make&&makeinstall
shell>cd..
(4)安装ZendOptimizer扩展
下载相应
ZendOptimizer扩展,分别对应32位和64位:
shell>wgethttp://download.cmstop.com/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
shell>wgethttp://download.cmstop.com/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
shell>tarxvzfZendOptimizer-3.3.9...
shell>cp
ZendOptimizer-3.3.9.../data/5_2_x_comp/ZendOptimizer.so
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613
(5)修改php.ini配置文件
shell>vi/usr/local/php/etc/php.ini
查找
extension_dir="./"
修改为
extension_dir=
"/usr/local//php/lib/php/extensions/no-debug-non-zts-20060613/"
查找
cgi.fix_pathinfo=0
以下配置参考修改:
short_open_tag=On
output_buffering=4096
max_execution_time=600
post_max_size=32M
allow_url_fopen=On
open_basedir=/www/htdocs/
upload_max_filesize=32M
log_errors=On
error_reporting=E_ALL&~E_NOTICE|E_STRICT
display_errors=Off
error_log=/var/log/php/php_error.log
magic_quotes_gpc=Off
最后在该文件最后增加以下配置段:
extension="pdo_mysql.so"
[Zend]
zend_extension="/usr/local//php/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so"
zend_optimizer.enable_loader=1
zend_optimizer.optimization_level=0
zend_optimizer.disable_licensing=0
这样,我们的PHP以及相关扩展都已经安装完毕了,接下来我们说明Nginx如何与
PHP进行CGI交互。
三、配置Nginx与PHP(FastCGI)
1.创建php-fpm配置文件
(php-fpm是为PHP打的一个FastCGI管理补丁,可以平滑变更php.ini配置而无需重启php-cgi)
shell>cp/usr/local/php/etc/php-fpm.conf.default
/usr/local/php/etc/php-fpm.conf
shell>vi/usr/local/php/etc/php-fpm.conf
这是一个xml的配置文件,以下用红色标注注意修改的地方,其他则为默认文件配置:
pid_file/usr/local/php/logs/php-fpm.pid
error_log/usr/local/php/logs/php-fpm.log
log_levelnotice
daemonizeyes
listen_address127.0.0.1:9000
display_errors0
userwww
groupwww
max_children32
启动php-cgi进程,监听127.0.0.1的9000端口,进程数为32(进程数自行修改,视服务器配置和Nginx进程数而定),用户为www:
shell>ulimit-SHn65535
shell>/usr/local/php/sbin/php-fpmstart
#我们也创建个PHP的软链接,方便控制
shell>ln-s/usr/local/php/sbin/php-fpm
/usr/sbin/php-fpm
PHP进程的启动,停止,平滑重启方法:
shell>php-fpm{start|stop
|quit|restart|reload|logrotate}
2.修改Nginx配置文件
修改Nginx前,我们先将服务停止,执行:
shell>nginx-sstop
Nginx有和Apache同样的配置文件检测指令,所以在每次修改配置文件后,请检测下语法是否有错误:
shell>nginx-t
以下是配置范例,请参考修改红色部分:
user
wwwwww;
worker_processes4;
error_log/var/log/nginx_error.logcrit;
pid/usr/local/nginx/nginx.pid;
worker_rlimit_nofile65535;
events
{
use
epoll;
worker_connections
65535;
}
http
{
includemime.types;
default_typeapplication/octet-stream;
charsetutf8;
server_names_hash_bucket_size
128;
client_header_buffer_size
32k;
large_client_header_buffers
432k;
client_max_body_size
8m;
sendfile
on;
tcp_nopushon;
keepalive_timeout
60;
tcp_nodelay
on;
fastcgi_connect_timeout
300;
fastcgi_send_timeout
300;
fastcgi_read_timeout
300;
fastcgi_buffer_size
64k;
fastcgi_buffers
464k;
fastcgi_busy_buffers_size
128k;
fastcgi_temp_file_write_size
128k;
gzip
on;
gzip_min_length1k;
gzip_buffers416k;
gzip_http_version
1.0;
gzip_comp_level
2;
gzip_typestext/plainapplication/x-javascript
text/cssapplication/xml;
gzip_vary
on;
ssi
on;
ssi_silent_errors
off;
ssi_types
text/shtml;
server
{
listen80;
server_name
localhost;
index
index.shtmlindex.htmlindex.php;
root/www/htdocs;
location
~.*\.(php|php5)?¥
{
fastcgi_pass127.0.0.1:9000;
fastcgi_index
index.php;
include
fastcgi.conf;
}
location
~.*\.(gif|jpg|jpeg|png|bmp|swf)¥
{
expires30d;
}
location~.*\.(js|css)?¥
{
expires7d;
}
access_log
off;
}
}
以上配置文件启动了4个Nginx进程,指定用户名为www,并且配置了默认的虚拟主机localhost,指向/www/htdocs目录,这个只是方便我们测试用。
3.启动Nginx+PHP
shell>ulimit-SHn65535
shell>php-fpmrestart
shell>nginx
创建phpinfo.php文件测试:
shell>vi/www/htdocs/phpinfo.php
浏览器访问我们的phpinfo.php,看到如此熟悉的身影,这说明我们的PHPCGI已经安装成功,顺便查看是否包含Zend等扩展:
注:因为我们配置了localhost虚拟主机段,这里是通过主机IP访问,如http://192.168.1.190/phpinfo.php
shell>vi/usr/local/nginx/conf/nginx.conf
在http语句段中加入以下几行:
ssion;
ssi_silent_errorsoff;
ssi_typestext/shtml;
重启Nginx服务即可。
你不会想安装在
localhost通过IP地址来访问吧,肯定不想,那我们就简要来说下Nginx下的虚拟主机配置:
编辑配置文件,增加一段
server配置段。(提示:你也可以像Apache一样,写个
includevhosts/*.conf语句)
shell>vi/usr/local/nginx/conf/nginx.conf
#增加一段server
创建网站目录:
shell>mkdir/www/htdocs/demo
2.上传CmsTop大众版程序文件
上传CmsTop大众版至安装目录/www/htdocs/demo目录下,然后我们更改一下网站目录的属主和属组。
shell>chown-Rwww:www/www/htdocs/demo
进入安装界面第二步,查看环境监测配置,如果您是通过Windows环境下绑定hosts文件访问,会发现SSI没有检测成功,这是因为我们配置的www.demo.loc域名并没有通过合法的
DNS进行解析,修改Linux主机的hosts文件可以解决。
shell>vi/etc/hosts
127.0.0.1www.demo.loc
#增加此行
按照环境要求设置相应的目录权限,因为我们刚才已经将整个目录设为www权限,所以只需要更改/index.php这个文件的权限即可:
shell>chmod777/www/htdocs/demo/index.php
恭喜您,您的环境已经完全符合CmsTop大众的安装需求!
4.创建MySQL数据库
shell>mysql-uroot-p
mysql>createdatabasedemo;#创建demo数据库(注:为什么没指定字符集,因为我们已经在配置文件默认设置设置为utf8了)
mysql>GRANTALLPRIVILEGESONdemo.*TO""demo""@""localhost""
IDENTIFIEDBY""cmstop"";#创建
demo数据库的账户
mysql>FLUSHPRIVILEGES;
然后在安装界面的第三步中,填写刚刚创建的数据库信息,测试成功。下一步下一步……
5.CmsTop大众版安装完毕
安装完成后进入后台:http://www.demo.loc/admin
依次进行以下操作:
工具
--文件校验
工具
--更新缓存
内容
--快捷操作--生成首页、生成栏目页、生成内容页
区块
--全部生成
然后预览下我们的前台页面:http://www.demo.loc
Nginx+MySQL+PHP+phpmyadmin+memcache+eaccelerator
ForCentOSLinux
至于为什么要搭建这个平台,我大概就不用多说了,能找到这里来的肯定对Nginx有一定了解。不多说了,直入主题:
本人建议使用CentOS(yum太方便了),其他版本不能通过yum更新的请自行下载下面的包。本人在CentOS5.2和CentOS4.7Server版本中测试均无任何错误,单机30分钟安装完成!
为了方便大家,下面整个过程并不复杂,你只需复制黏贴即可,无需打任何命令!
一,首先升级更新系统各种库(基本完整)
yum-yinstallpatchmakegccgcc-c++autoconfkernel-devellibjpeg
libjpeg-devellibpnglibpng-develfreetypefreetype-devellibxml2libxml2-devel
zlibzlib-develglibcglibc-develglib2glib2-develbzip2bzip2-develncurses
ncurses-develcurlcurl-devele2fsprogse2fsprogs-develkrb5krb5-devellibidn
libidn-developensslopenssl-devel
yum-yinstallfonts-chinesescim-chewingscim-pinyinscim-tables-chinese
二,下载所需软件:
wgethttp://leoz.googlecode.com/files/nginx-0.7.19.tar.gz
wgethttp://leoz.googlecode.com/files/php-5.2.6.tar.gz
wgethttp://leoz.googlecode.com/files/php-5.2.6-fpm-0.5.9.diff.gz
wgethttp://leoz.googlecode.com/files/libiconv-1.12.tar.gz
wgethttp://leoz.googlecode.com/files/libmcrypt-2.5.8.tar.gz
wgethttp://leoz.googlecode.com/files/mcrypt-2.6.7.tar.gz
wgethttp://leoz.googlecode.com/files/memcache-2.2.3.tgz
wgethttp://leoz.googlecode.com/files/mhash-0.9.9.tar.gz
wgethttp://leoz.googlecode.com/files/pcre-7.7.tar.gz
wgethttp://leoz.googlecode.com/files/eaccelerator-0.9.5.3.tar.bz2
wgethttp://leoz.googlecode.com/files/mysql-5.0.22.tar.gz
wgethttp://leoz.googlecode.com/files/phpMyAdmin-3.1.1-all-languages.tar.gz
三,安装PHP环境支持包(就是上面的包)
tarzxvflibiconv-1.12.tar.gz
cdlibiconv-1.12/
./configure--prefix=/usr/local
make
makeinstall
cd../
tarzxvflibmcrypt-2.5.8.tar.gz
cdlibmcrypt-2.5.8/
./configure
make
makeinstall
/sbin/ldconfig
cdlibltdl/
./configure--enable-ltdl-install
make
makeinstall
cdhttp://www.cnblogs.com/
tarzxvfmhash-0.9.9.tar.gz
cdmhash-0.9.9/
./configure
make
makeinstall
cd../
cp/usr/local/lib/libmcrypt.*/usr/lib
ln-s/usr/local/lib/libmhash.so.2/usr/lib/libmhash.so.2
tarzxvfmcrypt-2.6.7.tar.gz
cdmcrypt-2.6.7/
./configure
make
makeinstall
cd../
四,安装Mysql
tar-zxvfmysql-5.0.22.tar.gz
cdmysql-5.0.22
./configure--prefix=/usr/local/webserver/mysql--enable-assembler
--with-charset=utf8--enable-thread-safe-client--with-extra-charsets=all
--without-innodb--without-isam
make;makeinstall
cd../
groupaddmysql
useradd-gmysqlmysql
cp/usr/local/webserver/mysql/share/mysql/my-medium.cnf/etc/my.cnf
/usr/local/webserver/mysql/bin/mysql_install_db--user=mysql
chown-Rmysql/usr/local/webserver/mysql/var
chgrp-Rmysql/usr/local/webserver/mysql/.
cp/usr/local/webserver/mysql/share/mysql/mysql.server/etc/init.d/mysql
chmod755/etc/init.d/mysql
chkconfig--level345mysqlon
echo"/usr/local/mysql/lib/mysql">>/etc/ld.so.conf
echo"/usr/local/lib">>/etc/ld.so.conf
ldconfig
ln-s/usr/local/webserver/mysql/lib/mysql/usr/lib/mysql
ln-s/usr/local/webserver/mysql/include/mysql/usr/include/mysql
servicemysqlstart
/usr/local/mysql/bin/mysqladmin-urootpasswordroot
servicemysqlrestart
servicemysqlstop
五,安装PHP
tarzxvfphp-5.2.8.tar.gz
gzip-cdphp-5.2.8-fpm-0.5.10.diff.gz|patch-dphp-5.2.8-p1
cdphp-5.2.8/
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc
--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config
--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""
makeinstall
cpphp.ini-dist/usr/local/php/etc/php.ini
cd../
make
makeinstall
cpphp.ini-dist/usr/local/php/etc/php.ini
cd../
六,安装配置eaccelerator+memcache
tarzxvfmemcache-2.2.3.tgz
cdmemcache-2.2.3/
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config
make
makeinstall
cd../
tarjxvfeaccelerator-0.9.5.3.tar.bz2
cdeaccelerator-0.9.5.3/
/usr/local/php/bin/phpize
./configure--enable-eaccelerator=shared
--with-php-config=/usr/local/php/bin/php-config
make
makeinstall
cd../
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#""
/usr/local/php/etc/php.ini
mkdir-p/usr/local/eaccelerator_cache
cat>>/usr/local/php/etc/php.ini<<EOF
[eaccelerator]
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="1"
eaccelerator.cache_dir="/usr/local/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys="disk_only"
eaccelerator.sessions="disk_only"
eaccelerator.content="disk_only"
#[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="1"
#eaccelerator.check_mtime="1"
#eaccelerator.debug="0"
#eaccelerator.filter=""
#eaccelerator.shm_max="0"
#eaccelerator.shm_ttl="300"
#eaccelerator.shm_prune_period="120"
#eaccelerator.shm_only="0"
#eaccelerator.compress="1"
#eaccelerator.compress_level="9"
七,创建www用户和用户组,
groupaddwww
useradd-gwwwwww
mkdir-p/web/www
chmod+w/web/www
mkdir-p/web/logs
chmod777/web/logs
chown-Rwww:www/web/www
rm-f/usr/local/php/etc/php-fpm.conf
cpconf/php-fpm.conf/usr/local/php/etc/php-fpm.conf
echo"ulimit-SHn51200">/root/run.sh
echo"/usr/local/php/sbin/php-fpmstart">>/root/run.sh
八,安装Nginx
tarzxvfpcre-7.7.tar.gz
cdpcre-7.7/
./configure
make&&makeinstall
cd../
tarzxvfnginx-0.7.19.tar.gz
cdnginx-0.7.19/
./configure--user=www--group=www--prefix=/usr/local/nginx
--with-http_stub_status_module--with-http_ssl_module
make&&makeinstall
cd../
rm-f/usr/local/nginx/conf/nginx.conf
cpconf/nginx.conf/usr/local/nginx/conf/nginx.conf
sed-i""s/www.xxxx.com/""¥domain""/g""/usr/local/nginx/conf/nginx.conf
rm-f/usr/local/nginx/conf/fcgi.conf
cpconf/fcgi.conf/usr/local/nginx/conf/fcgi.conf
echo"/usr/local/nginx/sbin/nginx">>/root/run.sh
chmod777/root/run.sh
servicemysqlstart
/root/run.sh
九,安装phpmyadmin
tarzxvfphpMyAdmin-3.1.1-all-languages.tar.gz
mvphpMyAdmin-3.1.1-all-languages/web/www/phpmyadmin
十,加入开机自启动
echo"ulimit-SHn51200">>/etc/rc.local
echo"/usr/local/php/sbin/php-fpmstart">>/etc/rc.local
echo"/usr/local/nginx/sbin/nginx">>/etc/rc.local
操作系统这里我们仍采用CentOS5.5来说明Linux下的Nginx安装与配置。关于CentOS的安装与注意事项请大家点击这里:(其中包含配置yum的步骤,因为我们接下来会使用到yum)。
二、准备工作
和Apache的配置相同,我们就来进行一些准备工作,譬如创建网站目录,日志目录等。然后安装服务器的相关软件。
(1)创建网站目录和日志目录
shell>mkdir-p/www/mysql#MySQL数据库文件
shell>mkdir-p/www/htdocs#网站主目录
shell>mkdir-p/var/log/php#PHP日志目录
shell>mkdir-p/var/log/mysql#MySQL日志目录
(2)改变MySQL属主和用户组
shell>chown-Rmysql:mysql/www/mysql
shell>chown-Rmysql:mysql/var/log/mysql
(3)改变网站目录属主和用户组
shell>chown-Rwww:www/www/htdocs
shell>chown-Rwww:www/var/log/php
注:如果mysql等用户不存在,则需要事先通过useradd指令创建。这里我们创建的www用户和用户组,用于Nginx守护进程。
shell>useradd-s/sbin/nologin-Mmysql
二、服务器软件的安装与配置
1.yum安装MySQL#安装系统组件,这些大都是一些编译环境、PHP扩展等等,如果这些都使用源代码安装,那是一个痛苦的过程。
shell>yum-yinstallgccgcc-c++autoconfmake
shell>yum-yinstalllibjpeglibjpeg-devellibpng
libpng-develfreetypefreetype-devellibxml2libxml2-develzlibzlib-devel
glibcglibc-develglib2glib2-develbzip2bzip2-develncursesncurses-devel
curlcurl-devele2fsprogse2fsprogs-develkrb5krb5-devellibidnlibidn-devel
opensslopenssl-developenldapopenldap-developenldap-clientsopenldap-servers
shell>yum-yinstallmysqlmysql-develmysql-server
在安装过程中,我们看到使用了上述我们的非官方源进行更新,通过这种方式安装的软件版本分别为:MySQL5.1.50(截止到2010-09-16)
2.MySQL的启动与基本配置
系统已经安装好了
MySQL数据库,我们来稍作配置后然后启动它,因为初次启动会安装数据库文件,所以要对my.cnf里的配置进行一些修改,尤其是数据库文件存放位置。
#复制一个样本,/usr/share/mysql目录下有好多样本,请自主选择。
shell>cp/usr/share/mysql/my-medium.cnf/etc/my.cnf
修改配置文件,我们稍作修改
#注:是在原有my.cnf基础上进行修改,没有的选项添加
shell>vi/etc/my.cnf
[client]
port=3306
socket=/var/lib/mysql/mysql.sock
default-character-set=utf8
[mysqld]
user=mysql
datadir=/www/mysql
log-error=/var/log/mysql/mysql_error.log
log-bin=/var/log/mysql/mysql-bin
character-set-server=utf8
启动
MySQL,或者使用servicemysqldstart,系统会提示安装数据库,然后启动成功。否则请查看由log-error配置项定义的错误信息。
shell>/etc/init.d/mysqldstart
MySQL初始安装启动后是可以用匿名空密码登陆的,我们需要删除匿名用户,更改root账户密码
shell>mysql
mysql>UPDATEmysql.userSETpassword=PASSWORD(""cmstop"")
WHEREuser=""root"";
mysql>DELETEFROMmysql.userWHEREuser="""";
mysql>FLUSHPRIVILEGES;
#查看MySQL支持插件情况注:这种方式安装的MySQL默认支持
InnoDB,查看该值后面是否为YES
mysql>SHOWVARIABLESLIKE""%have%"";
#查看MySQL字符集,应该都是
utf8
mysql>SHOWVARIABLESLIKE""%char%"";
3.安装Nginx
接下来我们采用源代码的方式安装Nginx+PHP,首先下载程序所需源码包:
shell>cd~
(感谢张宴为大家提供的源码包镜像,原文出处:http://blog.s135.com/nginx_php_v6/)
wget
wget
wget
wget
wget
wget
wget
wget
wget
(1)安装Nginx所需的pcre库
shell>tarzxvfpcre-8.10.tar.gz
shell>cdpcre-8.10/
shell>./configure
shell>make&&makeinstall
shell>cd..
(2)安装Nginx
shell>tarzxvfnginx-0.8.46.tar.gz
shell>cdnginx-0.8.46
shell>./configure--user=www--group=www
--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module
shell>make&&makeinstall
shell>cd..
#做个Nginx的指令软链接,方便我们启动,停止
shell>ln-s/usr/local/nginx/sbin/nginx/usr/sbin/nginx
#Nginx的启动,停止,平滑重启指令。仅限0.8.*系列
shell>nginx-s{reload|start|stop}
Nginx0.8.46我们已经安装好了,直接启动,在浏览器中输入服务器IP。看到了这样的界面是不是有点兴奋了?
4.安装PHP
(1)安装libiconv
shell>cd~
shell>tarzxvflibiconv-1.13.1.tar.gz
shell>cdlibiconv-1.13.1/
shell>./configure--prefix=/usr/local
shell>make&&makeinstall
shell>cd..
(2)安装PHP
shell>tarzxvfphp-5.2.14.tar.gz
shell>gzip-cdphp-5.2.14-fpm-0.5.14.diff.gz|patch-d
php-5.2.14-p1
shell>cdphp-5.2.14/
shell>./configure--prefix=/usr/local/php
--with-config-file-path=/usr/local/php/etc--with-mysql--with-mysqli
--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-gd--enable-gd-native-ttf--with-openssl
--enable-pcntl--enable-sockets--with-ldap--with-ldap-sasl--with-xmlrpc
--enable-zip--enable-soap
shell>makeZEND_EXTRA_LIBS=""-liconv""
(注:这里可能会报错。报未找到liconv,.so库等等。按照下面几种方法解决,再重新makeinstall:
I.errorwhileloadingsharedlibraries:libiconv.so.2.....
shell>vi/etc/ld.so.conf在文件最后加入
/usr/local/lib這一行
shell>ldconfig-v
II.64位操作系统,还可能会报liconv路径不对,尝试以下方法,
shell>ln-s/usr/local/lib/libiconv.so.2
/usr/local/lib64/libiconv.so.2
shell>ln-s/usr/local/lib/libiconv.so.2
/usr/lib64/libiconv.so.2)
shell>makeinstall
shell>cpphp.ini-dist/usr/local/php/etc/php.ini
shell>cd..
(3)安装PDO_mysql扩展
shell>tarzxvfPDO_MYSQL-1.0.2.tgz
shell>cdPDO_MYSQL-1.0.2/
shell>/usr/local/php/bin/phpize
shell>./configure
--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql
shell>make&&makeinstall
shell>cd..
(4)安装ZendOptimizer扩展
下载相应
ZendOptimizer扩展,分别对应32位和64位:
shell>wget
shell>wget
shell>tarxvzfZendOptimizer-3.3.9...
shell>cp
ZendOptimizer-3.3.9.../data/5_2_x_comp/ZendOptimizer.so
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613
(5)修改php.ini配置文件
shell>vi/usr/local/php/etc/php.ini
查找
extension_dir="./"
修改为
extension_dir=
"/usr/local//php/lib/php/extensions/no-debug-non-zts-20060613/"
查找
cgi.fix_pathinfo=0
以下配置参考修改:
short_open_tag=On
output_buffering=4096
max_execution_time=600
post_max_size=32M
allow_url_fopen=On
open_basedir=/www/htdocs/
upload_max_filesize=32M
log_errors=On
error_reporting=E_ALL&~E_NOTICE|E_STRICT
display_errors=Off
error_log=/var/log/php/php_error.log
magic_quotes_gpc=Off
最后在该文件最后增加以下配置段:
extension="pdo_mysql.so"
[Zend]
zend_extension="/usr/local//php/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so"
zend_optimizer.enable_loader=1
zend_optimizer.optimization_level=0
zend_optimizer.disable_licensing=0
这样,我们的PHP以及相关扩展都已经安装完毕了,接下来我们说明Nginx如何与
PHP进行CGI交互。
三、配置Nginx与PHP(FastCGI)
1.创建php-fpm配置文件
(php-fpm是为PHP打的一个FastCGI管理补丁,可以平滑变更php.ini配置而无需重启php-cgi)
shell>cp/usr/local/php/etc/php-fpm.conf.default
/usr/local/php/etc/php-fpm.conf
shell>vi/usr/local/php/etc/php-fpm.conf
这是一个xml的配置文件,以下用红色标注注意修改的地方,其他则为默认文件配置:
pid_file/usr/local/php/logs/php-fpm.pid
error_log/usr/local/php/logs/php-fpm.log
log_levelnotice
daemonizeyes
listen_address127.0.0.1:9000
display_errors0
userwww
groupwww
max_children32
启动php-cgi进程,监听127.0.0.1的9000端口,进程数为32(进程数自行修改,视服务器配置和Nginx进程数而定),用户为www:
shell>ulimit-SHn65535
shell>/usr/local/php/sbin/php-fpmstart
#我们也创建个PHP的软链接,方便控制
shell>ln-s/usr/local/php/sbin/php-fpm
/usr/sbin/php-fpm
PHP进程的启动,停止,平滑重启方法:
shell>php-fpm{start|stop
|quit|restart|reload|logrotate}
2.修改Nginx配置文件
修改Nginx前,我们先将服务停止,执行:
shell>nginx-sstop
Nginx有和Apache同样的配置文件检测指令,所以在每次修改配置文件后,请检测下语法是否有错误:
shell>nginx-t
以下是配置范例,请参考修改红色部分:
user
wwwwww;
worker_processes4;
error_log/var/log/nginx_error.logcrit;
pid/usr/local/nginx/nginx.pid;
worker_rlimit_nofile65535;
events
{
use
epoll;
worker_connections
65535;
}
http
{
includemime.types;
default_typeapplication/octet-stream;
charsetutf8;
server_names_hash_bucket_size
128;
client_header_buffer_size
32k;
large_client_header_buffers
432k;
client_max_body_size
8m;
sendfile
on;
tcp_nopushon;
keepalive_timeout
60;
tcp_nodelay
on;
fastcgi_connect_timeout
300;
fastcgi_send_timeout
300;
fastcgi_read_timeout
300;
fastcgi_buffer_size
64k;
fastcgi_buffers
464k;
fastcgi_busy_buffers_size
128k;
fastcgi_temp_file_write_size
128k;
gzip
on;
gzip_min_length1k;
gzip_buffers416k;
gzip_http_version
1.0;
gzip_comp_level
2;
gzip_typestext/plainapplication/x-javascript
text/cssapplication/xml;
gzip_vary
on;
ssi
on;
ssi_silent_errors
off;
ssi_types
text/shtml;
server
{
listen80;
server_name
localhost;
index
index.shtmlindex.htmlindex.php;
root/www/htdocs;
location
~.*\.(php|php5)?¥
{
fastcgi_pass127.0.0.1:9000;
fastcgi_index
index.php;
include
fastcgi.conf;
}
location
~.*\.(gif|jpg|jpeg|png|bmp|swf)¥
{
expires30d;
}
location~.*\.(js|css)?¥
{
expires7d;
}
access_log
off;
}
}
以上配置文件启动了4个Nginx进程,指定用户名为www,并且配置了默认的虚拟主机localhost,指向/www/htdocs目录,这个只是方便我们测试用。
3.启动Nginx+PHP
shell>ulimit-SHn65535
shell>php-fpmrestart
shell>nginx
创建phpinfo.php文件测试:
shell>vi/www/htdocs/phpinfo.php
浏览器访问我们的phpinfo.php,看到如此熟悉的身影,这说明我们的PHPCGI已经安装成功,顺便查看是否包含Zend等扩展:
注:因为我们配置了localhost虚拟主机段,这里是通过主机IP访问,如http://192.168.1.190/phpinfo.php
四、配置Nginx的服务器端包含SSI
编辑Nginx的配置文件shell>vi/usr/local/nginx/conf/nginx.conf
在http语句段中加入以下几行:
ssion;
ssi_silent_errorsoff;
ssi_typestext/shtml;
重启Nginx服务即可。
五、安装CmsTop大众版
1.配置虚拟主机你不会想安装在
localhost通过IP地址来访问吧,肯定不想,那我们就简要来说下Nginx下的虚拟主机配置:
编辑配置文件,增加一段
server配置段。(提示:你也可以像Apache一样,写个
includevhosts/*.conf语句)
shell>vi/usr/local/nginx/conf/nginx.conf
#增加一段server
server
{
listen80;
server_namewww.demo.loc;
indexindex.shtmlindex.htmlindex.php;
root/www/htdocs/demo;
location~.*\.(php|php5)?¥
{
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
includefastcgi.conf;
}
location~.*\.(gif|jpg|jpeg|png|bmp|swf)¥
{
expires30d;
}
location~.*\.(js|css)?¥
{
expires7d;
}
access_logoff;
}
创建网站目录:
shell>mkdir/www/htdocs/demo
2.上传CmsTop大众版程序文件
上传CmsTop大众版至安装目录/www/htdocs/demo目录下,然后我们更改一下网站目录的属主和属组。
shell>chown-Rwww:www/www/htdocs/demo
进入安装界面第二步,查看环境监测配置,如果您是通过Windows环境下绑定hosts文件访问,会发现SSI没有检测成功,这是因为我们配置的www.demo.loc域名并没有通过合法的
DNS进行解析,修改Linux主机的hosts文件可以解决。
shell>vi/etc/hosts
127.0.0.1www.demo.loc
#增加此行
按照环境要求设置相应的目录权限,因为我们刚才已经将整个目录设为www权限,所以只需要更改/index.php这个文件的权限即可:
shell>chmod777/www/htdocs/demo/index.php
恭喜您,您的环境已经完全符合CmsTop大众的安装需求!
4.创建MySQL数据库
shell>mysql-uroot-p
mysql>createdatabasedemo;#创建demo数据库(注:为什么没指定字符集,因为我们已经在配置文件默认设置设置为utf8了)
mysql>GRANTALLPRIVILEGESONdemo.*TO""demo""@""localhost""
IDENTIFIEDBY""cmstop"";#创建
demo数据库的账户
mysql>FLUSHPRIVILEGES;
然后在安装界面的第三步中,填写刚刚创建的数据库信息,测试成功。下一步下一步……
5.CmsTop大众版安装完毕
安装完成后进入后台:
依次进行以下操作:
工具
--文件校验
工具
--更新缓存
内容
--快捷操作--生成首页、生成栏目页、生成内容页
区块
--全部生成
然后预览下我们的前台页面:http://www.demo.loc
Nginx+MySQL+PHP+phpmyadmin+memcache+eaccelerator
ForCentOSLinux
至于为什么要搭建这个平台,我大概就不用多说了,能找到这里来的肯定对Nginx有一定了解。不多说了,直入主题:
本人建议使用CentOS(yum太方便了),其他版本不能通过yum更新的请自行下载下面的包。本人在CentOS5.2和CentOS4.7Server版本中测试均无任何错误,单机30分钟安装完成!
为了方便大家,下面整个过程并不复杂,你只需复制黏贴即可,无需打任何命令!
一,首先升级更新系统各种库(基本完整)
yum-yinstallpatchmakegccgcc-c++autoconfkernel-devellibjpeg
libjpeg-devellibpnglibpng-develfreetypefreetype-devellibxml2libxml2-devel
zlibzlib-develglibcglibc-develglib2glib2-develbzip2bzip2-develncurses
ncurses-develcurlcurl-devele2fsprogse2fsprogs-develkrb5krb5-devellibidn
libidn-developensslopenssl-devel
yum-yinstallfonts-chinesescim-chewingscim-pinyinscim-tables-chinese
二,下载所需软件:
wget
wget
wget
wget
wget
wget
wget
wget
wget
wget
wget
wget
三,安装PHP环境支持包(就是上面的包)
tarzxvflibiconv-1.12.tar.gz
cdlibiconv-1.12/
./configure--prefix=/usr/local
make
makeinstall
cd../
tarzxvflibmcrypt-2.5.8.tar.gz
cdlibmcrypt-2.5.8/
./configure
make
makeinstall
/sbin/ldconfig
cdlibltdl/
./configure--enable-ltdl-install
make
makeinstall
cd
tarzxvfmhash-0.9.9.tar.gz
cdmhash-0.9.9/
./configure
make
makeinstall
cd../
cp/usr/local/lib/libmcrypt.*/usr/lib
ln-s/usr/local/lib/libmhash.so.2/usr/lib/libmhash.so.2
tarzxvfmcrypt-2.6.7.tar.gz
cdmcrypt-2.6.7/
./configure
make
makeinstall
cd../
四,安装Mysql
tar-zxvfmysql-5.0.22.tar.gz
cdmysql-5.0.22
./configure--prefix=/usr/local/webserver/mysql--enable-assembler
--with-charset=utf8--enable-thread-safe-client--with-extra-charsets=all
--without-innodb--without-isam
make;makeinstall
cd../
groupaddmysql
useradd-gmysqlmysql
cp/usr/local/webserver/mysql/share/mysql/my-medium.cnf/etc/my.cnf
/usr/local/webserver/mysql/bin/mysql_install_db--user=mysql
chown-Rmysql/usr/local/webserver/mysql/var
chgrp-Rmysql/usr/local/webserver/mysql/.
cp/usr/local/webserver/mysql/share/mysql/mysql.server/etc/init.d/mysql
chmod755/etc/init.d/mysql
chkconfig--level345mysqlon
echo"/usr/local/mysql/lib/mysql">>/etc/ld.so.conf
echo"/usr/local/lib">>/etc/ld.so.conf
ldconfig
ln-s/usr/local/webserver/mysql/lib/mysql/usr/lib/mysql
ln-s/usr/local/webserver/mysql/include/mysql/usr/include/mysql
servicemysqlstart
/usr/local/mysql/bin/mysqladmin-urootpasswordroot
servicemysqlrestart
servicemysqlstop
五,安装PHP
tarzxvfphp-5.2.8.tar.gz
gzip-cdphp-5.2.8-fpm-0.5.10.diff.gz|patch-dphp-5.2.8-p1
cdphp-5.2.8/
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc
--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config
--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""
makeinstall
cpphp.ini-dist/usr/local/php/etc/php.ini
cd../
make
makeinstall
cpphp.ini-dist/usr/local/php/etc/php.ini
cd../
六,安装配置eaccelerator+memcache
tarzxvfmemcache-2.2.3.tgz
cdmemcache-2.2.3/
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config
make
makeinstall
cd../
tarjxvfeaccelerator-0.9.5.3.tar.bz2
cdeaccelerator-0.9.5.3/
/usr/local/php/bin/phpize
./configure--enable-eaccelerator=shared
--with-php-config=/usr/local/php/bin/php-config
make
makeinstall
cd../
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#""
/usr/local/php/etc/php.ini
mkdir-p/usr/local/eaccelerator_cache
cat>>/usr/local/php/etc/php.ini<<EOF
[eaccelerator]
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="1"
eaccelerator.cache_dir="/usr/local/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys="disk_only"
eaccelerator.sessions="disk_only"
eaccelerator.content="disk_only"
#[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="1"
#eaccelerator.check_mtime="1"
#eaccelerator.debug="0"
#eaccelerator.filter=""
#eaccelerator.shm_max="0"
#eaccelerator.shm_ttl="300"
#eaccelerator.shm_prune_period="120"
#eaccelerator.shm_only="0"
#eaccelerator.compress="1"
#eaccelerator.compress_level="9"
七,创建www用户和用户组,
groupaddwww
useradd-gwwwwww
mkdir-p/web/www
chmod+w/web/www
mkdir-p/web/logs
chmod777/web/logs
chown-Rwww:www/web/www
rm-f/usr/local/php/etc/php-fpm.conf
cpconf/php-fpm.conf/usr/local/php/etc/php-fpm.conf
echo"ulimit-SHn51200">/root/run.sh
echo"/usr/local/php/sbin/php-fpmstart">>/root/run.sh
八,安装Nginx
tarzxvfpcre-7.7.tar.gz
cdpcre-7.7/
./configure
make&&makeinstall
cd../
tarzxvfnginx-0.7.19.tar.gz
cdnginx-0.7.19/
./configure--user=www--group=www--prefix=/usr/local/nginx
--with-http_stub_status_module--with-http_ssl_module
make&&makeinstall
cd../
rm-f/usr/local/nginx/conf/nginx.conf
cpconf/nginx.conf/usr/local/nginx/conf/nginx.conf
sed-i""s/www.xxxx.com/""¥domain""/g""/usr/local/nginx/conf/nginx.conf
rm-f/usr/local/nginx/conf/fcgi.conf
cpconf/fcgi.conf/usr/local/nginx/conf/fcgi.conf
echo"/usr/local/nginx/sbin/nginx">>/root/run.sh
chmod777/root/run.sh
servicemysqlstart
/root/run.sh
九,安装phpmyadmin
tarzxvfphpMyAdmin-3.1.1-all-languages.tar.gz
mvphpMyAdmin-3.1.1-all-languages/web/www/phpmyadmin
十,加入开机自启动
echo"ulimit-SHn51200">>/etc/rc.local
echo"/usr/local/php/sbin/php-fpmstart">>/etc/rc.local
echo"/usr/local/nginx/sbin/nginx">>/etc/rc.local
相关文章推荐
- CmsTop 大众版运行环境搭建 (CentOS+Nginx+PHP FastCGI)
- CmsTop 大众版运行环境搭建 (CentOS+Nginx+PHP FastCGI)
- CentOS 5.5安装Nginx、PHP(FastCGI)、MySQL --搭建LNMP环境安装Wordpress
- CentOS 5.5安装Nginx、PHP(FastCGI)、MySQL --搭建LNMP环境安装Wordpress、Discuz
- centos LNMP第一部分环境搭建 LAMP LNMP安装先后顺序 php安装 安装nginx 编写nginx启动脚本 懒汉模式 mv /usr/php/{p.conf.default,p.conf} php运行方式SAPI介绍 第二十三节课
- CentOS 7 上编译安装Nginx,搭建PHP运行环境。
- 在CentOS 7 64位操作系统环境下搭建LNMP(Linux+Nginx+MySQL+PHP)来运行Zabbix监控程序
- CentOS5.5安装Nginx、PHP(FastCGI)、MySQL --搭建LNMP环境安装wordpress
- centos 6.4下nginx+uwsgi+flask的运行环境搭建
- Cacti监控服务器配置教程(基于CentOS+Nginx+MySQL+PHP环境搭建)
- Win2012 R2 IIS8.5+PHP(FastCGI)+MySQL运行环境搭建教程
- 在阿里云 CentOS 服务器(ECS)上搭建 nginx + mysql + php-fpm 环境
- 基于CentOS 6.8平台最新源代码包编译安装LNMP环境搭建(Nginx+MySQL+PHP)
- 基于centos搭建nginx+uwsgi运行django环境
- 自己动手搭建Nginx+memcache+xdebug+php运行环境绿色版 For windows版
- CentOS使用YUM安装php运行环境,包含php,php-fpm,nginx,mysql
- Linux(CentOS 7)+ Nginx(1.10.2)+ Mysql(5.7.16)+ PHP(7.0.12)完整环境搭建
- 在阿里云 CentOS服务器上搭建nginx+mysql+php环境
- CentOS搭建php运行环境