apache+mysql+简单设置1
使用apache+mysql+php进行动态网页的制作。实验环境:主机A是一台DNS服务器,IP地址为192.168.0.130,主机名为mail.station.com.
主机B的windows机器,IP地址为192.168.0.139.下面我们将演示phpwind,phpbb,discuz的安装和配置。
实验步骤:
1, 编辑vim /etc/httpd/conf/httpd.conf创建虚拟目录,关于虚拟目录创建的具体步骤以及需要注意的细节可以参考我另外的文章,这里就不再细说了,下面是编辑后的内容# vim /etc/httpd/conf/httpd.conf
NameVirtualHost *:80
DocumentRoot /var/www/discuz
ServerNamediscuz.station.com
ErrorLog /var/log/httpd/discuz/err_log
CustomLog /var/log/httpd/discuz/custom_log combined
DocumentRoot /var/www/phpwind
ServerNamephpwind.station.com
ErrorLog /var/log/httpd/phpwind/err_log
CustomLog /var/log/httpd/phpwind/custom_log combined
DocumentRoot /var/www/phpbb
ServerNamephpbb.station.com
ErrorLog /var/log/httpd/phpbb/err_log
CustomLog /var/log/httpd/phpbb/custom_log combined
DocumentRoot /var/www/wordpress
ServerNamewordpress.station.com
ErrorLog /var/log/httpd/wordpress/err_log
CustomLog /var/log/httpd/wordpress/custom_log combined
创建要用到的目录:
# mkdir/var/www/{phpbb,phpwind,discuz,wordpress}
# mkdir/var/log/httpd/{phpbb,phpwind,discuz,wordpress}
4,以root的身份为数据库增加密码
# mysqladmin -u root password '123456'
然后创建phpbb,phpwind,discuz,wordpress要用到的数据库文件
# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' toclear the buffer.
mysql> create database phpbb;
Query OK, 1 row affected (0.08 sec)
mysql> create database phpwind;
Query OK, 1 row affected (0.00 sec)
mysql> create database discuz;
Query OK, 1 row affected (0.00 sec)
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)
可以使用命令showdatabases;查看刚创建的内容
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| discuz |
| extmail |
| mysql |
| phpbb |
| phpwind |
| test |
| wordpress |
+--------------------+
8 rows in set (0.10 sec)
使用\q退出
mysql> \q
Bye使用命令drop database mydatabase;可以删除数据库。
这样就创建好了数据库。到此已经为我们的试验做好了准备,下面开始试验
phpbb的试验
1,下载软件包phpbb3.0.7_zh_phpbbchina.zip
解压软件包
# unzip phpbb3.0.7_zh_phpbbchina.zip
查看解压后的文件
# ls
phpbb3.0.7_zh_phpbbchinaphpbb3.0.7_zh_phpbbchina.zip
将phpbb3.0.7_zh_phpbbchina中的内容全部拷贝到/var/www/phpbb目录中
# mv phpbb3.0.7_zh_phpbbchina/*/var/www/phpbb/
在主机B的地址栏上输入http://phpbb.station.com/install/index.php可以看到下面的页面
http://blog.51cto.com/yangzorder/../attachment/201003/201003101268224996720.jpg
然后按照上面的提示你就可以安装了。如果出现下面的界面,就说明一切顺利,接着就可以登入论坛了。登入后你就可以在里面进行设置了,这样一个phpbb的论坛就好了。
http://blog.51cto.com/yangzorder/../attachment/201003/201003101268225497749.jpg
2,下面做phpwind的安装,
首先解压PHPWind_GBK_7.5.zip压缩包# unzip PHPWind_GBK_7.5.zip
查看解压后的内容:
# ls
PHPWind_GBK_7.5PlusPHPWind_GBK_7.5.zip
然后将PHPWind_GBK_7.5Plus中的内容全部拷贝到/var/ww/phpwind中
mv /var/www/phpwind/ PHPWind_GBK_7.5Plus/*/var/www/phpwind
可以查看里面的内容
# ls/var/www/phpwind
docs index.htm PHPWind_GBK_7.5Plus PHPWind_GBK_7.5.zipupload
将/var/www/phpwind/upload中的内容也拷贝到/var/www/phpwind中
#mv /var/www/phpwind/upload/* ./
在主机B上输入http://phpwind.station.com可以看到以下内容
http://blog.51cto.com/yangzorder/../attachment/201003/201003101268225852824.jpg
上面有详细的操作步骤如下:
1、运行环境需求:PHP+MYSQL
第一步:
使用ftp工具,用二进制模式将该软件包里的upload目录下的所有文件上传到您的空间,假设上传后目录为 upload。
第二步:
先确认以下目录或文件属性为(777) 可写模式。
attachment
data
attachment/cn_img
data/bbscache
attachment/photo
data/groupdb
attachment/thumb
data/guestcache
attachment/upload
data/style
attachment/mini
data/tmp
htm_data
data/tplcache
data/forums
第三步:
运行 http://yourwebsite/upload/install.php安装程序,填入安装相关信息与资料,完成安装!
按照步骤执行完后在地址栏中输入http://phpwind.station.com/你将看到以下界面这样你就可以进行自己的设计了。
http://blog.51cto.com/yangzorder/../attachment/201003/201003101268226155187.jpg
需要注意的是要把/var/www/phpwind下的install.php删除或者重命名
下面来演示wordpress的安装。
首先解压wordpress-2.9.2-zh_CN.zip
# unzip wordpress-2.9.2-zh_CN.zip
可以查看解压后的内容
# ls
wordpress wordpress-2.9.2-zh_CN.zip
将wordpress中的所有内容拷贝到/var/www/wordpress下
#mv /var/www/wordpress/* /var/www/wordpress
需要注意的是,您还要把wp-config-sample.php文件复制一份并且重命名为wp-config.php
#cp/var/www/wordpress/wp-config-sample.php/var/www/wordpress/wp-config.php
不然的话在安装过程中会说有的文件找不到,并且您还有要做以下的更改
#vim/var/www/wordpress/wp-config.php
将define('DB_NAME','putyourdbnamehere');中的putyourdbnamehere换成您的数据库名称,这里改为define('DB_NAME', 'wordpress');
将define('DB_USER', 'usernamehere');中的usernamehere换成您使用数据库的用户名这里改为define('DB_USER', 'root')
将define('DB_PASSWORD','yourpasswordhere');中的yourpasswordhere改为您的数据库密码这里改为define('DB_PASSWORD', '123456')
在浏览其中输入http://wordpress.station.com可以看到下面的内容
http://blog.51cto.com/yangzorder/../attachment/201003/201003101268228862734.jpg
在完成安装完成时会产生一个随机密码这里一定要记好,最好是复制下来不然的话,你就登录不上你创建的论坛了。
当一切配置好后会出现下面的登陆界面
输入密码后您就能享受自己的成果了
Discuz的具体安装步骤这里就不再细说了,希望大家仔细摸索一下。
http://blog.51cto.com/yangzorder/../attachment/201003/201003101268229734826.jpg
页:
[1]