先升级系统 php
命令:sudo apt-get update html
用apt-get的方式安装,最好能是必须先运行上面的命令升级本身的系统才能安装下面的 mysql
安装Apache(Version-2.2.22) web
命令:sudo apt-get install apache2 sql
The following extra packages will be installed: 数据库
apache2-mpm-worker apache
apache2-utils ubuntu
apache2.2-bin vim
apache2.2-common 浏览器
libapr1
libaprutil1
libaprutil1-dbd-sqlite3
libaprutil1-ldap
libcap2
ssl-cert
Suggested packages:
apache2-doc
apache2-suexec
apache2-suexec-custom
openssl-blacklist
The following NEW packages will be installed:
apache2
apache2-mpm-worker
apache2-utils
apache2.2-bin
apache2.2-common
libapr1
libaprutil1
libaprutil1-dbd-sqlite3
libaprutil1-ldap
libcap2
ssl-cer
2.测试Apache安装是否成功步骤以下:
root@ubuntuServer1204:~# ifconfig
eth0 Link encap:Ethernet HWaddr fa:16:3e:24:8e:a9
inet addr:192.168.71.69 Bcast:192.168.71.127 Mask:255.255.255.128
inet6 addr: fe80::f816:3eff:fe24:8ea9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6501 errors:0 dropped:0 overruns:0 frame:0
TX packets:5725 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6895384 (6.8 MB) TX bytes:637206 (637.2 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
若是成功,你会看到如下内容 "It works!" , 祝贺你!
安装PHP5(Version-5.3.10)
命令:sudo apt-get install php5
The following extra packages will be installed:
apache2-mpm-prefork
libapache2-mod-php5
php5-cli
php5-common
Suggested packages:
php-pear
php5-suhosin
The following packages will be REMOVED:
apache2-mpm-worker
The following NEW packages will be installed:
apache2-mpm-prefork
libapache2-mod-php5
php5
php5-cli
php5-common
为了使PHP和Apache能一块儿工做
命令:sudo apt-get install libapache2-mod-php5(此为配置APACHE+PHP)
可是发如今安装php5的时候已经安装过因此能够省略
命令:sudo vim /var/www/testphp.php
<?php phpinfo(); ?>
第三歩:为使PHP正常工做,重启apache
命令:sudo /etc/init.d/apache2 restart
http://konw.szreach.com/testphp.php
注意:显示出PHP的信息内容页面。祝贺你,已经安装成功
命令:sudo /etc/init.d/apache2 restart//apache重启
内容以下:
root@ubuntuServer1204:~# sudo /etc/init.d/apache2 start
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
httpd (pid 2609) already running
...done.
解决方法:
命令:sudo vim /etc/apache2/sites-available/default
打开default文件后,在default文件顶端加入:ServerName 127.0.0.1
从新启动apache2测试以下:
root@ubuntuServer1204:~# sudo /etc/init.d/apache2 start
* Starting web server apache2
httpd (pid 2609) already running
...done.
命令:sudo apt-get install mysql-server
The following extra packages will be installed:
libdbd-mysql-perl
libdbi-perl libhtml-template-perl
libmysqlclient18
libnet-daemon-perl
libplrpc-perl
libterm-readkey-perl
mysql-client-5.5
mysql-client-core-5.5
mysql-common
mysql-server-5.5
mysql-server-core-5.5
Suggested packages:
libipc-sharedcache-perl
tinyca mailx
The following NEW packages will be installed:
libdbd-mysql-perl
libdbi-perl libhtml-template-perl
libmysqlclient18
libnet-daemon-perl
libplrpc-perl
libterm-readkey-perl
mysql-client-5.5
mysql-client-core-5.5
mysql-common
mysql-server
mysql-server-5.5
mysql-server-core-5.5
命令:sudo apt-get install php5-mysql
The following NEW packages will be installed:
php5-mysql
命令:sudo apt-get install libapache2-mod-auth-mysql
命令:sudo /etc/init.d/mysql restart
下载地址连接:http://cn.wordpress.org/wordpress-3.7.1-zh_CN.zip
命令:wget -c http://cn.wordpress.org/wordpress-3.7.1-zh_CN.zip
下载地址连接:http://cn.wordpress.org/wordpress-3.7.1-zh_CN.tar.gz
命令:wget -c http://cn.wordpress.org/wordpress-3.7.1-zh_CN.tar.gz
命令:tar xzvf wordpress-3.7.1-zh_CN.tar.gz
命令:unzip wordpress-3.7.1-zh_CN.zip
命令:sudo chown -R www-data:www-data wordpress
命令:sudo cp -Rf wordpress /var/www
(注:3.4没有前后顺序)
http://konw.szreach.com/wordpress
http://konw.szreach.com/wordpress/index.php
注意:出现如下页面表示wordpress安装成功。
6.配置wordgpress
点击“建立配置文件”
第二步:经过MySQL建立与WordPress相关的数据库
命令:mysql -u root -p//初次安装没有设置root用户密码,直接回车就行
命令:create database db_wordpress;//建立名为db_wordpress的数据库
数据库名:db_wordpress
用户名:root
密码: (空)
数据库主机:localhost
表前缀:wp
命令:cd /var/www/wordpress/ //到wordpress的目录
命令:touch wp-config.php //建立wp-config.php文件
命令:sudo vim wp-config.php
错误提示:
E:没法得到锁/var/cache/apt/archives/lock - open (资源临时不可用)
E:没法对下载目录加
解决步骤:
sudo rm /var/cache/apt/archives/lock
问题解决。
出现的问题:
root@ubuntuServer1204:~# sudo /etc/init.d/mysql start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mysql