利用LNMP平台构建Discuz!论坛及其他PHP网站.docx_第1页
利用LNMP平台构建Discuz!论坛及其他PHP网站.docx_第2页
利用LNMP平台构建Discuz!论坛及其他PHP网站.docx_第3页
利用LNMP平台构建Discuz!论坛及其他PHP网站.docx_第4页
利用LNMP平台构建Discuz!论坛及其他PHP网站.docx_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

本次部署系统版本:Redhat Enterprise 6/需要的软件包(可能还需要其他依赖软件包,rpm安装即可)mysql-5.0.56.tar.gznginx-1.2.0.tar.gzphp-5.3.10.tar.gz为什么要选择使用nginx?Nginx (engine x) 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日。其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。2011年6月1日,nginx 1.0.4发布。/从/下载软件包,最好不要选择最新的版本。Tar & ./configure & make & make installrootlocalhost nginx-1.2.0# groupadd nginxrootlocalhost nginx-1.2.0# useradd -s /sbin/nologin -M -g nginx nginxrootlocalhost # tar zxvf nginx-1.2.0.tar.gzrootlocalhost # cd nginx-1.2.0rootlocalhost nginx-1.2.0# ./configure -prefix=/usr/local/nginx -user=nginx -group=nginx -with-http_stub_status_module -with-http_ssl_module(会有一系列的依赖关系解决方法下面)-prefix=/usr/local/nginx指定安装 目录-user=nginx指定用户身份-group=nginx指定组身份-with-http_ssl_module启用https支持rootlocalhost nginx-1.2.0# make & make installrootlocalhost nginx-1.2.0# /usr/local/nginx/sbin/nginx(开启服务)rootlocalhost nginx-1.2.0# iptables -I INPUT -p tcp -dport 80 -j ACCEPTNginx web 就可以正常访问了Error ./configure: error: C compiler gcc is not foundrootlocalhost nginx-1.2.0# yum -y install gcc gcc-c+ ./configure: error: the HTTP rewrite module requires the PCRE library.rootlocalhost nginx-1.2.0# yum -y install pcre pcre-devel ./configure: error: SSL modules require the OpenSSL library.rootlocalhost nginx-1.2.0# yum -y install openssl openssl-devel作为一个动态网站开发使用, nginx自身是做不到的, 数据库我们选择用mysqlrootlocalhost # useradd -s /sbin/nologin -M mysqlrootlocalhost # tar zxvf mysql-5.0.56.tar.gzrootlocalhost # cd mysql-5.0.56rootlocalhost mysql-5.0.56# ./configure -prefix=/usr/local/mysqlrootlocalhost mysql-5.0.56# make & make install安装后配置rootlocalhost mysql-5.0.56# cp support-files/f /etc/frootlocalhostmysql-5.0.56#/usr/local/mysql/bin/mysql_install_db -user=mysqlrootlocalhost mysql-5.0.56# chown -R root:mysql /usr/local/mysql/rootlocalhost mysql-5.0.56# chown -R mysql /usr/local/mysql/var/rootlocalhost mysql-5.0.56# echo /usr/local/mysql/lib/mysql/ /etc/ld.so.Confrootlocalhost mysql-5.0.56# ldconfigrootlocalhost mysql-5.0.56# cp support-files/mysql.server /etc/init.d/mysqldrootlocalhost mysql-5.0.56# chmod +x /etc/init.d/mysqldrootlocalhost mysql-5.0.56# chkconfig -add mysqldrootlocalhost mysql-5.0.56# chkconfig mysqld onrootlocalhost mysql-5.0.56# chkconfig -level 35 mysqld onrootlocalhost mysql-5.0.56# service mysqld startStarting MySQL. SUCCESS! rootlocalhost mysql-5.0.56# echo $PATH:/usr/local/mysql/bin/测试rootlocalhost mysql-5.0.56# /usr/local/mysql/bin/mysql -u root -pEnter password: #输入密码mysql show databases;+-+| Database |+-+| information_schema | | mysql | | test | +-+3 rows in set (0.00 sec)mysqlError configure: error: No curses/termcap library foundrootlocalhost mysql-5.0.56# yum -y install libtermcap-develncurses-devel.x86_64 0:5.7-3.20090208.el6 PHP环境rootlocalhost php-5.3.10# tar zxvf php-5.3.10.tar.gzrootlocalhost php-5.3.10# ./configure -prefix=/usr/local/php5 -enable-mbstring -enable-fastcgi -enable-debug -with-mysql=/usr/local/mysql/rootlocalhost php-5.3.10# cd php-5.3.10-prefix=/usr/local/php5指定安装位置-enable-mbstring开启多字符支持-enable-fastcgi启用fastcgi接口 用于和nginx关联-with-mysql=/usr/local/mysql/关联数据库rootlocalhost php-5.3.10# make & make installrootlocalhost php-5.3.10# cp php.ini-production /usr/local/php5/php.ini(配置文件)rootlocalhost bin# /usr/local/php5/bin/php-cgi -b 5566 & #指定端口修改nginx配置文件把下面字段注释去掉,然后修改端口为5566 location .php$ root html; (根目录) fastcgi_pass :5566; fastcgi_index index.php; (默认首页) fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; rootlocalhost conf# cat /usr/local/nginx/logs/nginx.pid 25837rootlocalhost conf# kill 25837rootlocalhost conf# /usr/local/nginx/sbin/nginx #重启nginxrootlocalhost html# vi test.php #测试页面输入00/test.php解决方法:把fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;改成fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;重启nginxError configure: error: xml2-config not found. Please check your libxml2 installation.rootlocalhost php-5.3.10# yum -y install libxml2 libxml2-devel使用lnmp平台来搭建Discuz!论坛rootlocalhost # unzip Discuz_X2_SC_UTF8.zip -d bbsrootlocalhost # unzip UCenter_1.6.0_SC_UTF8.zip -d ucrootlocalhost # cd bbs/rootlocalhost # mv upload/ /usr/local/nginx/html/bbsrootlocal

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论