[root@localhost ~]# yum install apr-devel apr-util-devel -y [root@localhost ~] yum install gcc gcc-c++

[root@localhost ~]# cd /usr/src [root@localhost src]# wget http://archive.apache.org/dist/httpd/httpd-2.2.31.tar.gz [root@localhost src]# tar zxvf httpd-2.2.31.tar.gz [root@localhost src]# cd httpd-2.2.31/ [root@localhost httpd-2.2.31]# ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite

make make install


mysql 5.5 下载方法: https://downloads.mysql.com/archives/community/

注意选择source code .

yum install cmake ncurses-devel ncurses bison -y [root@localhost ~]# pwd /root [root@localhost ~]# tar zxvf mysql-5.5.9.tar.gz [root@localhost ~]# cd mysql-5.5.9/

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql55  \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DMYSQL_DATADIR=/data/mysql \
-DSYSCONFDIR=/etc \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DWITH_XTRADB_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWTTH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EXTRA_CHARSETS=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_BIG_TABLES=1 \
-DWITH_DEBUG=0
make 
make install

[root@localhost mysql55]# cp support-files/my-large.cnf /etc/my.cnf
cp: overwrite ‘/etc/my.cnf’? y
[root@localhost mysql55]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql55]# 

[root@localhost mysql55]# chkconfig --add mysqld
[root@localhost mysql55]# chkconfig --level 35 mysqld on

[root@localhost mysql55]# mkdir -p /data/mysql
[root@localhost mysql55]# useradd mysql
[root@localhost mysql55]#/usr/local/mysql55/scripts/mysql_install_db --user=mysql --datadir=/data/mysql/ --basedir=/usr/local/mysql55/
[root@localhost mysql55]# ln -s /usr/local/mysql55/bin/* /usr/bin/
chmod a+wrx /etc/init.d/mysqld
[root@localhost mysql55]# service mysqld start
Starting MySQL.. SUCCESS! 
[root@localhost mysql55]# 
[root@localhost mysql55]# 

php的安装: [root@localhost mysql55]# cd /usr/src

[root@localhost src]# wget https://www.php.net/distributions/php-5.3.28.tar.bz2 yum -y install bzip2 yum install libxml2* -y

[root@localhost src]# tar jxf php-5.3.28.tar.bz2 [root@localhost src]# cd php-5.3.28/ [root@localhost php-5.3.28]# ll [root@localhost php-5.3.28]# ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local php5/etc --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql55

如果出错, [root@localhost ~]# find / -name apxs /usr/local/apache/bin/apxs /usr/src/httpd-2.2.31/support/apxs [root@localhost ~]#

vi /usr/local/apache/bin/apxs #!/usr/bin/perl -w ####原来为 /replace/with/path/to/perl/interpreter 就可以了。

make make install

===================================

apache 和PHP整合: [root@localhost src]# vi /usr/local/apache/conf/httpd.conf 末尾加上这段:


测试apache和PHP环境 [root@localhost php-5.3.28]# yum install libxml2-devel -y vi /usr/local/apache/htdocs/index.php

填入内容:

<? php phpinfo(); ?>

重启Apache服务,输入IP能访问Php页面代表整合LAMP源码环境成功

[root@localhost php-5.3.28]# systemctl stop firewalld [root@localhost php-5.3.28]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service


discuz php论坛

下载地址: https://www.discuz.net/thread-3457145-1-1.html

传到目录:/usr/local/apache/htdocs

cd /usr/local/apache/htdocs/ mv upload/* .

chmod 757 -R data/ uc_server/ config/ uc_client/

=================================================

进入mysql 建立数据库 mysql -uroot -p

create database discuz charset=utf8; grant all on discuz.* to root@'localhost' identified by '123456'

输入ip 地址就能看到论坛安装界面了。