将安装文件上传到
linux
的
/OPT
目录中。
环境:
REDHAT5.5
工具:
httpd-2.2.17.tar.gz
mysql-5.0.22.tar.gz
php-5.2.17.tar.gz
phpMyAdmin-3.3.4-all-languages.tar.bz2
gd-2.0.32.tar.gz
freetype-2.1.10.tar.gz
libpng-1.2.14.tar.gz.TAR.GZ
libxml2-2.6.19.tar.gz.GZ
zlib-1.2.3.tar.gz
下载地址:http://www.everbox.com/f/p5knHnhIVuV1LWdskGeC8VmMfA
一.
安装
apache
tar zxvf httpd-2.2.17.tar.gz
解压
cd httpd-2.2.17
进入
编译并安装:
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-cgi --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/usr/local/apache2/htdocs
Make
Make install
编译安装完成后修改配置文件
vi /usr/local/apache2/conf/httpd.conf
ServerName www.example.com:80
修改为:自己
IP
:
80
我修改为:
www.xiaodu.com
此处我以域名访问需要修改自己的
hosts
文件!
添加
192.168.1.2 www.xiaodu.com
(我自己的实验机器
IP
为
192.168.1.2
)
开启服务:
/usr/local/apache2/bin/apachectl start
查看服务:
netstat -antpl | grep 80
访问网页,查看是否正常
OK
,网页正常访问。
二.
安装
mysql
解压:
tar zxvf mysql-5.0.22.tar.gz
1.
编译并安装:
./configure --prefix=/usr/local/mysql
Make && make install
2.
添加用户:
useradd -M -s /sbin/nologin mysql
3. [root@RHCE mysql-5.0.22]#
/usr/local/mysql/bin/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h RHCE password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[root@RHCE mysql-5.0.22]#
cp support-files/my-medium.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@RHCE mysql-5.0.22]#
chown -R root:mysql /usr/local/mysql/
[root@RHCE mysql-5.0.22]#
chown -R mysql /usr/local/mysql/var/
[root@RHCE mysql-5.0.22]#
echo "/usr/local/mysql/lib/mysql/" >> /etc/ld.so.conf
[root@RHCE mysql-5.0.22]#
ldconfig
[root@RHCE mysql-5.0.22]#
/usr/local/mysql/bin/mysqld_safe --user=mysql &
[root@RHCE mysql-5.0.22]#
cp support-files/mysql.server /etc/init.d/mysqld
cp: overwrite `/etc/init.d/mysqld'?
y
[root@RHCE mysql-5.0.22]#
chmod +x /etc/init.d/mysqld
添加启动项:
[root@RHCE mysql-5.0.22]#
chkconfig --add mysqld
[root@RHCE mysql-5.0.22]#
chkconfig --level 35 mysqld on
设置
mysql
程序的执行路径:
[root@RHCE mysql-5.0.22]# export PATH=$PATH:/usr/local/mysql/bin --
(设置环境变量)
[root@RHCE mysql-5.0.22]# echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile ---
(将环境变量添加到全局配置文件中)
查看
MYSQL
是否安装成功,进入看看:
[root@RHCE mysql-5.0.22]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.22-log
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.00 sec)
mysql>
出现以上信息表明安装成功,可以正常进入使用!
修改
mysql
管理员密码命令:
[root@RHCE mysql-5.0.22]# mysqladmin -u root password 'new_password'
三.
编译安装
php
,并添加
GD
支持!
1.
添加
GD
支持组件
(1)tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
Make
Make install
(2)tar zxvf libpng-1.2.14.tar.gz.TAR.GZ
cd libpng-1.2.14
./configure
Make
Make install
(3)tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure
Make
Make install
(4)
tar zxvf jpegsrc.v8b.tar.gz
cd jpeg-8b/
./configure --enable-shared
Make
Make test
Make install
(5) tar zxvf libxml2-2.6.19.tar.gz.GZ
cd libxml2-2.6.19
./configure
Make
Make install
(6)
tar zxvf gd-2.0.32.tar.gz
cd gd-2.0.32
./configure --with-png --with-freetype --with-jpeg
Make
Make install
2.
安装
php
(
1
)
Tar zxvf php-5.2.17.tar.gz
(
2
)
Cd php-5.2.17
(
3
)
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --enable-sockets --enable-mbstring --with-config-file-path=/usr/local/php5/lib --with-gd --with-zlib --with-png-dir=/usr/local/include/libpng12/ --with-libxml-dir=/usr/local/include/libxml2/libxml --with-jpeg-dir=/usr/local/include --with-freetype-dir=/usr/local/include/freetype2/freetype
当出现以下提示,并且没有报错信息,表明成功:
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
(
4
)
Make
Make install
[精彩] [GD]史上最简单的让PHP支持GD的方法,对菜鸟尤其适合
编辑
apache
配置文件
vi /usr/local/apache2/conf/httpd.conf
修改文件内容:添加红色字体部分
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
3
.测试
php
vi /usr/local/apache2/htdocs/info.php
添加内容:
<?php
echo phpinfo();
?>
重启
apache
后,访问
www.xiaodu.com/info.php
,出现此页面表示安装成功。
下面就可以安装
DZ
论坛了。
详细教程请点击此处去官网下载和查看安装教程
。
解压
phpmyadmin
到
/usr/local/apache2/htdocs/
修改
config.default.php
文件
$cfg['blowfish_secret'] = '';
设置一个秘密即可,用
root
用户登录即可!
或者借鉴
DZ
官网教程。