在LAMP環境下部署Discuz! X論壇

來源:互聯網
上載者:User

標籤:discuz

在LAMP環境下部署Discuz! X論壇


前期準備

[[email protected] 案頭]# yum  -y  install  openssl-devel ncurses-devel libtermcap-devel libxml2-devel

[[email protected] 案頭]# yum  -y  remove  httpd  mysql-server  mysql  php-mysql



1. 安裝 httpd源碼包


[[email protected] 案頭]# tar -zxvf httpd-2.2.25.tar.gz 

[[email protected] 案頭]# cd httpd-2.2.25

[[email protected] httpd-2.2.25]# ./configure  --prefix=/usr/local/httpd \ 

--enable-so --enable-rewrite --enable-cgi \ 

--enable-charset-lite --enable-ssl \ 

--enable-suexec  --with-suexec-caller=daemon  \

--with-suexec-docroot=/usr/local/httpd/htdocs

[[email protected] httpd-2.2.25]#  make && make intsall


建立 httpd 控制指令碼,添加啟動參數

[[email protected] httpd-2.2.25]# cp  -f  /usr/local/httpd/bin/apachectl  /etc/init.d/httpd

[[email protected] httpd-2.2.25]# vim  /etc/init.d/httpd

#!/bin/bash

# chkconfig: 35 85 15

# description: Apache is a World Wide Web Server

......

[[email protected] httpd-2.2.25]# chmod  +x  /etc/init.d/httpd

[[email protected] httpd-2.2.25]# chkconfig  --add  httpd



2. 安裝 mysql源碼包


準備mysql運行賬戶(不建立家目錄  uid為49  不能登入),安裝

[[email protected] httpd-2.2.25]# useradd  -M  -u 49  -s /sbin/nologin  mysql

[[email protected] httpd-2.2.25]# cd /root/案頭

[[email protected] 案頭]# tar-zxvf mysql-5.1.62.tar.gz 

[[email protected] 案頭]# cd  /usr/src/mysql-5.1.62/

[[email protected] mysql-5.1.62]# ./configure  --prefix=/usr/local/mysql \

--with-charset=utf8  --with-collation=utf8_general_ci  --with-extra-charset=gbk,gb2312

[[email protected] mysql-5.1.62]# make && make install


調整目錄許可權,建立mysql設定檔

[[email protected] mysql-5.1.62]#chown  -R root:mysql  /usr/local/mysql/

[[email protected] mysql-5.1.62]#chown  -R mysql  /usr/local/mysql/var/#若無此目錄需自行建立mkdir

[[email protected] mysql-5.1.62]#cp  -f  /usr/local/mysql/share/mysql/my-medium.cnf  /etc/my.cnf

[[email protected] mysql-5.1.62]# vim  /etc/my.cnf

[mysqld]

port            = 3306

socket          = /tmp/mysql.sock

#skip-locking

skip-external-locking

key_buffer_size = 16M

......




添加庫連結,建立 mysqld控制指令碼,添加啟動參數

[[email protected] mysql-5.1.62]# ln  -sf  /usr/local/mysql/bin/*  /usr/local/bin/

[[email protected] mysql-5.1.62]# vim  /etc/ld.so.conf.d/mysql-64.conf

/usr/local/mysql/lib/mysql

[[email protected] mysql-5.1.62]# ldconfig

[[email protected] mysql-5.1.62]#cp  -f  /usr/local/mysql/share/mysql/mysql.server  /etc/init.d/mysqld

[[email protected] mysql-5.1.62]#chmod +x /etc/init.d/mysqld

[[email protected] mysql-5.1.62]#chkconfig --add mysqld 

[[email protected] mysql-5.1.62]# /usr/local/mysql/bin/mysql_install_db  --user=mysql



3. 編譯安裝 php


[[email protected] mysql-5.1.62]# cd /root/案頭

[[email protected] 案頭]# tar -zxvf php-5.4.19.tar.gz 

[[email protected] 案頭]# cd  php-5.4.19

[[email protected] php-5.4.19]# ./configure  --prefix=/usr/local/php \ 

--enable-mbstring  --enable-sockets \ 

--with-apxs2=/usr/local/httpd/bin/apxs  --with-mysql=/usr/local/mysql \ 

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

[[email protected] php-5.4.19]# make && make install


啟用httpd的PHP網頁支援

[[email protected] php-5.4.19]# vim  /usr/local/httpd/conf/httpd.conf

......

LoadModule  php5_module   modules/libphp5.so 

......

ServerName localhost:80

......

<IfModule dir_module>

    DirectoryIndex index.html index.php

</IfModule>

......

    AddType application/x-compress .Z

    AddType application/x-gzip .gz .tgz

    AddType application/x-httpd-php .php

......


啟動mysql 和httpd

[[email protected] php-5.4.19]# service  mysqld  restart

[[email protected] php-5.4.19]# service  httpd  restart


修改mysql密碼,建立mysql資料庫

[[email protected] php-5.4.19]# mysql  -u  root

mysql> SET PASSWORD FOR ‘root‘@‘localhost‘=PASSWORD(‘123456‘);

mysql> CREATE DATABASE bbsdb;  

mysql> GRANT all ON bbsdb.* TO [email protected]   IDENTIFIED BY  ‘admin123‘; 

mysql> quit



4.安裝Discuz! X 論壇程式


[[email protected] php-5.4.19]#cd /root/案頭

[[email protected] 案頭]# unzip  Discuz_X3.0_SC_UTF8.zip  -d  luntan

[[email protected] 案頭]# cp  -rf  luntan/upload/  /usr/local/httpd/htdocs/bbs

[[email protected] bbs]# cd /usr/local/httpd/htdocs/bbs

[[email protected] bbs]# chown  -R  daemon  template/  config/ data/  uc_server/  uc_client/

[[email protected] bbs]# firefox &

訪問: localhost/bbs/install

......

資料庫伺服器:localhost

資料庫使用者名稱:root

資料庫密碼:123456

資料庫名:bbsdb

......


善後處理

[[email protected] bbs]# mv install/  install.lock

[[email protected] bbs]# chmod  600  install.lock/

[[email protected] bbs]# ls -ld install.lock/


firefox訪問:localhost/bbs 


如下:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4D/79/wKioL1RR4KbRouVRAAgamIVV9xI245.jpg" width="720" height="450" title="LAMP+DISCUZ.png" border="0" hspace="0" vspace="0" style="width:720px;height:450px;" alt="wKioL1RR4KbRouVRAAgamIVV9xI245.jpg" />



650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4D/78/wKiom1RR4E-xQqguAAkRJEcBtro041.jpg" width="720" height="450" title="LAMP+DISCUZ2.png" border="0" hspace="0" vspace="0" style="width:720px;height:450px;" alt="wKiom1RR4E-xQqguAAkRJEcBtro041.jpg" />


本文出自 “邀月乘風” 部落格,請務必保留此出處http://yaoyuechengfeng.blog.51cto.com/2958475/1569671

在LAMP環境下部署Discuz! X論壇

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.