`
knight_black_bob
  • 浏览: 841743 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

discuz 搭建(前提lnmp环境)

阅读更多

 

效果图



 

 

32.lnmp 安装(Linux+Apache+MySQL+PHP)

32.1 apache 安装
wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.2.tar.gz
wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.2.32.tar.gz


yum -y install pcre-devel

【No recognized SSL/TLS toolkit detected】
yum install openssl openssl-devel

./configure --prefix=/usr/local/apr 
make && make install

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-rewirte --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
make && make install


vim /etc/httpd/httpd.conf    
在ServerRoot下面添加一行
PidFile "/var/run/httpd.pid"

vim /etc/init.d/httpd

#!/bin/bash
#
# httpd        Startup script for the Apache HTTP Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server.  It is used to serve \
#      HTML files and CGI.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd.pid


# Source function library.
. /etc/rc.d/init.d/functions


if [ -f /etc/sysconfig/httpd ]; then
        . /etc/sysconfig/httpd
fi


# Start httpd in the C locale by default.
HTTPD_LANG=${HTTPD_LANG-"C"}


# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""


# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.


# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/local/apache/bin/apachectl
httpd=${HTTPD-/usr/local/apache/bin/httpd}
prog=httpd
pidfile=${PIDFILE-/var/run/httpd.pid}
lockfile=${LOCKFILE-/var/lock/subsys/httpd}
RETVAL=0


start() {
        echo -n $"Starting $prog: "
        LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        return $RETVAL
}


stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile} -d 10 $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
reload() {
    echo -n $"Reloading $prog: "
    if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
        RETVAL=$?
        echo $"not reloading due to configuration syntax error"
        failure $"not reloading $httpd due to configuration syntax error"
    else
        killproc -p ${pidfile} $httpd -HUP
        RETVAL=$?
    fi
    echo
}


# See how we were called.
case "$1" in
  start)
start
;;
  stop)
stop
;;
  status)
        status -p ${pidfile} $httpd
RETVAL=$?
;;
  restart)
stop
start
;;
  condrestart)
if [ -f ${pidfile} ] ; then
stop
start
fi
;;
  reload)
        reload
;;
  graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
  *)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
exit 1
esac


exit $RETVAL


为此脚本赋予执行权限: chmod +x /etc/rc.d/init.d/httpd
加入服务列表: chkconfig --add httpd
给3,5启动 chkconfig --level  3  httpd on            chkconfig --level  5 httpd on
最后加路径  export PATH=$PATH:/usr/local/apache/bin
vim /etc/profile.d/httpd.sh完成后重新登录就可以了

httpd -k start 
httpd -k stop

/usr/local/apache/bin/apachectl start


32.2 mysql 安装 centos7 yum安装mysql
32.2.1yum安装mysql
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum localinstall -y mysql57-community-release-el7-7.noarch.rpm
yum install -y mysql-community-server
systemctl start mysqld.service
grep 'temporary password' /var/log/mysqld.log  看见密码 
【 Your password does not satisfy the current policy requirements】
set global validate_password_policy=0;
【Your password does not satisfy the current policy requirements】
select @@validate_password_length;
set global validate_password_policy=0
SET PASSWORD = PASSWORD('66666666');
use mysql
update user set host='%' where user='root' and host='localhost';
flush privileges; 
exit

32.2.2 mysql 源码安装
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18.tar.gz
tar xf mysql-5.7.18.tar.gz
mv mysql-5.7.18 mysql

wget https://jaist.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz

 
cmake .  -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
 -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
 -DDEFAULT_CHARSET=utf8 \
 -DDEFAULT_COLLATION=utf8_general_ci \
 -DWITH_INNOBASE_STORAGE_engine=1 \
 -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
 -DMYSQL_DATADIR=/usr/local/mysql/data \
 -DMYSQL_TCP_PORT=3306 \
 -DWITH_BOOST=/usr/local/boost_1_59_0 \
 -DENABLE_DOWNLOADS=1 \
 -DCURSES_INCLUDE_PATH=/usr/include \
 -DCURSES_LIBRARY=/usr/lib64/libncurses.so  

cd /usr/local/mysql/bin
./mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data/ --basedir=/usr/local/mysql --socket=/usr/local/mysql/mysql.sock
cp -a support-files/mysql.server /etc/init.d/mysql
cp -a mysql.server /etc/init.d/mysql
vim /etc/my.cnf
[mysqld] 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

service mysql start
SET PASSWORD = PASSWORD('66666666');
use mysql
update user set host='%' where user='root' and host='localhost';
flush privileges; 
exit




32.3 php 安装
tar xf php-5.6.30.gz
mv php-5.6.30 ../soft/
cd ../soft/php-5.6.30/
yum install libxml2-devel
./configure --prefix=/usr/local/php  --with-apxs2=/usr/local/apache/bin/apxs  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql  

./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--enable-zip --enable-calendar \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql=/usr/local/mysql  \
--with-curl \
--with-gd=/usr/local/gd2 \
--with-png --with-zlib \
--with-freetype \
--enable-soap \
--enable-sockets \
--with-mcrypt=/usr/local/libmcrypt \
--with-mhash \
--with-zlib \
--enable-track-vars \
--enable-ftp \
--with-openssl \
--enable-dba=shared \
--with-libxml-dir \
--with-gettext \
--enable-gd-native-ttf \
--with-openssl \
--enable-mbstring

make && make install

修改 apache2让支持php
vim /etc/httpd/httpd.conf 
添加
LoadModule php5_module     modules/libphp5.so
添加
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
添加 DirectoryIndex
<IfModule dir_module>  
    DirectoryIndex index.html index.php  
</IfModule> 

测试
在/usr/local/apache/htdocs/info.php 创建
<?php

phpinfo();

?>

http://172.23.24.180/info.php

33.discuz 安装
【乱码】
cp php.ini-development  /usr/local/php/lib/php.ini 
vim /usr/local/php/lib/php.ini 
default_charset = "GBK"



wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip
unzip Discuz_X3.2_SC_GBK.zip -d discuz
mv discuz /usr/local/apache/htdocs/

vim /etc/httpd/httpd.conf 
添加上传文件虚拟目录
Alias /forum "/usr/local/apache/htdocs/discuz/upload"
<Directory "/usr/local/apache/htdocs/discuz/upload">
</Directory>

 



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

捐助开发者 

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(支持支付宝和微信 以及扣扣群),没钱捧个人场,谢谢各位。

 

个人主页http://knight-black-bob.iteye.com/



 
 
 谢谢您的赞助,我会做的更好!

  • 大小: 243.9 KB
  • 大小: 323.6 KB
  • 大小: 190.9 KB
0
1
分享到:
评论

相关推荐

    lnmp环境搭建

    lnmp环境搭建 lnmp环境搭建是指Linux、Nginx、MySQL、PHP四大组件的集成环境搭建。lnmp环境是Web开发中最常见的服务器架构之一,广泛应用于各种web应用程序和网站。 lnmp环境搭建的重要性 lnmp环境搭建是Web开发...

    LNMP环境搭建和报错处理

    lnmp环境搭建报错处理 lnmp环境搭建报错处理 lnmp环境搭建报错处理

    shell脚本搭建LNMP环境

    在搭建LNMP环境时,一个完善的shell脚本可以自动安装所有必要的组件,配置相关设置,节省手动操作的时间。 二、Nginx安装与配置 1. 添加Nginx的官方仓库源,通常使用`apt-get`或`yum`进行软件包管理。 2. 使用`apt-...

    源码搭建LNMP环境并安装DISCUZ---有图有真相!!!

    在本文中,我们将详细探讨如何源码搭建LNMP(Linux + Nginx + MySQL + PHP)环境,并在该环境中安装DISCUZ论坛系统。这个过程包括安装必要的依赖、编译和配置各个组件以及最终安装DISCUZ。我们将遵循一系列步骤,...

    lnmp环境源码包搭建

    在本文中,我们将详细讲解如何在Linux系统上通过源码包来搭建LNMP环境。 首先,我们需要确保系统已经安装了必要的依赖包。这些依赖包包括但不限于编译器、库文件和开发工具,例如GCC、Perl、Nginx和MySQL的特定库。...

    搭建lnmp环境所需软件包

    改压缩包是搭建lnmp环境所需软件包,包含nginx, mariadb, php等软件包

    LNMP环境搭建

    LNMP环境搭建详解 LNMP环境搭建是指在Linux操作系统上安装和配置Nginx、MySQL、PHP等软件,以便创建一个功能完善的Web服务器环境。下面是 LNMP环境搭建的详细步骤和知识点总结。 一、LNMP环境架构 LNMP环境由四...

    兄弟连Linux新版视频教程 LAMP+LNMP环境搭建及配置教程笔记

    兄弟连Linux新版视频教程 LAMP+LNMP环境搭建及配置教程笔记

    docker搭建lnmp环境配置

    此资源是使用docker搭建lnmp运行环境的脚本,需要使用docker-compose进行构建

    docker-compose快速搭建lnmp+redis的开发环境

    docker-compose快速搭建lnmp+redis的开发环境

    一键搭建lnmp(nginx+mysql)

    "一键搭建lnmp(nginx+mysql)环境" Lnmp 环境是一种常见的 web 服务器架构,组成部分包括 Nginx web 服务器、Mysql 数据库服务器和 PHP Scripting 语言环境。下面是关于一键搭建 lnmp 环境的知识点总结: 1. ...

    CENTOS8手动部署LNMP环境

    CENTOS8手动部署LNMP环境

    lnmp环境搭建所需要的源码

    至此,LNMP环境已经搭建完成。接下来,你需要配置Nginx以代理PHP请求给PHP-FPM,并创建数据库用户和权限以便网站使用。这些操作可以通过编辑`/usr/local/nginx/conf/nginx.conf`、`/etc/php5/fpm/pool.d/www.conf`...

    Debian 部署LNMP环境SHELL脚本

    Debian 部署LNMP环境SHELL脚本

    LNMP测试环境搭建

    LNMP测试环境的搭建是一个涉及多个组件安装配置的复杂过程,其目的是为了模拟真实的生产环境,以便于开发和测试人员可以在接近生产实际的条件下进行项目部署和性能测试。LNMP代表了Linux、Nginx、MySQL和PHP这四个...

    docker搭建lnmp环境

    # docker搭建lnmp环境 &lt;!-- TOC --&gt; - [docker搭建lnmp环境](#docker搭建lnmp环境) - [一、Dockerfile定制镜像](#一dockerfile定制镜像) - [二、docker-compose](#二docker-compose) - [三、docker-...

Global site tag (gtag.js) - Google Analytics