- 论坛徽章:
- 0
|
RH9.0上安装discuz5.5.0论坛
一、安装网站系统平台
1.安装mysql-5.0.41
#groupadd mysql
#useradd -g mysql mysql
#tar zxvf mysql-5.0.41.tar.gz
#cd mysql-5.0.41
#./configure --prefix=/usr/local/mysql --enable-thread-safe-client --enable-local-infile --with-charset=gbk --with-extra-charset=all --with-low-memory
#make
#make install
#cp support-files/my-medium.cnf /etc/my.cnf
#cd /usr/local/mysql
#chown -R mysql .
#chgrp -R mysql .
#bin/mysql_install_db --user=mysql
#chown -R root .
#chown -R mysql var
#bin/mysqld_safe --user=mysql &
#cd /usr/local/src/mysql-5.0.41
#cp support/mysql.server /etc/rc.d/init.d/mysqld
#chmod 700 /etc/rc.d/init.d/mysqld
#chkconfig --add mysqld
#chkconfig --level 345 mysqld on
测试
#/usr/local/mysql/bin/mysqladmin ping
#/usr/local/mysql/bin/mysqladmin version
#/usr/local/mysql/bin/mysql
添加root密码
#/usr/local/mysql/bin/mysqladmin -uroot -p 旧密码 password 新密码
2.安装zlib-1.2.3
#tar zxvf zlib-1.2.3.tar.gz
#cd zlib-1.2.3
#./configure --prefix=/usr/local/zlib
#make
#make install
3.安装openssl-0.9.8e
#tar zxvf openssl-0.9.8e.tar.gz
#cd openssl-0.9.8e
#./config shared zlib
#make
#make test
#make install
mv /usr/bin/openssl /usr/bin/openssl.OFF
mv /usr/include/openssl /usr/include/openssl.OFF
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
配置库文件搜索路径
#echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
#ldconfig -v
4.安装httpd-2.2.4
#tar zxvf httpd-2.2.4.tar.gz
#cd httpd-2.2.4
#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --with-
ssl=/usr/local/ssl --enable-track-vars --enable-rewrite --with-z-dir=/usr/local/zlib --enable-mods
-shared=most
#make
#make install
#echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.local(系统启动时服务自动启动)
5.安装libpng-1.2.14
#tar zxvf libpng-1.2.14.tar.gz
# cd libpng-1.2.14
# cp scripts/makefile.linux makefile
# make (此前要指定zlib的库文件路径到/usr/local/zlib/lib和/usr/local/zlib/include,编辑makefile文件实现)。
# make install
6.安装freetype-2.1.10
# tar -zvxf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# mkdir -p /usr/local/freetype
# ./configure --prefix=/usr/local/freetype
# make;make install
7.安装jpegsrc.v6b
jpeg默认不会自建目录,因此需手动建立目录:
# mkdir -pv /usr/local/jpeg6/{bin,lib,include,man/{,man1},man1}
安装
#tar zxvf jpegsrc.v6b.tar.gz
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
# make
# make install
# make install-lib
8.安装libxml2-2.6.19
# tar -zxf libxml2-2.6.19.tar.gz
# cd libxml2-2.6.19
# mkdir -p /usr/local/libxml2
# ./configure --prefix=/usr/local/libxml2
# make; make install
#cp xml2-config /usr/bin
9.安装GD-2.0.33库
# tar -zvxf gd-2.0.33.tar.gz
# mkdir -p /usr/local/gd2
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6 --with-png=/usr/local/lib --
with-zlib=/usr/local/zlib --with-freetype=/usr/local/freetype
# make; make install
10.安装php-5.2.1
# tar -zvxf php-5.2.1.tar.gz
# mkdir -p /usr/local/php
# cd php-5.2.1
# ./configure --prefix=/usr/local/php (注意使用续行符)
--with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-xml=/usr/local/libxml2
--with-png=/usr/local/lib
--with-jpeg-dir=/usr/local/jpeg6
--with-zlib=/usr/local/zlib
--with-freetype=/usr/local/freetype
--with-gd=/usr/local/gd2
--enable-track-vars
--enable-mbstring=all
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini
11.编辑apache配置文件httpd.conf
# vi /etc/httpd/httpd.conf
要改的有如下几处:
找到LoadModule php5_module modules/libphp5.so
前面的#号去掉(默认已去掉注释)
找到#AddType application/x-gzip .gz .tgz,在其下添加如下二行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
还有找到DirectoryIndex index.html
改为DirectoryIndex index.php index.html
12.测试PHP
# vi /usr/local/apache/htdocs/index.php(其中/usr/local/apache/htdocs为网页主目录)
添加:
重新启动apache服务器
# /usr/local/apache/bin/apachectl restart
访问: http://你的主机IP地址
13.安装ZendOptimizer-3.2.6-linux-glibc21-i386
#tar zxvf ZendOptimizer-3.2.6-linux-glibc21-i386.tar.gz
#cd ZendOptimizer-3.2.6
#./install.sh
接下去按提示输入php.ini文件的位置等即可
二、安装discuz5.5.0论坛
1.获得discuz5.5.0论坛源码
下载地址为:
http://www.discuz.net/download/download.html
建议下载使用简体中文的GBK版本。
2.按其说明将upload文件夹中的文件上传至网站根目录中
此处应为上文中的/usr/local/apache/htdocs
3.修改网站根目录中相关文件的权限
#cd /usr/local/apache/htdocs
#chmod 777 templates
#chmod 777 templates/default
#chmod 777 templates/default/*.*
#chmod 777 attachments
#chmod 777 customavatar
#chmod 777 forumdata
#chmod 777 forumdata/cache
#chmod 777 forumdata/templates
#chmod 777 forumdata/threadcaches
#chmod 777 forumdata/logs
4.修改全局配置文件
#vi config.inc.php
$dbhost = 'localhost'; //数据库服务器,如果是本机,可不做更改
$dbuser = 'dbuser'; //数据库用户名,此处可改为root
$dbpw = 'dbpw'; //数据库密码,即以上用户的密码
$dbname = 'discuz'; //数据库名
$adminemail =
[email='admin@your.com']'admin@your.com'[/email]
; //论坛系统 Email
$dbreport = 0; //是否发送数据库错误报告? 0=否, 1=是
此处可先将其权限更改为666,等论坛安装完毕后再改为原权限
#chmod 666 config.inc.php
5.安装论坛
在你的浏览器输入以下地址即可实现安装了
http://你的linux主机IP/install.php
安装脚本会检查您的服务器系统环境、剩余空间、数据库环境,并具备一定的纠错功能。
6.其它设置
安全起见,安装完成后最好删除install.php文件,并将config.inc.php改为只读
#rm -f install.php
#chmod 444 config.inc.php
三、启用https
1.生成CA的签名及证书
#cd /etc/httpd/
# openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650
Generating a 1024 bit RSA private key
...............................++++++
.....++++++
writing new private key to 'cakey.pem'
Enter PEM pass phrase:
# openssl req -nodes -new -x509 -keyout server.key -out server.crt -days 3650
Generating a 1024 bit RSA private key
..++++++
...................................++++++
writing new private key to 'mysmtp.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:HA
Locality Name (eg, city) []:ZZ
Organization Name (eg, company) [Internet Widgits Pty Ltd]:BENET
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:redhat@benet.org
4.修改证书权限,如果没有此步骤,启动sendmail时会报starttls启动错误
#chmod 400 server.pem
5.修改httpd的配置文件
vi /etc/httpd/httpd.conf
去掉下面两行中第二行的注释
# Secure (SSL/TLS) connections
#Include /etc/httpd/extra/httpd-ssl.conf
6.重启httpd
#/usr/local/apache/bin/apachectl restart
查看监听端口,确认里面有:443端口
#netstat -tnl
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 614/httpd
7.输入类同以下的地址进行访问测试
https://你的linux主机IP
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/24866/showart_313573.html |
|