威尼斯wns.9778官网活动_vnsc威尼斯城官网

热门关键词: 威尼斯wns.9778官网活动,vnsc威尼斯城官网
当前位置:威尼斯wns.9778官网活动 > 计算机教程 > LNMP下添加Discuz 威尼斯wns.9778官网活动x2.5的伪静态

LNMP下添加Discuz 威尼斯wns.9778官网活动x2.5的伪静态

文章作者:计算机教程 上传时间:2019-05-11

打开 LNMP 伪静态文件目录:

安装依赖库和开发环境

复制代码 代码如下:

复制代码 代码如下:

cd /usr/local/nginx/conf

#依赖库和开发工具

新建并编辑 discuzx25.conf 文件:

yum -y install gcc gcc-c autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
#Nginx

复制代码 代码如下:

yum -y install pcre-devel  zlib-devel
#Php

vi discuzx25.conf

yum -y install gd-devel libjpeg-devel libpng-devel freetype-devel libxml2-devel curl-devel freetype-devel
#Mysql

按 i 进入编辑模式,添加下面的代码:

yum -y install bison gcc gcc-c autoconf automake zlib* libxml* ncurses-devel libtool-ltdl-devel* mysql-devel
下载软件包

复制代码 代码如下:

#创建目录

rewrite ^([^.]*)/topic-(. ).html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^.]*)/article-([0-9] )-([0-9] ).html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
rewrite ^([^.]*)/forum-(w )-([0-9] ).html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^([^.]*)/thread-([0-9] )-([0-9] )-([0-9] ).html$ $1/forum.php?mod=viewthread&tid=$2&extra=page=$4&page=$3 last;
rewrite ^([^.]*)/group-([0-9] )-([0-9] ).html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^([^.]*)/space-(username|uid)-(. ).html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^([^.]*)/blog-([0-9] )-([0-9] ).html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
rewrite ^([^.]*)/(fid|tid)-([0-9] ).html$ $1/index.php?action=$2&value=$3 last;
rewrite ^([^.]*)/([a-z] [a-z0-9_]*)-([a-z0-9_-] ).html$ $1/plugin.php?id=$2:$3 last;
if (!-e $request_filename) {
        return 404;
}

mkdir /web

按 Esc 退出编辑模式,输入 :wq 保存退出。

cd /web
#PHP5.3.8

然后进入网站配置文件目录:

wget http://php.net/distributions/php-5.3.8.tar.bz2
#PHP库文件

复制代码 代码如下:

wget http://ncu.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz

cd /usr/local/nginx/conf/vhost

wget http://ncu.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz

编辑对应的网站配置文件,比如 aaa.com.conf

wget http://ncu.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz

复制代码 代码如下:

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
#Nginx1.5.3

vi aaa.com.conf

wget http://www.nginx.org/download/nginx-1.5.3.tar.gz
#Nginx(pcre)

找到配置中的

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.tar.gz

复制代码 代码如下:

如果没有8.13可以这里ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ 下载最新
#Mysql5.5.17

include discuz.conf;

wget http://mysql.mirrors.pair.com/Downloads/MySQL-5.5/mysql-5.5.32.tar.gz

修改为

下载最新的:http://mysql.mirrors.pair.com/Downloads/MySQL-5.5/
#Mysql(cmake)

复制代码 代码如下:

wget http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz

include discuzx25.conf;

安装mysql

保存后,重启 Nginx或LNMP:

复制代码 代码如下:

复制代码 代码如下:

#安装cmake

lnmp restart

tar -zxvf cmake-2.8.6.tar.gz

注:以上是 lnmp 1.2 下的操作。

cd cmake-2.8.6/

./configure

gmake && gmake install  && cd ../
#添加mysql用户

/usr/sbin/groupadd mysql

/usr/sbin/useradd -g mysql mysql

mkdir -p /data/mysql

chown -R mysql:mysql /data/mysql
#安装Mysql

tar -zxvf mysql-5.5.17.tar.gz

cd mysql-5.5.17

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc/

make && make install
#设置Mysql

#在support-files目录中有五个配置信息文件:

#my-small.cnf (内存<=64M)

#my-medium.cnf (内存 128M)

#my-large.cnf (内存 512M)

#my-huge.cnf (内存 1G-2G)

#my-innodb-heavy-4G.cnf (内存 4GB)

cd /usr/local/mysql

cp ./support-files/my-medium.cnf /etc/my.cnf

vi /etc/my.cnf

#在 [mysqld] 段增加

datadir = /data/mysql

wait-timeout = 30

max_connections = 512

default-storage-engine = MyISAM

#在 [mysqld] 段修改

max_allowed_packet = 16M
#生成授权表

cd /usr/local/mysql

./scripts/mysql_install_db --user=mysql
#更改密码

/usr/local/mysql/bin/mysqladmin -u root password 123456
#开启mysql

/usr/local/mysql/bin/mysqld_safe &
#测试连接mysql

/usr/local/mysql/bin/mysql -u root -p 123456

show databases;

exit;
#设置开机启动

vi /etc/rc.d/rc.local
#加入

/usr/local/mysql/bin/mysqld_safe &

可能出现ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

cd /tmp //发现没有

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

cd /var/run/

chown -R mysql mysqld

安装php

复制代码 代码如下:

#1

tar -zxvf libiconv-1.14.tar.gz && cd libiconv-1.14/

./configure --prefix=/usr/local

make && make install && cd ../
#2

tar -zxvf libmcrypt-2.5.8.tar.gz && cd libmcrypt-2.5.8/

./configure &&  make && make install

/sbin/ldconfig && cd libltdl/ && ./configure --enable-ltdl-install

make && make install && cd ../
#3

tar -zxvf mhash-0.9.9.9.tar.gz && cd mhash-0.9.9.9/ && ./configure

make && make install && cd ../
#4

ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la

ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so

ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4

ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8

ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a

ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la

ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so

ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2

ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
#5
tar -zxvf mcrypt-2.6.8.tar.gz &&cd mcrypt-2.6.8/

/sbin/ldconfig

./configure

make && make install && cd ../
#6
tar -xjvf php-5.3.8.tar.bz2

cd php-5.3.8
./configure --prefix=/usr/local/php

--with-config-file-path=/usr/local/php/etc

--with-iconv-dir=/usr/local/ --with-freetype-dir

--with-mysql=/usr/local/mysql

--with-mysqli=/usr/local/mysql/bin/mysql_config

--with-jpeg-dir --with-png-dir --with-zlib

--with-mhash --enable-sockets --enable-ftp

--with-libxml-dir --enable-xml --disable-rpath

本文由威尼斯wns.9778官网活动发布于计算机教程,转载请注明出处:LNMP下添加Discuz 威尼斯wns.9778官网活动x2.5的伪静态

关键词: