很简单,需要php5 apache2 mysql-server wordpress。操作步骤均有注释,都写在下面的脚本中了。配置结束后访问localhost即可。
1 #- install the necessary applications 2 3 sudo apt-get install php5 apache2 mysql-server wordpress 4 5 6 #- find wordpress 7 8 locate wordpress 9 10 11 #- move to /var/www/html 12 13 cd /usr/share 14 sudo mv /usr/share/wordpress /var/www/html 15 16 17 #- configure apache2 18 #- change "DocumentRoot" -> /var/www/html/wordpress 19 20 sudo vi /etc/apache2/sites-enabled 21 22 23 #- configure mysql-server (server:localhost user:root) 24 25 mysql -h localhost -u root -p 26 CREATE USER 'kirai'@'localhost' IDENTIFIED BY '123'; 27 GRANT ALL ON *.* TO 'kirai'@'localhost'; 28 29 mysql -h localhost -u kirai -p 30 CREATE DATABASE wordpress; 31 32 33 #- configure wordpress 34 #- add database to wordpress 35 36 #- define('DB_NAME', 'wordpress'); 37 #- define('DB_USER', 'kirai'); 38 #- define('DB_PASSWORD', '123'); 39 #- define('DB_HOST', 'localhost'); 40 41 cd /var/www/html/wordpress 42 sudo cp wp-config-sample.php wp-config.php 43 sudo vi wp-config.php 44 45 #- restart apache2 46 47 sudo /etc/init.d apache2 restart 48 49 50 #- install phpmyadmin to help manage those applications 51 52 sudo apt-get install phpmyadmin