linux apache mysql python 搭建_搭建LAMP(Linux + Apache + Mysql + PHP/Perl/Python)站点

(1)先安装MySQL

perl-DBI-1.52-1.fc6.i386.rpm

mysql-5.0.45-7.el5.i386.rpm

perl-DBD-MySQL-3.0007-1.fc6.i386.rpm

mysql-server-5.0.45-7.el5.i386.rpm

(2)安装PHP

php-common-5.1.6-20.el5.i386.rpm

php-cli-5.1.6-20.el5.i386.rpm

php-5.1.6-20.el5.i386.rpm

php-pdo-5.1.6-20.el5.i386.rpm

php-mysql-5.1.6-20.el5.i386.rpm

配置php,让它支持老版本的php,需要修改/etc/httpd/conf.d/php.conf:

AddType    text/html   .php   .php3   <=添加.php3

(3)建一个基于IP地址的虚拟主机:

n虚拟主机的站点主目录为:/tmp/bblog;

n从共享文件ftp服务器中下载bBlog站点文件bBlog-0.7.6.tar.gz到用户主目录中,

n再解压bBlog网站素材到这个虚拟主机的站点主目录;

n重新启动Apahce服务器;

n在虚拟主机的站点主目录/tmp/bblog下新建一个php测试文件mytest.php,文件内容为:

如果有出现如下显示php的版本信息的页面就表示php安装成功。

(4)配置bBlog的MySQL数据库及数据库用户;

数据库名字:bblog;

可以登录这个数据库的用户:bblogadmin;

(数据库名和数据库用户在第5步:bBlog安装中需要使用)

//先启动MySQL服务守护进程;

[root@linux~]#service  mysqld   start

//建立数据库和用户,给这个用户赋予访问数据库的所有权限

[root@linux~]# mysql

//建立名为bblog的数据;

mysql> create database bblog;  <==注意每个指令后面都要加上分号(;)

Query OK, 1 row affected (0.01 sec)

//建立用户bblogadmin,并赋予用户bblogadmin对数据库bblog中所有表所有权限,bblogadmin用户登录密码为:1qaz2wsx

mysql> grant all privileges on bblog.* to bblogadmin@localhost

identified by '1qaz2wsx';

Query OK, 0 rows affected (0.00 sec)

mysql> show databases;

+----------+

| Database |

+----------+

| bblog   |  <==看到了吗?多了一个数据库

| mysql    |  <==主要用来记录MySQL的账号、主机等重要信息的主要数据库

| test     |

+----------+

3 rows in set (0.00 sec)

//推出mysql

mysql> exit

//以用户 bblogadmin登录mysql;

[root@linux~]# mysql –u bblogadmin –p

Password:1qaz2wsx

mysql>connect bblog;//测试用户bblogadmin连接到数据库bblog

OK!//有OK表示成功;

mysql>show  tables;//查看bblog数据库中的表,应该为空;

mysql> exit            //退出mysql

(5)安装bBlog站点:

按步骤安装;

bBlog need to be able to write to disk to store it's cache of templates, and if you want to use the blo.gs favorites functionality.

We will now check the permissions of the 'cache' folder, the 'compiled_templates' folder, and the 'cache/favorites.xml' file. They all need to be writable by the webserver. This will involve chmodding the folders and files with your ftp client ( if you're not using ftp you probally know what do do here ). Permissions should either be 775. If that doesn't work, 777 will.

Additionally, ./config.php should be writable during the install. At the end of the install when the config file is written to disk, you should change the permissions back so it is not writable by the webserver.

./cache is NOT writable./compiled_templates is NOT writable

./cache/favorites.xml is NOT writable

./config.php is NOT writable

改变上述文件权限为可写:

配置数据库:

安装完成:还需要删除站点目录下的安装目录bblog/install,并把站点主目录下的bblog/config.php文件的可写权限去掉;

显示你的个人blog:

管理你的个人blog,加新日志等;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值