1.安装apache2:
sudo apt-get install apache2
浏览http://localhost看是否可用“it works!”
2.安装php5:
sudo apt-get install php5 libapache2-mod-php5
重启apache:sudo /etc/init.d/apache2 restart
测试apache:sudo gedit /var/www/testphp.php,
加入:<?php phpinfo(); ?>,在http://localhost/testphp.php查看,
确认成功后删除:sudo rm /var/www/testphp.php
3.安装mysql:
sudo apt-get install mysql-server
默认只有127.0.0.1可以访问,修改:gksudo gedit /etc/mysql/my.cnf,将其中的“bind-address = 127.0.0.1”注释掉。
重启:sudo /etc/init.d/mysql restart
4.安装MySQL Administrator:
sudo apt-get install mysql-admin
5.安装MySQL for Apache HTTP Server:
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
sudo gedit /etc/php5/apache2/php.ini中的“;extension=mysql.so”,去掉注释“;”。
重启apache:sudo /etc/init.d/apache2 restart
lamp的安装完成。
下面是wordpress的安装:
下载wordpress,进入下载目录,运行:sudo tar zxvf wordpress-x.x.x.tar.gz --directory=/var/www/
在mysql中创建数据库:
Applications => Programming =>mysql administrator和mysql query browser,都打开。
其中:server hostname:localhost,usrname:root, password:"yourpassword".
在mysql query browser中创建数据库wordpress:create database wordpress。
在mysql administrator中选择user administration,点击下面出现的wordpress数据库,
在右侧“new user”,输入用户名"wordpress01",密码"wordpress01"。
注意:要在添加新用户的界面“schema privileges”选项选中所有的权限,添加到左面。
进入安转目录:cd /var/www/wordpress,
sudo cp wp-config-sample.php wp-config.php
sudo gedit wp-config.php
修改其中的为:
/ ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'wordpress01');
/** MySQL database password */
define('DB_PASSWORD', 'wordpress01');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
浏览器里输入http://localhost/wordpress/wp-admin/install.php,开始设置wordpress。