AMH-WP 搭建个人博客网站:使用 AMH主机面板 WordPress安装

使用 AMH主机面板 ,在服务器上已经成功搭建了LNMP环境,环境部署完毕后,接下来要使用AMH面板安装一个PHP程序的WordPress博客网站。WordPress ,一个基于PHP和MySQL的免费开源内容管理系统。全球使用最广泛的CMS软件,8 千多个免费主题,5 万多个免费插件,具有强大的生态支持。它不单单适合程序员自建网站,也适合没有技术背景的普通用户搭建个人博客网站或者公司门户网站。

官方网站:https://wordpress.org 

除此之外,比较热门的博客框架还有JekyllHexoHugoSolo等等。

下面以WordPress为例,使用AMH主机面板安装WordPress。

AMH-WP 在线安装 WordPress

在安装WordPress之前,在AMH面板中,将软件商店中的软件按需安装,PHP扩展安装需要先将软件商店中的php扩展安装完毕后,才可以在网站中操作安装,否则安装会失败。配置好缓存应用。

配置网站相关内容

第一步:将域名解析到服务器所在IP地址

第二步:新增虚拟主机

在AMH主机面板中点击网站菜单,在虚拟主机菜单下面新增虚拟主机。

1e79f0348f340e1d6d9b5903400807f0

新增虚拟主机时:

  • 主标识域名:填写你的域名名称,这个用于在服务器上创建网站存放目录。
  • 运行环境:默认选择,之前安装好的lnmp环境,lnmp01(AMH可以同时创建多个环境。)
  • 监听IP端口:默认80端口,勾选设为环境的默认主机,然后点击IPV6按钮。
  • 绑定域名:这里绑定你之前解析过来的域名,支持泛域名绑定。
  • 默认主页:无需更改,默认静态页面和php
  • URL重写规则:之前在AMH面板中安装过重写规则的软件,点击后面的管理规则。创建一个URL规则文件。

新增管理规则,在可选规则中,选择wordpress2,这条规则是WordPress的伪静态规则,如果你创建的WordPress不想使用静态页面访问的话,可以忽略这条规则。

