久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

LANP如何塔建Discuz論壇

共計(jì) 10641 個(gè)字符,預(yù)計(jì)需要花費(fèi) 27 分鐘才能閱讀完成。

丸趣 TV 小編給大家分享一下 LANP 如何塔建 Discuz 論壇,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

LAMP= Linux  Apache  Mysql   PHP/Python

Linux 常指代系統(tǒng),沒有明確規(guī)定版本,如 CentOS/Ubuntu/Debian 等都可以作為服務(wù)器系統(tǒng)

Apache 是 Web 解析的引擎,用于將網(wǎng)頁(yè)源代碼文件處理成瀏覽器可轉(zhuǎn)換的頁(yè)面文件

MySQL 數(shù)據(jù)庫(kù),MySQL 是關(guān)系型數(shù)據(jù)庫(kù),以表的形式來(lái)保存數(shù)據(jù),其中數(shù)據(jù)存儲(chǔ)是以行和列的方式存儲(chǔ)

PHP 是網(wǎng)頁(yè)腳本語(yǔ)言,用于生成頁(yè)面框架,不可單獨(dú)使用,一般作為 Apache 的語(yǔ)言擴(kuò)展(使 Apache 可以支持更多頁(yè)面語(yǔ)言)

- 自定義僅主機(jī)模式,掛載光盤

源碼包上傳到虛擬機(jī)

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33 # 靜態(tài) IP
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.18.6
NETMASK=255.255.255.0
GATEWAY=192.168.18.0
:wq # 退出
[root@localhost ~]# mkdir /media/dvd # 光盤
[root@localhost ~]# mount /dev/cdrom /media/dvd/
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# mkdir /yum.repo.bak
[root@localhost ~]# mv /etc/yum.repos.d/* /yum.repo.bak/
[root@localhost ~]# vim /etc/yum.repos.d/yum.repo
[localyum]
name=yum
baseurl=file:///media/dvd
enabled=1
gpgcheck=0:wq # 退出 

HTTP 安裝:
在服務(wù)端配置本地 yum

 [root@localhost ~]# mkdir /media/dvd
 [root@localhost ~]# mount /dev/cdrom /media/dvd/
 mount: /dev/sr0 is write-protected, mounting read-only
 [root@localhost ~]# cd /etc/yum.repos.d/
 [root@localhost yum.repos.d]# mkdir /yum.repo.bak
 [root@localhost yum.repos.d]# mv * /yum.repo.bak/
 [root@localhost yum.repos.d]# ls
 [root@localhost yum.repos.d]# vim yum.repo
 [localyum]
 name=yum # 名稱
 baseurl=file:///media/dvd # 指定路徑
 enabled=1
 gpgcheck=0
 [root@localhost ~]# yum -y install gcc gcc-c++ # 安裝編譯工具 

LANP 如何塔建 Discuz 論壇

將 httpd 的源碼包上傳到虛擬機(jī)中

[root@localhost ~]# tar zxf httpd-2.2.17.tar.gz -C /usr/src # 解壓到 /usr/src
[root@localhost ~]# cd /usr/src/httpd-2.2.17
[root@localhost httpd-2.2.17]# ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi # 配置 

LANP 如何塔建 Discuz 論壇

 [root@localhost httpd-2.2.17]# make   make install # 編譯 

LANP 如何塔建 Discuz 論壇

