LAMP平臺搭建+論壇安裝流程(包括遇到的一些問題)
1.安裝包準備:
#cp bao/* /usr/local/scr/lamp
2.安裝Apache httpd-2.4.3.tar.gz
->安裝依賴包:apr-1.4.6.tar.bz2
# tar jxf apr-1.4.6.tar.bz2
#cd apr-1.4.6
#yum install gcc* -y 需要安裝gcc編譯環境
#./configure –prefix=/usr/local/apr
#make && make isntall
#tar jxf apr-util-util-1.5.1
#cd apr-util-1.5.1
#./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr
#make && make install
->安裝httpd-2.4.3.tar.gz
#yum install zlib-devel openssl-devel pcre-devel -y 安裝環境
# tar zxf httpd-2.4.3.tar.gz
#cd httpd-2.4.3
# ./configure –prefix=/usr/local/apache2 –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util/ –enable-module=so –enable-deflate=shared –enable-expires=shared –enable-rewrite=shared –enable-cache –enable-file-cache –enable-men-cache –enable-disk-cache –enable-static-support –enable-static-ab –disable-userdir –with-mpm=prefork –enable-nonportable-atomics –disable-ipv6 –with-senfile
#make && make install
#/usr/local/apache2/bin/apachectl -k start開啟服務
cd /usr/local/apache2/bin/ -> ./apachectl start 開啟Apache服務
cd /usr/local/apache2/bin/ -> ./apachectl stop 關閉Apache服務
#ps -ef | grep httpd 檢視Apache服務的狀態
#ps -aux | grep apache
Warning: bad syntax, perhaps a bogus `-`? See /usr/share/doc/procps-3.2.7/FAQ
root 17844 0.0 0.4 4576 2212 ? Ss 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17852 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17853 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17854 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17855 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17856 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
#killall httpd 關閉http功能
3.MySql原始碼安裝:
#rpm -ivh cmake-2.6.4-7.el5.i386.rpm 安裝cmake編譯包
# groupadd mysql 建立使用者組
# useradd -g mysql mysql 建立使用者
#yum remove mysql-server mysql mysql-devel -y 刪除系統自帶的mysql功能
# mkdir -pv /usr/local/mysql/data 建立使用者資料目錄
mkdir: 已建立目錄 “/usr/local/mysql”
mkdir: 已建立目錄 “/usr/local/mysql/data”
# yum install ncurses-devel -y 編譯安裝時會報錯,提示安裝這個環境包
# tar zxf mysql-5.5.29.tar.gz
# cd mysql-5.5.29
#cmake
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/usr/local/mysql/data/ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DENABLE_LOCAL_INFILE=1
-DEXTAR_CHARSETS=all
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DMYSQL_USER=mysql
-DWITH_DEBUG=0
-DWITH_EMBEDED_SERVER=0
(cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data/ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLE_LOCAL_INFILE=1 -DEXTAR_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_USER=mysql -DWITH_DEBUG=0 -DWITH_EMBEDED_SERVER=0)
#make && make install
#cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
# vim /etc/my.cnf
[mysqld]
port = 3306
socket = /usr/local/mysql/mysql.sock
skip-name-resolve = 1
將mysql的服務啟動項加到/init.d
#cp support-files/mysql.server /etc/init.d/mysqlsource
#chmod 755 /etc/init.d/mysqlsource 修改具有執行許可權
更改檔案目錄的所有者和屬組
#chown -R mysql.mysql /usr/local/mysql/
初始化資料庫
# sh scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data/
將所需的資料、模組連結
#ln -s /usr/local/mysql/bin/* /usr/bin/
#ln -s /usr/local/mysql/lib* /usr/lib/
#ln -s /usr/local/mysql/libexec/* /usr/local/libexec/ 可執行的檔案
#ln -s /usr/local/mysql/share/man/man1/* /usr/share/man/man1
#ln -s /usr/local/mysql/share/man/man8/* /usr/share/man/man8
資料庫啟動
#/etc/init.d/mysqlsource start
檢視資料庫服務的狀態:
# /usr/local/mysql/bin/mysqladmin stauts
4.安裝PHP
->安裝依賴包libiconv-1.14.tar.gz
#tar zxf libiconv-1.14.tar.gz
#cd libiconv-1.14
#./configure –prefix=/usr/local –with-apr=/usr/local/apr
#make && make install
->安裝依賴包libmcrypt-2.5.8.tar.gz
#tar zxf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure && make && make install
# cd libltdl/
#./configure –enable-ltdl-install && make && make install
->安裝依賴包mhash-0.9.9.9.tar.gz和mcrypt-2.6.8.tar.gz
->#tar zxf mhash-0.9.9.9.tar.gz 請注意先後順序和連結檔案操作
#cd mhash-0.9.9.9
#./configure && make && make install
#ln -s /usr/local/lib/* /usr/lib/ 請注意不能重複連結,重複連結會報錯
#ln -s /usr/local/bin/libmcypt-config /usr/bin
->#tar zxf mcrypt-2.6.8.tar.gz
#cd mcrypt-2.6.8
#./configure && make && make install
->安裝php-5.4.11.tar.bz2
#yum install libxml2-devel libpng-devel bzip2-devel curl-devel libjpeg-devel freetype-devel net-snmp-devel -y
# yum install autoconf automake libtool re2c flex bison -y
#tar jxf php-5.4.11.tar.bz2
#cd php-5.4.11
#./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –with-mysql=/usr/local/mysql/ –with-mysqli=/usr/local/mysql/bin/mysql_config –with-pdo-mysql=/usr/local/mysql –with-iconv-dir=/usr/local/ –enable-fpm –with-fpm-user=apache –with-fpm-group=apache –with-pcre-regex –with-zlib –with-bz2 –enable-calendar –disable-phar –with-curl –enable-dba –with-libxml-dir –enable-ftp –with-gd –with-jpeg-dir –with-png-dir –with-zlib-dir –with-freetype-dir –enable-gd-native-ttf –enable-gd-jis-conv –with-mhash –enable-mbstring –with-mcrypt –enable-pcntl –enable-xml –disable-rpath –enable-shmop –enable-sockets –enable-zip –enable-bcmath –with-snmp –disable-ipv6 –disable-rpath –disable-debug –with-apxs2=/usr/local/apache2/bin/apxs
#make ZEND_EXTRA_LIBS=`-liconv`
#make install
(32位系統報錯:找不到libmysqlclient.so.18 。解決問題:#ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/ )
#cp php.ini-production /usr/local/php/etc/php.ini
5.編輯httpd.conf
#vim /usr/local/apache2/conf/httpd.conf
搜尋關鍵字Addtype
新增:Addtype application/x-httpd-php .php
搜尋index.html(DirectoryIndex index.php)
更改為index.html->index.php
#cd /usr/local/apache2/htdocs
刪除index.html
新建一個測試頁面
#vim index.php
<?php
phpinfo();
?>
重新啟動Apache
#kill httpd(不建議使用)
#/usr/local/apache2/bin/apachectl start
6.啟動資料庫
#/etc/init.d/mysqlsource start
排錯:
# /etc/init.d/mysqlsource start
Starting MySQL.The server quit without updating PID file (/usr/local/mysql/data/shen2.pid). [失敗]
# /etc/init.d/mysqlsource status
MySQL is running but PID file could not be found [失敗]
解決辦法:1.# ps aux | grep mysql 列印程式
# kill -9 pid1 pid2 殺死程式
再啟動
2.可能是配置檔案修改出錯引起
#vim /etc/my.cny 預設配置哦
[mysqld]
port =3306
socket =/var/lib/mysql/mysql.sock
7.安裝論壇
#unzip Discuz_7.2_FULL_SC_UTF8.zip
#mv upload/* /usr/local/apache2/htdocs
重新啟動Apache,完成論壇的安裝
瀏覽器輸入ip/install/index.php
配置論壇檔案
#vim /usr/local/php/etc/php.ini
修改:short_open_tag = On
#cd /usr/local/apache2/htdocs
chmod -R 777 *
資料庫使用者名稱:root
資料庫密碼:空
管理員密碼:123456
rpmfind.net 搜尋rpm包網站
#cp bao/* /usr/local/scr/lamp
2.安裝Apache httpd-2.4.3.tar.gz
->安裝依賴包:apr-1.4.6.tar.bz2
# tar jxf apr-1.4.6.tar.bz2
#cd apr-1.4.6
#yum install gcc* -y 需要安裝gcc編譯環境
#./configure –prefix=/usr/local/apr
#make && make isntall
#tar jxf apr-util-util-1.5.1
#cd apr-util-1.5.1
#./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr
#make && make install
->安裝httpd-2.4.3.tar.gz
#yum install zlib-devel openssl-devel pcre-devel -y 安裝環境
# tar zxf httpd-2.4.3.tar.gz
#cd httpd-2.4.3
# ./configure –prefix=/usr/local/apache2 –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util/ –enable-module=so –enable-deflate=shared –enable-expires=shared –enable-rewrite=shared –enable-cache –enable-file-cache –enable-men-cache –enable-disk-cache –enable-static-support –enable-static-ab –disable-userdir –with-mpm=prefork –enable-nonportable-atomics –disable-ipv6 –with-senfile
#make && make install
#/usr/local/apache2/bin/apachectl -k start開啟服務
cd /usr/local/apache2/bin/ -> ./apachectl start 開啟Apache服務
cd /usr/local/apache2/bin/ -> ./apachectl stop 關閉Apache服務
#ps -ef | grep httpd 檢視Apache服務的狀態
#ps -aux | grep apache
Warning: bad syntax, perhaps a bogus `-`? See /usr/share/doc/procps-3.2.7/FAQ
root 17844 0.0 0.4 4576 2212 ? Ss 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17852 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17853 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17854 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17855 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
daemon 17856 0.0 0.3 4576 1716 ? S 11:07 0:00 /usr/local/apache2/bin/httpd -k start
#killall httpd 關閉http功能
3.MySql原始碼安裝:
#rpm -ivh cmake-2.6.4-7.el5.i386.rpm 安裝cmake編譯包
# groupadd mysql 建立使用者組
# useradd -g mysql mysql 建立使用者
#yum remove mysql-server mysql mysql-devel -y 刪除系統自帶的mysql功能
# mkdir -pv /usr/local/mysql/data 建立使用者資料目錄
mkdir: 已建立目錄 “/usr/local/mysql”
mkdir: 已建立目錄 “/usr/local/mysql/data”
# yum install ncurses-devel -y 編譯安裝時會報錯,提示安裝這個環境包
# tar zxf mysql-5.5.29.tar.gz
# cd mysql-5.5.29
#cmake
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/usr/local/mysql/data/ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DENABLE_LOCAL_INFILE=1
-DEXTAR_CHARSETS=all
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DMYSQL_USER=mysql
-DWITH_DEBUG=0
-DWITH_EMBEDED_SERVER=0
(cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data/ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLE_LOCAL_INFILE=1 -DEXTAR_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_USER=mysql -DWITH_DEBUG=0 -DWITH_EMBEDED_SERVER=0)
#make && make install
#cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
# vim /etc/my.cnf
[mysqld]
port = 3306
socket = /usr/local/mysql/mysql.sock
skip-name-resolve = 1
將mysql的服務啟動項加到/init.d
#cp support-files/mysql.server /etc/init.d/mysqlsource
#chmod 755 /etc/init.d/mysqlsource 修改具有執行許可權
更改檔案目錄的所有者和屬組
#chown -R mysql.mysql /usr/local/mysql/
初始化資料庫
# sh scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data/
將所需的資料、模組連結
#ln -s /usr/local/mysql/bin/* /usr/bin/
#ln -s /usr/local/mysql/lib* /usr/lib/
#ln -s /usr/local/mysql/libexec/* /usr/local/libexec/ 可執行的檔案
#ln -s /usr/local/mysql/share/man/man1/* /usr/share/man/man1
#ln -s /usr/local/mysql/share/man/man8/* /usr/share/man/man8
資料庫啟動
#/etc/init.d/mysqlsource start
檢視資料庫服務的狀態:
# /usr/local/mysql/bin/mysqladmin stauts
4.安裝PHP
->安裝依賴包libiconv-1.14.tar.gz
#tar zxf libiconv-1.14.tar.gz
#cd libiconv-1.14
#./configure –prefix=/usr/local –with-apr=/usr/local/apr
#make && make install
->安裝依賴包libmcrypt-2.5.8.tar.gz
#tar zxf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure && make && make install
# cd libltdl/
#./configure –enable-ltdl-install && make && make install
->安裝依賴包mhash-0.9.9.9.tar.gz和mcrypt-2.6.8.tar.gz
->#tar zxf mhash-0.9.9.9.tar.gz 請注意先後順序和連結檔案操作
#cd mhash-0.9.9.9
#./configure && make && make install
#ln -s /usr/local/lib/* /usr/lib/ 請注意不能重複連結,重複連結會報錯
#ln -s /usr/local/bin/libmcypt-config /usr/bin
->#tar zxf mcrypt-2.6.8.tar.gz
#cd mcrypt-2.6.8
#./configure && make && make install
->安裝php-5.4.11.tar.bz2
#yum install libxml2-devel libpng-devel bzip2-devel curl-devel libjpeg-devel freetype-devel net-snmp-devel -y
# yum install autoconf automake libtool re2c flex bison -y
#tar jxf php-5.4.11.tar.bz2
#cd php-5.4.11
#./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –with-mysql=/usr/local/mysql/ –with-mysqli=/usr/local/mysql/bin/mysql_config –with-pdo-mysql=/usr/local/mysql –with-iconv-dir=/usr/local/ –enable-fpm –with-fpm-user=apache –with-fpm-group=apache –with-pcre-regex –with-zlib –with-bz2 –enable-calendar –disable-phar –with-curl –enable-dba –with-libxml-dir –enable-ftp –with-gd –with-jpeg-dir –with-png-dir –with-zlib-dir –with-freetype-dir –enable-gd-native-ttf –enable-gd-jis-conv –with-mhash –enable-mbstring –with-mcrypt –enable-pcntl –enable-xml –disable-rpath –enable-shmop –enable-sockets –enable-zip –enable-bcmath –with-snmp –disable-ipv6 –disable-rpath –disable-debug –with-apxs2=/usr/local/apache2/bin/apxs
#make ZEND_EXTRA_LIBS=`-liconv`
#make install
(32位系統報錯:找不到libmysqlclient.so.18 。解決問題:#ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/ )
#cp php.ini-production /usr/local/php/etc/php.ini
5.編輯httpd.conf
#vim /usr/local/apache2/conf/httpd.conf
搜尋關鍵字Addtype
新增:Addtype application/x-httpd-php .php
搜尋index.html(DirectoryIndex index.php)
更改為index.html->index.php
#cd /usr/local/apache2/htdocs
刪除index.html
新建一個測試頁面
#vim index.php
<?php
phpinfo();
?>
重新啟動Apache
#kill httpd(不建議使用)
#/usr/local/apache2/bin/apachectl start
6.啟動資料庫
#/etc/init.d/mysqlsource start
排錯:
# /etc/init.d/mysqlsource start
Starting MySQL.The server quit without updating PID file (/usr/local/mysql/data/shen2.pid). [失敗]
# /etc/init.d/mysqlsource status
MySQL is running but PID file could not be found [失敗]
解決辦法:1.# ps aux | grep mysql 列印程式
# kill -9 pid1 pid2 殺死程式
再啟動
2.可能是配置檔案修改出錯引起
#vim /etc/my.cny 預設配置哦
[mysqld]
port =3306
socket =/var/lib/mysql/mysql.sock
7.安裝論壇
#unzip Discuz_7.2_FULL_SC_UTF8.zip
#mv upload/* /usr/local/apache2/htdocs
重新啟動Apache,完成論壇的安裝
瀏覽器輸入ip/install/index.php
配置論壇檔案
#vim /usr/local/php/etc/php.ini
修改:short_open_tag = On
#cd /usr/local/apache2/htdocs
chmod -R 777 *
資料庫使用者名稱:root
資料庫密碼:空
管理員密碼:123456
rpmfind.net 搜尋rpm包網站
本文轉自 南非波波 51CTO部落格,原文連結:http://blog.51cto.com/nanfeibobo/1555974,如需轉載請自行聯絡原作者
相關文章
- AWD平臺搭建及遇到的問題分析
- 【ROS教程】安裝ROS全流程及可能遇到的問題ROS
- 安裝kylin遇到的問題
- Laravel 安裝遇到的問題Laravel
- 安裝部署hzero遇到的問題
- PaddleOCR 安裝使用遇到的問題
- 安裝 Laravel Mix 中遇到的問題Laravel
- lumen安裝orangehill/iseed遇到的問題
- Flutter-安裝步驟及安裝遇到的問題Flutter
- 部署LAMP平臺LAMP
- 記錄VMware安裝VMware Tools過程及遇到的一些問題
- windows2003 的安裝以及安裝時遇到的問題Windows
- 【Redis】redis-cluster 安裝遇到的問題Redis
- Centos7安裝greenplum遇到的問題CentOS
- PYTORCH安裝過程以及遇到的問題PyTorch
- python中安裝qtdesigner、pyuic遇到的問題PythonQTUI
- mac11.2安裝air遇到的問題MacAI
- Windows安裝Filebeat遇到問題總結Windows
- 解決macbook安裝burp suite遇到的問題MacUI
- 網路搭建的基本流程包括
- RIDE匯入AutoItLibrary的安裝以及遇到的問題IDE
- 如何安裝discuz論壇,discuz安裝步驟
- 小程式遇到的一些問題
- macbook 下安裝Goglang 以及安裝svn外掛所遇到的問題MacGo
- win10安裝wsl2及nvidia-docker遇到的一些個問題Win10Docker
- 在騰訊雲上安裝mysql遇到的問題MySql
- vue2.x工程安裝遇到的問題解答Vue
- Linux 安裝mysql 5.7.21 可能遇到的問題歸類LinuxMySql
- CentOS7安裝Docker遇到的問題筆記CentOSDocker筆記
- Python安裝cx_Oracle模組遇到的問題PythonOracle
- 搭建TS環境遇到的問題
- Discuz!論壇搭建
- VisualStudio遇到的一些初級問題
- 面試中遇到的一些問題面試
- Docker遇到的一些問題和感想Docker
- python安裝MySQL庫引出的一些問題PythonMySql
- Windows 安裝 Homestead 遇到的一些坑點Windows
- 關於ubuntu安裝中過程遇到問題Ubuntu
- 安裝gcc過程中遇到相互依賴的問題GC