分类: LINUX
2009-08-08 16:11:56
1.下载所需的软件
linux:CENTOS5.2
mysql:mysql-5.0.84
apache:httpd-2.2.12
php:php-5.2.10
Discuz:Discuz6.0.0SCUTF8
http://www.comsenz.com/products/discuz
2.安装MySQL5
#2.1安装ncurses-devel 包(一般默认都已安装上)
2.2安装gcc-c++ 包(一般默认都已安装上)
2.3解压
查看INSTALL-SOURCE文件查看安装步骤
[root@localhost upload]#tar zxvf mysql-5.0.84.tar.gz
2.4创建用户
[root@localhost upload]# useradd mysql
[root@localhost upload]# passwd mysql
2.5编译安装
[root@localhost upload]# ./configure --prefix=/opt/mysql5
[root@localhost upload]# make
[root@localhost upload]# make install
2.6拷贝文件,改权限
[root@localhost mysql-5.0.51]# cp support-files/my-medium.cnf /etc/my.cnf
[root@localhost mysql-5.0.51]# cd /opt/mysql5/
[root@localhost mysql5]# chown -R mysql:mysql .
[root@localhost mysql5]# bin/mysql_install_db --user=mysql
[root@localhost mysql5]# chown -R root .
[root@localhost mysql5]# chown -R mysql var
2.7启动查看
[root@localhost mysql5]# bin/mysqld_safe --user=mysql &
[root@localhost mysql5]# ps -ef | grep mysql
[root@localhost bin]# ./mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.84-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.01 sec)
mysql> quit
Bye
2.8关闭
[root@localhost bin]# ./mysqladmin shutdown
[root@localhost mysql5]# ps -ef | grep mysql
3.安装apache和php
看php安装文档
3.1解压
[root@localhost upload]# tar zxvf httpd-2.2.12.tar.gz
[root@localhost upload]# tar zxvf php-5.2.10.tar.gz
3.2安装apache
[root@localhost upload]# httpd-2.2.12/configure --enable-so --prefix=/opt/www
--enable-so 作用:保证php编译时以动态模块的形式运行在apache中
[root@localhost upload]# make
[root@localhost upload]# make install
3.3安装php
[root@localhost upload]# rpm -ivh libxml2-2.6.26-2.1.2.i386.rpm
[root@localhost upload]# rpm -ivh zlib-devel-1.2.3-3.i386.rpm
[root@localhost upload]# rpm -ivh libxml2-devel-2.6.26-2.1.2.i386.rpm
以上三个包默认都已安装上要是没有安装在 .iso安装包里提取后安装上就好了
[root@localhost upload]# php-5.2.10/configure --with-apxs2=/opt/www/bin/apxs --with-mysql=/opt/mysql5
[root@localhost upload]# make
[root@localhost upload]# make install
3.4查看是否安装成功
进入/opt/www/modules是否有libphp5.so
3.5拷文件
[root@localhost upload]# cp php-5.2.10/php.ini-dist /usr/local/lib/php.ini
3.6修改/opt/www/conf中的httpd.conf文件:
添加AddType application/x-httpd-php .php .phtml
3.7启动
/opt/www/bin/apachectl start
如果碰到这样的错误,关掉selinux就可以了(setenforce 0)
httpd: Syntax error on line 53 of /opt/www/conf/httpd.conf: Cannot load /opt/www/modules/libphp5.so into server: /opt/www/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
3.8测试
在/opt/www/htdocs目录下新建一个test.php
vi test.php
输入以下内容
phpinfo();
?>
浏览器
修改php配置文件在/usr/local/lib中
upload_max_filesize = 2M(上传附件限制大小随意改)
post_max_size = 8M
要是改的上传附件比较大要把time超时改的比较大
详细介绍:请看
修改php配置文件在/usr/local/lib中
upload_max_filesize = 2M(上传附件限制大小随意改)
post_max_size = 8M
要是改的上传附件比较大要把time超时改的比较大
这样基本上就完成了LAMP环境接下来安装论坛软件:
setenforce 0
启动mysql
show databases;
创建数据库create database hht;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hht |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
添加一个帐号
mysql> GRANT ALL PRIVILEGES ON *.* TO
mysql> IDENTIFIED BY 'haohaotmac' with grant option;
mysql> quit
运行apache
/opt/www/bin/apachectl start
[root@mylinux bbs]# ps -ef | grep http
root 5338 1 0 Aug02 ? 00:00:01 /opt/www/bin/httpd -k start
daemon 5339 5338 0 Aug02 ? 00:00:01 /opt/www/bin/httpd -k start
daemon 5340 5338 0 Aug02 ? 00:00:00 /opt/www/bin/httpd -k start
daemon 5341 5338 0 Aug02 ? 00:00:04 /opt/www/bin/httpd -k start
daemon 5342 5338 0 Aug02 ? 00:00:00 /opt/www/bin/httpd -k start
daemon 5343 5338 0 Aug02 ? 00:00:01 /opt/www/bin/httpd -k start
daemon 5453 5338 0 Aug02 ? 00:00:02 /opt/www/bin/httpd -k start
daemon 5454 5338 0 Aug02 ? 00:00:04 /opt/www/bin/httpd -k start
daemon 5455 5338 0 Aug02 ? 00:00:00 /opt/www/bin/httpd -k start
daemon 5456 5338 0 Aug02 ? 00:00:00 /opt/www/bin/httpd -k start
root 5531 5263 0 00:37 pts/2 00:00:00 grep http
这是mysql和apach都start了
然后安装Discuz6.0.0SCUTF8(这个是好不容易找到的现在是Discuz_7.0.0_SC_UTF8了安装安装时一样的)
mkdir dz
cd dz
unzip ../Discuz6.0.0SCUTF8.zip解压
先将apache内的/opt/www/htdocs/中的文件删除(rm -f *)
拷贝Discuz6.0.0SCUTF8中内容到/opt/www/htdocs/(cp -R /root/dz/* .)
打开users_guide.htm文件查看可以查看安装及其他信息(我发现Discuz_7.0.0_SC_UTF8.zip中没有这个文件
所以才装了Discuz6.0.0SCUTF8)
upload文件是主文件
mv upload/ bbs
cd bbs
修改config.inc.php把刚才新建的数据库帐号信息填入相应的位置()
vi config.inc.php
$dbhost = 'localhost'; // database server
// 数据库服务器
$dbuser = 'wilson'; // database username
// 数据库用户名
$dbpw = 'haohaotmac'; // database password
// 数据库密码
$dbname = 'bbk'; // database name
// 数据库名
$adminemail = ; // admin email
// 论坛系统 Email
$dbreport = 0; // send db error report? 1=yes
// 是否发送数据库错误报告? 0=否, 1=是
然后安装Discuz6.0.0SCUTF8
在浏览器里面输入http//:192.168.1.88/bbs/install.php
如果是linux系统要修改以下文件的可写权限(777)
config.inc.php
./templates
./templates/default
./templates/default/*.*
./attachments
./customavatar
./forumdata
./forumdata/cache
./forumdata/templates
./forumdata/threadcaches
./forumdata/logs
chmod 777 config.inc.php
chmod 777 -R templates/
chmod 777 -R attachments/
chmod 777 -R customavatar/
chmod 777 -R forumdata/
然后重新检查
然后下一步
输入管理员密码
然后恭喜你论坛已经建立起来了
用admin登入就可以了
然后要删除install.php 安装文件
这样基本上就完成了LAMP环境安装论坛软件了。以后的工作还有很多慢慢来,特别注意要会看里面的安装文档不过都是英文的,加油了
希望和大家一起讨论不断提高!!!!!(参考小布老师的播布客)
mail: