apache2+php5+mysql5+wordpress2.0.2安装成功+phpmyadmin

引用地址:http://forum.ubuntu.org.cn/about14389.html
原作者:
tick

认真阅读学习firehare《Ubuntu下设置常见网络服务指南》后自己成功在本地安装了php+mysql+apache2下的wordpress
由于自己对mysql不是很熟悉要想使用mysql和配置apache2便安装了webmin,可是不知道怎么的在drapper下没有找到webmin[不知道是没有还是我没有找到]
因为是初学不敢对配置做太多的改动,因为改动重装了很多次才成功。
以下是安装
1、安装php5 apache2 mysql-server5.0
代码:
sudo apt-get install apache2 libapache2-mod-security libapache2-mod-php5 php5 mysql-server php5-mysql php5-gd phpmyadmin

[intro:1a7d89b88b]mysql-server 包括了mysql-server-5.0 mysql-client-5.0
phpmyadimin 包括了apache-common libapache-mod-php4 libltdl3 libmcrypt4 libzzip-0-12 php4-common php4-mcrypt[/intro:1a7d89b88b]

安装了phpmyadmin不知道会不会和apache2和php5出现冲突,因为安装apache2和php5时安装了apache2-common php5-common libapache-mod-php4 我的做法是装好之后在aptitude的时候将除phpmyadmin以外的包都卸掉而将phpmyadimin置为保留,也可能phpmyadimin 依赖 那些包,卸掉导致工作在不正常状态,这是第一次装还没有用到那么多功能,希望大家指正

2、下载webmin的tar.gz包,因为我没能找到在源里我到了官方主页下载
http://www.webmin.com/

