欢迎光临
我们一直在努力

[我的阿里云服务器] —— WorkPress

wordpress是基于PHP和MYSQL编成的一套博客系统,因此一般会选择LAMP环境来让它最稳定地运行,

服务器配置(因为处于学习,所以几乎选了最破的配置了):

1、CPU:单核

2、内存:512M

3、系统盘:Linux送20G,Ubuntu 12.04 64位系统

4、数据盘:10G

5、公网带宽:1M

 

一、下载WorkPress

然后放在apache的目录中就可以了。

首先,使用wget命令:

这个命令,将lastest.tar.gz下载到当前所在目录,

我们可以使用pwd命令查看当前,所在目录。

然后,使用ls命令查看文件。

 

二、解压

因为都是在当前目录,所以直接tar解压即可。

使用命令:

其中:

x 解压缩
v 显示文件名
z 使用 gzip 压缩解压缩
f 基于文件
 
那么,wordpress就被解压到/root/wordpress中了。
 

三、添加到apache中

将解压好的文件,复制到apache目录中即可。
-r 给出的源文件是一目录文件,此时cp将递归复制该目录下所有的子目录和文件。此时目标文件必须为一个目录名。
-f 删除已经存在的目标文件而不提示。

 

四、添加数据库

我们需要给wordpress建一个数据库,然后配置给wordpress进行使用。

下面代码,创建一个名字为wordpress的数据库。

 

五、修改配置

我们需要手动配置wordpress对于mysql数据库的部分,wordpress才可以正常使用。

我们刚才已经把数据库创建好了,下面填入有些部分就可以了。

<?php /** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix, * Secret Keys, WordPress Language, and ABSPATH. You can find more information * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing * wp-config.php} Codex page. You can get the MySQL settings from your web host. * * This file is used by the wp-config.php creation script during the * installation. You don't have to use the web site, you can just copy this file * to "wp-config.php" and fill in the values. * * @package WordPress */ // ** 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', 'usert'); /** MySQL database password */ define('DB_PASSWORD', 'password'); /** 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', ''); /**#@+ * Authentication unique Keys and Salts. * * Change these to different unique phrases! * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. * * @since 2.6.0 */ define('AUTH_KEY', 'put your unique phrase here'); define('SECURE_AUTH_KEY', 'put your unique phrase here'); define('LOGGED_IN_KEY', 'put your unique phrase here'); define('NONCE_KEY', 'put your unique phrase here'); define('AUTH_SALT', 'put your unique phrase here'); define('SECURE_AUTH_SALT', 'put your unique phrase here'); define('LOGGED_IN_SALT', 'put your unique phrase here'); define('NONCE_SALT', 'put your unique phrase here'); /**#@-*/ /** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each a unique * prefix. Only numbers, letters, and underscores please! */ $table_prefix = 'wp_'; /** * WordPress Localized Language, defaults to English. * * Change this to localize WordPress. A corresponding MO file for the chosen * language must be installed to wp-content/languages. For example, install * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German * language support. */ define('WPLANG', ''); /** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that plugin and theme developers use WP_DEBUG * in their development environments. */ define('WP_DEBUG', false); /* That's all, stop editing! Happy blogging. */ /** Absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php');

大功告成,现在访问http://服务器所在Ip或域名/wordpress。

成功显示,那么我们就搞定了。

 

六、其他

 1、代码语法高亮

安装插件SyntaxHighlighter Evolved。然后在写博文时对代码添加标签即可。

 举例:

[c]c语言代码[/c]

[php]php代码[/php]

有一些没有,例如xaml,可以用xml替换

[xml]类xml代码[/xml]

 

错误提示:Unable to create directory wp-content/uploads/2013/...

解决办法:在wp-content/目录下,建立uploads目录,然后提升uploads目录权限。

解决问题。

在安装的过程中,一直出现can not create directory /var/www/wordpress/wp-content/uploads/../themes等错误。

虽然chmod 777 /var/www/wordpress/wp-content,但是没有效果。

解决办法:

也不知道为什么,反正这样自己创建这个目录后,就好了。

 

这篇博文是本人的研究总结,分享给有需要的人。

 

  • 海报
海报图正在生成中...
赞(0) 打赏
声明:
1、本博客不从事任何主机及服务器租赁业务,不参与任何交易,也绝非中介。博客内容仅记录博主个人感兴趣的服务器测评结果及一些服务器相关的优惠活动,信息均摘自网络或来自服务商主动提供;所以对本博客提及的内容不作直接、间接、法定、约定的保证,博客内容也不具备任何参考价值及引导作用,访问者需自行甄别。
2、访问本博客请务必遵守有关互联网的相关法律、规定与规则;不能利用本博客所提及的内容从事任何违法、违规操作;否则造成的一切后果由访问者自行承担。
3、未成年人及不能独立承担法律责任的个人及群体请勿访问本博客。
4、一旦您访问本博客,即表示您已经知晓并接受了以上声明通告。
文章名称:《[我的阿里云服务器] —— WorkPress》
文章链接:https://www.456zj.com/3868.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址