由于自己对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
安装了phpmyadmin不知道会不会和apache2和php5出现冲突,因为安装apache2和php5时安装了apache2-common php5-common libapache-mod-php4 我的做法是装好之后在aptitude的时候将除phpmyadmin以外的包都卸掉而将phpmyadimin置为保留,也可能phpmyadimin依赖 那些包,卸掉导致工作在不正常状态,这是第一次装还没有用到那么多功能,希望大家指正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
2、下载webmin的tar.gz包,因为我没能找到在源里我到了官方主页下载
http://www.webmin.com
网上找到的一个Webmin安装指南 (出自http//jesse.blogschina.com/200510/67.html)
现在在互联网上可以找到非常多的免费的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
1. Webmin安装
1). 压缩包安装
代码: 全选
我把它拷贝到了/usr/loacl
代码: 全选
# tar xvzf webmin-1.100.tar.gz
# cd webmin-1.100
代码: 全选
如果是一般用户切换到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://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
提示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
代码: 全选
$mysql -u root
进入mysql之后,最要紧的就是要设置Mysql中的root用户密码了,否则,Mysql服务无安全可言了。
代码: 全选
mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "123456";
这样的话,就设置好了MySQL中的root用户密码了,然后就用root用户建立你所需要的数据库。我这里就以xoops为例:
代码: 全选
mysql>CREATE DATABASE xoops;
mysql>GRANT ALL PRIVILEGES ON xoops.* TO xoops_root@localhost IDENTIFIED BY "654321";
更简单的方法,用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
<?php
// ** MySQL settings ** //
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