网上找到的一个Webmin安装指南 (出自http//jesse.blogschina.com/200510/67.html)
Jesse Lee 发表于 2005年10月24日 22:33 | 433 查看

现在在互联网上可以找到非常多的免费的Linux管理工具,这的确大大方便了对系统的管理。对于一个有经验的系统管理员来说,如果能够方便地找到 这些工具,并正确自如地加以运用,管理一个Linux系统将是一个非常容易的事情。而Webmin就是一个免费的基于web界面的系统管理工具,可以通过 浏览器对Linux系统进行远程配置和管理。

从Webmin的主页(http://www.webmin.com)介绍,可以知道,Webmin内置一个web server,web server和所有的cgi程序都是用perl 5编写的。目前的Webmin版本支持多种UNIX和Linux版本,支持最好的是Solaris、Linux (尤其是Redhat)和FreeBSD。Webmin同时提供多种语言的界面支持,包括简体中文,不过,考虑到老外对中文的翻译水平,其翻译并不彻底, 一些配置说明仍然是英文的。

一. Webmin下载
http://www.webmin.com 或者这里
代码:
wget -c http://prdownloads.sourceforge.net/webadmin/webmin-1.270.tar.gz


在webmin首页的右上角即可看到最新版本的下载信息,其下载包括两种包装,一种是tar压缩包,一种是rpm安装包。

1. Webmin安装

1). 压缩包安装

代码:
我把它拷贝到了/usr/loacl


代码:
# tar xvzf webmin-1.100.tar.gz
# cd webmin-1.100


在该目录下有个README文件,指出了运行setup.sh即可完成安装过程,但是在安装后,不能删除本目录,因为webmin将从该目录运行。

代码:
如果是一般用户切换到root


代码:
#sudo su
# ./setup.sh


***********************************************************************

* Welcome to the Webmin setup script, version 1.100 *

***********************************************************************

Webmin is a web-based interface that allows Unix-like operating

systems and common Unix services to be easily administered.

Installing Webmin in /usr/webmin-1.100 ...


***********************************************************************

Webmin uses separate directories for configuration files and log files.

Unless you want to run multiple versions of Webmin at the same time

you can just accept the defaults.

Config file directory [/etc/webmin]: 默认配置文件目录[可以修改,或者直接键入回车]

Log file directory [/var/webmin]: 默认日志文件目录[可以修改,或者直接键入回车]

***********************************************************************

Webmin is written entirely in Perl. Please enter the full path to the

Perl 5 interpreter on your system.

Full path to perl (default /usr/bin/perl): 检查Perl安装

Testing Perl ...

Perl seems to be installed ok

***********************************************************************

Operating system name: Redhat Linux

Operating system version: 8.0

***********************************************************************

Webmin uses its own password protected web server to provide access

to the administration programs. The setup script needs to know :

- What port to run the web server on. There must not be another

web server already using this port.

- The login name required to access the web server.

- The password required to access the web server.

- If the webserver should use SSL (if your system supports it).

- Whether to start webmin at boot time.

Web server port (default 10000): 默认webmin web server的端口

Login name (default admin): 通过浏览器登录webmin的用户名,默认为admin[建议修改为自己的一个登录帐号]

Login password: 输入用户登录密码

Password again: 再次输入用户登录密码

The Perl SSLeay library is not installed. SSL not available.

Start Webmin at boot time (y/n): y 是否在linux启动时运行webmin

***********************************************************************

Creating web server config files..

..done

Creating access control file..

..done

Inserting path to perl into scripts..

..done

Creating start and stop scripts..

..done

Copying config files..

..done

Configuring Webmin to start at boot time..

Created init script /etc/rc.d/init.d/webmin

..done

Creating uninstall script /etc/webmin/uninstall.sh ..

..done

Changing ownership and permissions ..

..done

Running postinstall scripts ..

..done

Attempting to start Webmin mini web server..

Starting Webmin server in /usr/webmin-1.100

..done

***********************************************************************

Webmin has been installed and started successfully. Use your web browser to go to
http://hostname:10000/
and login with the name and password you entered previously.

安装结束。
如果没有让webmin开机启动可以用下面的方法启动

代码:
# /etc/webmin/stop
//停止服務

# /etc/webmin/start
//启动服務


现在您可以在浏览器里输入http://localhost:10000
或者http://127.0.0.1:1000 来使用webmin管理你安装的php+apache2+mysql 正常登录
你可以修改语言为中文选中webmin的Change Language and Theme
3、修改apache配置
然后打开服务器的Apache 服务器,我的提示了错误,如果你的没有那就不用修改,提示我们的apache2目录不对,因为在/etc下是没有apache的,
代码:
修改Apache服务器根目录/etc/apache为/etc/apache2
同样下面的httpd执行文件路径为/usr/sbin/apache2
和httpd.conf的路径一样的改为/etc/apache2/httpd.conf


4、修改mysql配置
提示The MySQL configuration file /etc/my.cnf was not found on your system. You may need to adjust the module configuration to use the correct path.[/color
选择module configuration
代码:
MySQL configuration file 改为 /etc/mysql/my.cnf


5、为wordpress添加用户和数据库[参考《mySQL服务器的配置教程》]
代码:
$mysql -u root

在这里之所以用-u root是因为我现在是一般用户(firehare),如果不加-u root的话,mysql会以为是firehare在登录。注意,我在这里没有进入根用户模式,因为没必要。一般来说,对mysql中的数据库进行操作, 根本没必要进入根用户模式,只有在设置时才有这种可能。
进入mysql之后,最要紧的就是要设置Mysql中的root用户密码了,否则,Mysql服务无安全可言了。
代码:
mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "123456";

注意,我这儿用的是123456做为root用户的密码,但是该密码是不安全的,请大家最好使用大小写字母与数字混合的密码,且不少于8位。
这样的话,就设置好了MySQL中的root用户密码了,然后就用root用户建立你所需要的数据库。我这里就以xoops为例:
代码:
mysql>CREATE DATABASE xoops;
mysql>GRANT ALL PRIVILEGES ON xoops.* TO xoops_root@localhost IDENTIFIED BY "654321";

这样就建立了一个xoops_roots的用户,它对数据库xoops有着全部权限。以后就用xoops_root来对xoops数据库进行管理,而无需要再用root用户了,而该用户的权限也只被限定在xoops数据库中。

更简单的方法,用webmin打开服务器的MySQL 数据库服务器,创建数据库wordpress,用户权限中创建新用户例如 用户名 tick 密码 tick 主机 127.0.0.1 权限 选中所有,很有可能你无法登录你的mysql数据服务,那么就按照《mySQL服务器的配置教程》里的那样建立



6、下载安装wordpress
我在www.wordpress.org.cn下载的是中文版的,大家也可以到www.wordpress.org下载英文最新版,提供的连接可能没有用,
http://www.wordpress.org.cn/forums/attachment.php?aid=1
将下载下来的zip包拷贝到/var/www/下面
代码:
#sudo unzip wordpress2.0.2_CN.zip
#sudo mkdir wordpress
#sudo mv wordpress2.0.2_CN/* wordpress/
#cd wordpress
#sudo vi wp-config.php
(如果没有wp-config.php,那么sudo vi wp-config-sample.php,最后另存为wp-config.php

下面是我修改后的wp-config.php
<?php
// ** MySQL settings ** //
[color=darkred]define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'tick'); // Your MySQL username
define('DB_PASSWORD', 'tick'); // ...and password
define('DB_HOST', '127.0.0.1'); // 我的apache提示我只能用127.0.0.1而不能用localhost访问,你可以填为localhost试试



// You can have multiple installations in one database if you give each a unique prefix

$table_prefix = 'wp2_'; // Only numbers, letters, and underscores please!

// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-includes/languages.
// For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
// to enable German language support.
define ('WPLANG', 'zh_CN'); //默认的语言 中文版则是'zh_CN'

/* That's all, stop editing! Happy blogging. */

define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
?>

7、安装
http://127.0.0.1/wordpress/wp-admin/install.php
一步步做就是了,有可能长时间没能在最后登录时成功,那么你就只有将数据库删了重新装一次wordpress

8
代码:
sudo apt-get install phpmyadmin
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卷边书_王诣

您的鼓励,是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值