LAP:
yum 安装:
yum install -y httpd httpd-devel mysql php-devel php
源码安装:
1)安装 apache
yum -y install apr-devel apr-util-devel
cd /data ; wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.2.27.tar.gz
tar zxf httpd-2.2.27.tar.gz ; cd httpd-2.2.27
./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
make && make install
2)安装 mysql 客户端
yum -y install mysql
3)安装 php
wget http://mirrors.sohu.com/php/php-5.3.28.tar.bz2 ;
tar jxf php-5.3.28.tar.bz2 ; cd php-5.3.28
./configure --prefix=/usr/local/php5
--with-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd
--with-apxs2=/usr/local/apache/bin/apxs
make -j8 && make install -j8
4)修改本地hosts文件
vim /etc/hosts
mysql的IP 设置一个域名
********** 此处的做法有一个好处,就是如果要切换数据库,不需要去配置文件里面修改,直接修改本地的hosts 文件即可
修改 apache 的配置文件:
sed -i -e‘s/AddType application\/x-gzip .gz .tgz/AddType application\/x-gzip .gz .tgz \n AddType application\/x-httpd-php .php/‘ $HTTP_D/conf/httpd.conf
sed -i ‘s/DirectoryIndex\ index.html/DirectoryIndex\ index.php\ index.html/‘ $HTTP_D/conf/httpd.conf
echo "<?php phpinfo();?>" >> /usr/local/apache/htdocs/index.php
通过访问IP,即可访问 PHP 的信息页面
MySQL:
tar zxf mysql-5.1.63.tar.gz ; cd mysql-5.1.63
./configure --prefix=/usr/local/mysql --enable-assembler ; make -j8 && make install -j8
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 345 mysqld on
cd /usr/local/mysql
useradd mysql
chown -R mysql.mysql /usr/local/mysql
./bin/mysql_install_db --user=mysql
chown -R mysql.mysql var
./bin/mysqld_safe --user=mysql &
登陆 mysql 给数据库授权:
./bin/mysql
>create database Discuz ;
>grant all *.* to [email protected]‘%‘ identified by ‘123456‘;
>quit
#################最后,如果要装论坛请继续,否则,可省略###############################
登陆 mysql 给数据库授权:
./bin/mysql
>create database Discuz ;
>grant all Discuz .* to [email protected]‘%‘ identified by ‘123456‘;
>quit
LAP:
下载discuz源码包文件,然后解压:
cd /data ;wget http://download.comsenz.com/DiscuzX/3.1/Discuz_X3.1_SC_UTF8.zip
unzip Discuz_X3.1_SC_UTF8.zip
重命名程序文件:
mv upload/* /usr/local/apache/htdocs/
赋予 discuz 目录完全访问权限:
cd /usr/local/apache/htdocs/
chmod 777 data/ uc_server/ config/ uc_clien
然后访问IP安装discuz论坛,选择“我同意”,然后根据自己需要填写以下信息
安装完成!!!
新手,请多多指教,勿喷^^^^^^