安装Lighttpd与PHP5和MySQL支持在Mandriva 2008.0

在Mandriva 2008.0上安装带有PHP5和MySQL支持的Lighttpd

版本1.0
作者:Falko Timme

Lighttpd是一款安全,快速,符合标准的Web服务器,专为速度至关重要的环境而设计。 本教程将介绍如何在具有PHP5支持(通过FastCGI)和MySQL支持的Mandriva 2008.0服务器上安装Lighttpd。

我不会保证这将为您工作!

1初步说明

在本教程中,我使用IP地址为192.168.0.100的hostname server1.example.com 。 这些设置可能会有所不同,因此您必须在适当的情况下更换它们。

2安装MySQL 5.0

首先我们像这样安装MySQL 5.0:

urpmi MySQL MySQL-client

默认情况下,Mandriva 2008的MySQL包中未启用网络连接。 我们可以通过在/etc/my.cnf注释掉 skip-networking来改变这一点

vi /etc/my.cnf
[...]
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
[...]

之后我们启动MySQL:

/etc/init.d/mysqld start

现在检查网络是否启用。 跑

netstat -tap | grep mysql

输出应如下所示:

[root@server1 ~]# netstat -tap | grep mysql
tcp        0      0 *:mysql-im                  *:*                         LISTEN      4393/mysqlmanager
tcp        0      0 *:mysql                     *:*                         LISTEN      4399/mysqld
[root@server1 ~]#

接下来,运行

mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword

为用户root设置密码(否则任何人都可以访问您的MySQL数据库!)。

3安装Lighttpd

Lighttpd可以作为Mandriva软件包,因此我们可以这样安装:

urpmi lighttpd

如果您已经安装了Apache,您应该现在停止它,并删除Apache的系统启动链接,以免它干扰Lighttpd(即使您不知道是否安装了Apache,则可以运行以下两个命令):

/etc/init.d/httpd stop
chkconfig httpd off

然后我们启动Lighttpd:

/etc/init.d/lighttpd start

现在请将您的浏览器指向http://192.168.0.100 ,您应该看到由Lighttpd提供的Mandriva占位符页:

Lighttpd的默认文档根目录是Mandriva上的/ var / www / html ,配置文件是/etc/lighttpd/lighttpd.conf

4安装PHP5

我们可以通过FastCGI使PHP5在Lighttpd中工作。 因此我们安装包php-fcgi

urpmi php-fcgi
赞(52) 打赏
未经允许不得转载:优客志 » 系统运维
分享到:

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