location / {
    try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

location ~* .(css|js|png|jpg|jpeg|gif|gz|svg|ttf|webp|woff|woff2)$ {
access_log off;
add_header Cache-Control max-age=36000;
}

下面开始配置nginx规则。

规则新增完毕后,关闭窗口。在之前的窗口中,点击刷新列表,然后选择wordpress2.conf保存后,虚拟主机创建成功。

1f9c48b9bf84f120840533d8d3221570

第三步:安装一些常用的PHP扩展。

在网站菜单下,点击扩展安装,勾选下面的PHP扩展后点击提交,安装扩展(fileinfo,intl,gettext,bcmath,opcache,pecl_imagick,exif,zbarcode)。

耐心等待代码全部跑完,PHP扩展全部安装完毕后,才可以进行下一步操作。

第四步:SSL证书申请

点击网站菜单下的SSL证书,创建AMSSL网站证书。

  • 选择一键自动配置应用,
  • 创建方式选择使用文件验证。
  • 所属环境选择lnmp01
  • 所属主机选择你创建的主机名称。
  • 点击创建

SSL证书已经创建成功了,点击证书管理下面的应用,将证书启用。

证书启用成功后,还需要进行简单的配置,开启强制https,优化加强提速,证书自动续期。

SSL证书已经申请成功了。有效期三个月,三个月自动续期。无需手工操作。

最后在环境变量中再做一些设置,这些设置因人而已,没有硬性要求如何修改。

网站设置这里已经告一段落了,接下来需要安装WordPress程序。

安装WordPress程序

点击文件菜单,在文件管理中可以看到,/home/wwwroot/lnmp01/domain/freeccb/web/ 是当前存放的web文件的路径,将WordPress程序下载到web文件夹内。

在web文件夹下,点击下面的远程上传按钮,将WordPress程序的下载地址粘贴进去。点击确认,开始下载WordPress程序。

#wordpress最新版下载地址,复制下面链接。
https://cn.wordpress.org/latest-zh_CN.tar.gz

WordPress程序下载完毕后,解压缩。

勾选 latest-zh_CN.tar.gz文件,然后在下面的压缩类型中选择tar.gz,这个压缩类型要跟解压缩文件的扩展名一致。之后点击智能解压

解压缩后,需要将wordpress文件内的文件移动到web文件夹内,同时删除掉web文件夹里的index.htm文件。

d56422116a2910eb5a63db99f6c86ccb

web文件夹内选择文件没然后点击删除,就可以删除掉文件,可视化删除,非常简单。

全选wordoress文件夹内的所有文件,然后点击移动

点击移动,将文件移动到上级目录web中,点击上级,自动切换到web目录,之后点击确认,进行移动。

文件已经移动成功了,接下来将wp-config-sample.php改名为wp-config.php,点击wp-config-sample.php文件后面的重命名进行修改。

修改完毕后,点击打开wp-config.php文件,编辑以下内容。

WordPress数据库的名称:define( ‘DB_NAME', ‘WordPress' );
MySQL数据库用户名:define( ‘DB_USER', ‘root' );
MySQL数据库密码:define( ‘DB_PASSWORD', ‘mysql密码' );
MySQL主机:define( ‘DB_HOST', ‘localhost' );
创建数据表时默认的文字编码:define( ‘DB_CHARSET', ‘utf8' );

在文件末尾添加wp内存大小,建议设置128M或更高,和更新插件时免登录ftp

define('WP_MEMORY_LIMIT', '128M');
define('FS_METHOD','direct');

当前的mysql密码还是默认的密码,这里需要修改一下mysql的密码,点击数据库,在数据库菜单下的用户管理中,选择修改密码,输入你设置的mysql密码,用户是默认的root,密码输入完毕后,点击提交即可。

修改完毕后,保存文件,之后在数据库菜单中的快速建库中,点击数据库后,输入数据库名称:WordPress,创建一个空库就可以了。

注意:这个数据库名称与上面wp-config.php中配置的要一样。

最后在数据库的参数配置中,将是否开启监听端口远程访问,选择开启,默认是关闭的,这里不开启的话,程序无法连接数据库。

设置web目录权限,wordpress解压缩后,文件的用户和用户组需要修改为www

勾选web目录,进行权限设置,否则在wordpress中无法安装插件和主题。

好了,到这里WordPress的服务器端配置已经全部完毕了,

如何将www域名跳转到主域名上

很多人都习惯使用www+域名访问网站,这是一个历史遗留下来的问题,也是一个非常不好的习惯。

在浏览器中,输入域名,然后按ctrl+回车,可以自动跳转到www.你的域名.com

在SEO中,搜索引擎把主域名和带www的域名会默认为两个网站,其实www域名是主域名的二级域名,在AMH中,需要将www域名跳转到主域名上。

你需要建立一个子域主机

URL重写规则中,点击管理规则,新建一个www.conf的规则,用来跳转。新建一个域名跳转,类型选择301,匹配域名选择指定域名,输入你的www域名,下面跳转到不带www的主域名

规则创建后,在子域主机中建立子域名主机。建立完毕后,还需要在SSL证书中,申请www域名的证书。

子域名WWW的SSL证书创建完毕后,点击应用,开启强制https和优化访问,开启自动续期后,就成功了。

这时候在浏览器中无论输入http还是https的www域名都会默认跳转到主域名上。

浏览器设置WordPress网站

接下来在浏览器中访问网站域名,在web端配置WordPress网站,按照步骤一步一步进行安装就可以了。建议使用谷歌浏览器进行访问。

所有评论(2)

  1. rocket china说道:

    This message is used to verify that this feed (feedId:72526470377968640) belongs to me (userId:72521161936665600). Join me in enjoying the next generation information browser https://follow.is.

  2. Frederick说道:

    If you like to coach chest, you most likely have already got well-developed entrance
    delts. After all, they’re engaged in all of your pressing moves, especially inclines.

    However comparatively weak anterior delts may be holding you back
    from an even bigger chest, so this is a front-delt-focused workout you
    should use rather than your regular shoulder routine.
    Combining chest and shoulders is a versatile
    approach to structure your weight coaching. You’ll make the most of the pyramid coaching system in your bench press units.

    If you go up from 50s to 55s, it’s a fifty five in each hand which
    is a ten lb total improve. The vary is extensive, from basic
    overhead presses to distinctive variations just like the Arnold press and
    cable rear delt fly. The angle of the cable overhead press can assist recruit new muscle fiber that’s
    not engaged a lot with different kinds of shoulder presses because the pressure
    is knocking down behind you.
    Much like with facet laterals, it’s straightforward to select too heavy a weight within the front increase.
    Avoid swinging the dumbbells to get the most out of your entrance raises,
    and use a strict, managed motion all through. Five to 10 minutes of low to moderate-intensity cardio
    will get your heart pumping and blood flowing.
    Whereas not strictly necessary, it helps your body prepare for the high-intensity work to
    come. Since you’re doing shoulders, contemplate doing cardio involving your higher
    physique. Utilizing the cross-trainer or rowing machine
    as a substitute of the stationary bike or treadmill is appropriate.
    Maintain in mind that your goal is only to get heat and prepared right here,
    so don’t go all-out on your cardio.
    A cable crossover machine is useful but optional as you get alternative workout routines utilizing free weights where applicable.
    The workout under works the muscular tissues in the shoulders from
    all angles, and is a difficult session that makes use of a variety of heavy weights.

    As such, you need a shoulder warm-up that covers all of the planes of motion you’re about to work your shoulders in, and we have just the thing
    for you. This shoulder warm-up is made up of eight
    workout routines and uses quite so much of equipment to guarantee
    you are completely ready for the exercise correct.

    If planning a session to work all those muscle tissue without placing undue
    stress in your shoulders sounds like a lot of work, the wonderful
    news is we’ve accomplished that give you the results you want.

    You can even maintain your exercises slightly shorter with a 4 day break
    up. While you must hold your workouts constant every week, it’s OK to change up the order of the workouts
    on any given day. So, you’ll be doing the same workouts,
    however in a special order.
    While it is possible to perform all of the workouts in a single
    session, it is important to assume about your power levels and recovery capability.
    Splitting your shoulder exercises into multiple classes or specializing in completely different deltoid
    heads on completely different days might help manage fatigue
    and promote better recovery. A tri-set workout coaching entails performing three
    different exercises in a row (such as overhead press, biceps curl, and rope pushdown) with little or no relaxation in between. The upright row is the only open-chain multi-joint exercise concentrating on the middle deltoid, efficient for constructing each shoulder and trapezius dimension and power.
    It is an essential motion to study when participating in weightlifting, particularly
    as a part of the high pull part of the clear. Utilizing dumbbells as
    a substitute of a barbell on your overhead
    presses targets both sides individually and strengthens both
    equally.
    It’s one of the most well-liked compound actions for that reason. It’s
    additionally among the many extra advanced workout routines on this listing, so make positive you get the shape proper
    earlier than upping the plates. By Way Of bracing yourself during the lift, your core can be engaged, helping
    stability and stability.

    References:

    steroid transformation before and after (Frederick)

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注