vaqeteart 发表于 2011-12-21 08:44

wordpress简易安装过程


                <div style="text-align: center;"><font size="6"><span style="font-weight: bold;">wordpress简易安装过程</span></font><br></div><font size="4"><br>主要内容:<br>一、简介<br>二、安装<br>三、其它<br><br><span style="font-weight: bold;">一、简介</span><br style="font-weight: bold;"><span style="font-weight: bold;">===================</span><br>WordPress是一种使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL 数据库的服务器上架设自己的网志。也可以把 WordPress 当作一个内容管理系统(CMS)来使用。WordPress 是一个免费的开源项目,在GNU通用公共许可证下授权发布。<br>总之,我们可以利用wordpress来建立自己站点。<br>更为具体的内容可以参考:<br>http://baike.baidu.com/view/23618.htm<br><br><span style="font-weight: bold;">二、安装</span><br style="font-weight: bold;"><span style="font-weight: bold;">===================</span><br>Wordpress非常容易安装,安装过程不足5分钟。有许多网站提供了自动安装工具(例如Fantastico),下面将会介绍我们自己安装的过程。当然,使用自动升级的方法,升级会更加容易。<br>主要参考:<br>http://codex.wordpress.org.cn/Installing_WordPress<br>以及下载的wordpress中的readme.html文档。<br><br>1,安装前的准备<br>具体参考:http://codex.wordpress.org.cn/Installing_WordPress#Things_to_Know_Before_Installing_WordPress<br>1)检查你的主机,确保它有能够运行wordpress所需的最小条件.<br>*PHP4.3以上<br>*MySQL4.1.2以上<br>*用于运行wordpress的网络服务程序(例如Apache或者Nginx等只要支持php或者mysql就行)<br>具体参考:http://wordpress.org/about/requirements/<br><br>2)下载最新版本的wordpress<br>下载地址:http://wordpress.org/download/<br><br>3)解压下载的文件到你硬盘上面的一个文件夹中<br><br>参考:http://codex.wordpress.org.cn/Editing_wp-config.php<br><br>2,安装过程<br>下面介绍本人安装wordpress的具体过程。<br>机器环境:CentOS release 5.5 (Final)<br><br>主要分为两个部分:LAMP(Linux+Apache+PHP+MySQL)配置,Wordpress安装。具体如下:<br>1)安装Apache+PHP+MySQL:<br>#yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql<br>参考:http://liyuan462.iteye.com/blog/679015<br><br>2)启动httpd服务<br>#service httpd start<br>这里,配置的apache访问路径可以修改/etc/httpd/conf/httpd.conf文件,默认DocumentRoot "/var/www/html"意思是访问的文件在/var/www/html中。使用chkconfig httpd on设置apache为自启动.假设本地ip地址为10.1.2.213,那么直接敲入10.1.2.213即可访问配置路径中的index.html文件了。<br><br>3)添加mysql帐号:<br>#service mysqld start<br>#mysqladmin -u root password '123'<br>这里首先启动mysqld服务,然后设置mysql数据库root帐号密码,密码为123。<br>通过"chkconfig mysqld on"设置mysqld服务为自启动。<br><br>4)创建一个用于wordpress的数据库,以及可以修改它的用户:<br>(a)使用root用户登录mysql:<br>#mysql --user=root --password=123<br>这里,假设root用户的密码是123。这样会有 "mysql&gt;"提示符号,提示你和mysql进行交互。<br>(b)运行mysql下面的命令,创建一个超级用户:<br>mysql&gt;grant all privileges on *.* to 'quietheart'@'localhost'<br>-&gt; identified by '123' with grant option;<br>这里,创建了一个用户"quietheart",其密码是"123".注意,这里第一行"@"字符的左右没有空格,之后回车就会有第二行的"-&gt; "提示符号了。<br>(c)运行mysql命令创建一个wordpress使用的数据库:<br>mysql&gt; create database wordpress_db;<br>Query OK, 1 row affected (0.00 sec)<br><br>(d)退出mysql:<br>退出直接按d,或者mysql&gt;exit. <br><br>5)将下载的最新wordpress解压到web路径。<br>#tar -xzvf wordpress-3.1.2.tar.gz -C /var/www/html/<br>这里,解压的wordpress目录中有一个readme.html文件,里面有大致的安装文档。<br><br>6)打开浏览器,运行wp-admin/install.php:<br>在地址栏输入:http://10.1.2.213/wordpress/wp-admin/install.php<br>这样会提示,没有wp-config.php文件,是否选择创建一个,一般来说,自己手动创建一个会更好,所以我们应该先手动创建一个wp-config.php文件,设置好数据库之后再进行install.php.<br><br>7)创建并编辑wp-config.php<br>#cd /var/www/html/wordpress<br># mv wp-config-sample.php wp-config.php<br># vim wp-config.php<br>文件内容如下:<br>&lt;?php<br>define('DB_NAME', 'wordpress_db');<br>define('DB_USER', 'quietheart');<br>define('DB_PASSWORD', '123');<br>define('DB_HOST', 'localhost');<br>define('DB_CHARSET', 'utf8');<br>define('DB_COLLATE', '');<br>define('AUTH_KEY',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'put your unique phrase here');<br>define('SECURE_AUTH_KEY',&nbsp; 'put your unique phrase here');<br>define('LOGGED_IN_KEY',&nbsp;&nbsp;&nbsp; 'put your unique phrase here');<br>define('NONCE_KEY',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'put your unique phrase here');<br>define('AUTH_SALT',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'put your unique phrase here');<br>define('SECURE_AUTH_SALT', 'put your unique phrase here');<br>define('LOGGED_IN_SALT',&nbsp;&nbsp; 'put your unique phrase here');<br>define('NONCE_SALT',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'put your unique phrase here');<br>$table_prefix&nbsp; = 'wp_';<br>define('WPLANG', '');<br>define('WP_DEBUG', false);<br>if ( !defined('ABSPATH') )<br>&nbsp;&nbsp; &nbsp;define('ABSPATH', dirname(__FILE__) . '/');<br>require_once(ABSPATH . 'wp-settings.php');<br>这里,我们只要把一个现成的模板文件wp-config-sample.php重新命名为wp-config.php就行了,然后将前面设置的mysql信息添加到对应的位置。<br><br>8)打开浏览器,运行wp-admin/install.php:<br>在地址栏输入:http://10.1.2.213/wordpress/wp-admin/install.php<br>这样会转到一个界面,填入必要的信息(网站名称,用户,密码,Email等),然后点击install就行了。<br><br>9)访问我的网站:<br>在地址栏输入:http://10.1.2.213/wordpress/<br>这样会自动执行index.php文件,然后就访问到自己的网站了。<br>至此,最简单的建立wordpress站点的过程描述完毕,我们可以在这个站点上面发布自己的文章了。<br><br><span style="font-weight: bold;">三、其它</span><br style="font-weight: bold;"><span style="font-weight: bold;">===================</span><br>补充的内容,<br>目前也是刚刚接触wordpress不久,以上是在我的机器上的实践过程,如果有其它问题或者建议,可以通过下面的方式联系我,谢谢。<br><br>作者:QuietHeart<br>Email:quiet_heart000@126.com<br>Blog:quietheart.cublog.cn<br><br></font>
               
               
               
               
               
页: [1]
查看完整版本: wordpress简易安装过程