[root@localhost ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin # 優(yōu)化路徑
[root@localhost httpd-2.2.17]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd # 添加系統(tǒng)服務(wù)
[root@localhost ~]# vim /etc/init.d/httpd #  添加內(nèi)容到   第 3 第 4 行
#!/bin/sh
#chkconfig:35 25 25 # 第 3 行 35 為開機(jī)順序  25  為運(yùn)行等級(jí)
#description:haha #4 行   注釋為什么都行:wq # 退出
[root@localhost ~]# chkconfig --add httpd

mysql 安裝:

rpm -q mysql-server mysql # 檢查有無(wú)自帶的 mysql 包
package mysql-server is not installed
package mysql is not installed
#這里沒有
mkdir /media/dvd # 掛載光盤
mount /dev/cdrom /media/dvd/
mount: /dev/sr0 is write-protected, mounting read-only
cd /media/dvd/Packages/ # 安裝所需的軟件
rpm -ivh ncurses-devel-5.9-13.20130511.el7.x86_64.rpm 
warning: ncurses-devel-5.9-13.20130511.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
 1:ncurses-devel-5.9-13.20130511.el7################################# [100%]
ls # 找到 cmake 包和 mysql 包安裝的目錄
anaconda-ks.cfg cmake-2.8.6.tar.gz initial-setup-ks.cfg mysql-5.5.22.tar.gz
 tar zxf cmake-2.8.6.tar.gz -C /usr/ # 指定解壓到 /usr 目錄下
 cd /etc/yum.repos.d/ # 需要下載編譯工具所以先配置 yum
 mkdir /yum.repo.bak # 創(chuàng)建存放 yum 原本包的目錄
 mv * /yum.repo.bak/ # 移動(dòng)所有包到新建的目錄
 ls # 查看沒有 1 了
 vim yum.repo # 配置 yum
[localyum]
name=yum # 名稱
baseurl=file:///media/dvd # 路徑
enabled=1
gpgcheck=0
 yum -y install gcc gcc-c++ # 安裝
Complete!
 cd /usr/cmake-2.8.6/
 ./configure

LANP 如何塔建 Discuz 論壇

 gmake   gmake install

LANP 如何塔建 Discuz 論壇

 groupadd mysql
 useradd -M -s /sbin/nologin mysql -g mysql 
 cd 
 tar zxf mysql-5.5.22.tar.gz -C /usr/src/
 cd /usr/src/mysql-5.5.22/
 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFIGDIR=/etc/ -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSET=all

1 指定安裝目錄
2 指定初始化參數(shù)文件目錄、
3 指定默認(rèn)使用的字符集編碼
4 指定字符集校訂規(guī)格
utf8_general_ci 額外的字符集編碼
LANP 如何塔建 Discuz 論壇

 make -j 2   make install -j 2

LANP 如何塔建 Discuz 論壇

 chown -R mysql:mysql /usr/local/mysql/
 rm -rf /etc/my.cnf
 cp support-files/my-medium.cnf /etc/my.cnf
 /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

LANP 如何塔建 Discuz 論壇
# 代表成功了

 echo  PATH=$PATH:/usr/local/mysql/bin    /etc/profile
 . /etc/profile #. 點(diǎn)后有空格
 cp support-files/mysql.server /etc/rc.d/init.d/mysqld
 chmod a+x /etc/rc.d/init.d/mysqld 
 chkconfig --add mysqld

PHP 安裝:

 [root@localhost ~]# rpm -e php php-cli php-ldap php-commom php-mysql --nodeps
 error: package php is not installed
 error: package php-cli is not installed
 error: package php-ldap is not installed
 error: package php-commom is not installed
 error: package php-mysql is not installed
 [root@localhost ~]# cd /media/dvd/Packages/
 [root@localhost Packages]# rpm -ivh libxml2-2.9.1-6.el7_2.3.x86_64.rpm
 warning: libxml2-2.9.1-6.el7_2.3.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
 Preparing... ################################# [100%]
 package libxml2-2.9.1-6.el7_2.3.x86_64 is already installed
 [root@localhost Packages]# rpm -ivh zlib-devel-1.2.7-17.el7.x86_64.rpm
 warning: zlib-devel-1.2.7-17.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
 Preparing... ################################# [100%]
 Updating / installing...
 1:zlib-devel-1.2.7-17.el7 ################################# [100%]
 [root@localhost Packages]# rpm -ivh xz-devel-5.2.2-1.el7.x86_64.rpm
 warning: xz-devel-5.2.2-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
 Preparing... ################################# [100%]
 Updating / installing...
 1:xz-devel-5.2.2-1.el7 ################################# [100%]
 [root@localhost Packages]# rpm -ivh libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm
 warning: libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
 Preparing... ################################# [100%]
 Updating / installing...
 1:libxml2-devel-2.9.1-6.el7_2.3 ################################# [100%]
 [root@localhost Packages]# cd
 [root@localhost ~]# tar zxf libmcrypt-2.5.8.tar.gz -C /usr/src/
 [root@localhost ~]# cd /usr/src/libmcrypt-2.5.8/
 [root@localhost libmcrypt-2.5.8]# ./configure   make   make install
 [root@localhost libmcrypt-2.5.8]# ln -s /usr/local/lib/libmcrypt.* /usr/src/
 [root@localhost libmcrypt-2.5.8]# cd
 [root@localhost ~]# tar zxf mhash-0.9.9.9.tar.gz -C /usr/src/
 [root@localhost ~]# cd /usr/src/mhash-0.9.9.9/
 [root@localhost mhash-0.9.9.9]# ./configure   make   make install
 [root@localhost ~]# tar zxf mcrypt-2.6.8.tar.gz -C /usr/src/
 [root@localhost ~]# cd /usr/src/mcrypt-2.6.8/

直接配置會(huì)報(bào)錯(cuò) 所以先修改一下環(huán)境變量

[root@localhost mcrypt-2.6.8]# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
[root@localhost mcrypt-2.6.8]# ./configure
[root@localhost mcrypt-2.6.8]# make -j 2   make install -j 2
[root@localhost mcrypt-2.6.8]# cd
[root@localhost ~]# tar zxf php-5.3.28.tar.gz -C /usr/src/
[root@localhost ~]# cd /usr/src/php-5.3.28/
[root@localhost php-5.3.28]# ln -s /usr/local/libmhash.* /usr/lib
[root@localhost php-5.3.28]# ./configure --prefix=/usr/local/php5 --with-mcrypt --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php5 --enable-mbstring
--prefix=/usr/local/php5 # 路徑
--with-mcrypt --with-apxs2=/usr/local/httpd/bin/apxs
--with-mysql=/usr/local/mysql #mysql 路徑
--with-config-file-path=/usr/local/php5 # 配置文件路徑
--enable-mbstring # 開啟字符串
creating main/internal_functions.c
creating main/internal_functions_cli.c

+——————————————————————–+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+——————————————————————–+

Thank you for using PHP.

[root@localhost php-5.3.28]# make   make install

LANP 如何塔建 Discuz 論壇

[root@localhost php-5.3.28]# cp /usr/src/php-5.3.28/php.ini-development /usr/local/php5/php.ini
[root@localhost php-5.3.28]# vim /usr/local/php5/php.ini
vim  修改
226 short_open_tag = on # 打開
782 ; PHP s default character set is set to empty.
783 ; http://php.net/default-charset
784 default_charset =  utf-8  # 去掉注釋   改為  “utf-8”:wq  退出
[root@localhost ~]# tar zxf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz -C /usr/src/
[root@localhost ~]# cd /usr/src/ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/
[root@localhost php-5.3.x]# cp ZendGuardLoader.so /usr/local/php5/lib/php/
[root@localhost php-5.3.x]# vim /usr/local/php5/php.ini

增加以下倆行

zend_extension=/usr/local/php5/lib/php/ZendGuardLoader.so
zend_loader.enable=1:wq # 退出
[root@localhost php-5.3.x]# vim /usr/local/httpd/conf/httpd.conf
54  和 168 行進(jìn)行增加和修改
51 # Example:
52 # LoadModule foo_module modules/mod_foo.so
53 LoadModule php5_module modules/libphp5.so
54 AddType application/x-httpd-php .php # 空行新增一行
55 #
163 #
164 # DirectoryIndex: sets the file that Apache will serve if a directory
165 # is requested.
166 #
167  IfModule dir_module 
168 DirectoryIndex index.html index.php # 在此行增加
169  /IfModule:wq # 退出
[root@localhost php-5.3.x]# systemctl restart httpd
[root@localhost php-5.3.x]# systemctl restart mysqld
[root@localhost php-5.3.x]# cd
[root@localhost ~]# vim /usr/local/httpd/htdocs/index.php
 ?php
phpinfo();:wq # 退出
[root@localhost ~]# firefox 192.168.18.6/index.php

訪問成功
LANP 如何塔建 Discuz 論壇

 [root@localhost ~]# cd
 [root@localhost ~]# tar zxf phpMyAdmin-4.2.5-all-languages.tar.gz -C /usr/src/
 [root@localhost ~]# cd /usr/src/
 [root@localhost src]# mv phpMyAdmin-4.2.5-all-languages/ /usr/local/httpd/htdocs/phpMyAdmin
 [root@localhost src]# cd /usr/local/httpd/htdocs/phpMyAdmin/
 [root@localhost phpMyAdmin]# cp config.sample.inc.php config.inc.php
 [root@localhost phpMyAdmin]# mysqladmin -u root -p password  123 
 Enter password:
 [root@localhost phpMyAdmin]# mysql -u root -p
 Enter password:
 Welcome to the MySQL monitor. Commands end with ; or \g.
 Your MySQL connection id is 2
 Server version: 5.5.22-log Source distribution
 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 Oracle is a registered trademark of Oracle Corporation and/or its
 affiliates. Other names may be trademarks of their respective
 owners.
 Type  help;  or  \h  for help. Type  \c  to clear the current input statement.
 mysql  exit
 Bye

LANP 如何塔建 Discuz 論壇

登錄好了點(diǎn)執(zhí)行
LANP 如何塔建 Discuz 論壇

[root@localhost ~]# vim /usr/local/httpd/htdocs/test.php
 ?php
$link=mysql_connect( localhost , root , 123 
if($link) echo  恭喜你,數(shù)據(jù)庫(kù)連接成功!! 
mysql_close();:wq # 退出
[root@localhost ~]# firefox 192.168.18.6/test.php

LANP 如何塔建 Discuz 論壇

[root@localhost ~]# unzip Discuz_7.2_FULL_SC_UTF8.zip
[root@localhost ~]# mv upload/ /usr/local/httpd/htdocs/bbs
[root@localhost ~]# chown -R daemon:daemon /usr/local/httpd/htdocs/bbs/
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# firefox 192.168.18.6/bbs/install

LANP 如何塔建 Discuz 論壇

LANP 如何塔建 Discuz 論壇

LANP 如何塔建 Discuz 論壇

LANP 如何塔建 Discuz 論壇

LANP 如何塔建 Discuz 論壇

LANP 如何塔建 Discuz 論壇

LANP 如何塔建 Discuz 論壇

[root@localhost ~]# netstat -anput | grep httpd
tcp6 0 0 :::80 :::* LISTEN 81067/httpd

LANP 如何塔建 Discuz 論壇

# 如退出進(jìn)來(lái)出現(xiàn)上面現(xiàn)象執(zhí)行下面步驟

[root@localhost ~]# firefox 192.168.18.6/bbs

nginx 和 apache 的區(qū)別

nginx:

優(yōu)點(diǎn):輕量級(jí),對(duì)靜態(tài)文件處理較好,并發(fā)量高

缺點(diǎn):對(duì)動(dòng)態(tài)文件處理時(shí),可能出現(xiàn)問題

nginx 無(wú)法處理 php 文件,但可以找?guī)褪謳退幚?

apache:

優(yōu)點(diǎn):對(duì)動(dòng)態(tài)文件處理較好,穩(wěn)定,安全

缺點(diǎn):服務(wù)臃腫,運(yùn)行效率低

以上是“LANP 如何塔建 Discuz 論壇”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注丸趣 TV 行業(yè)資訊頻道!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-08-25發(fā)表,共計(jì)10641字。
轉(zhuǎn)載說(shuō)明:除特殊說(shuō)明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請(qǐng)注明出處。
評(píng)論(沒有評(píng)論)
主站蜘蛛池模板: 深圳市| 应用必备| 大化| 莲花县| 彰化县| 鄯善县| 井研县| 潼南县| 保定市| 延边| 安溪县| 班戈县| 荣昌县| 奈曼旗| 电白县| 阿坝县| 东乡族自治县| 调兵山市| 高唐县| 周至县| 阳高县| 长春市| 磐石市| 海门市| 蓬莱市| 永丰县| 乐安县| 星座| 哈巴河县| 嘉义市| 禄丰县| 台前县| 榆树市| 柯坪县| 桃江县| 承德市| 德庆县| 策勒县| 浙江省| 贵州省| 方山县|