如果您已经设置了自己的域名,那么在其上设置WordPress站点非常容易。但是,在安装WordPress(WordPress)网站并开始使用它之前,您需要准备好几件事。
本指南将引导您了解有关准备域和虚拟主机帐户以安装WordPress、如何完成安装以及如何开始使用新的WordPress网站的所有信息。
设置您的域
无论您选择了哪个网络托管服务提供商,您都可以从您喜欢的任何域名提供商处购买域名。为了在域上设置WordPress(WordPress) ,您需要担心的一个重要设置是您的域的名称服务器指向正确的网络托管帐户。
这是您需要设置的第一件事。为此,请登录您的网络托管帐户并进入cPanel。通常,您会在左侧窗格的“统计(Stats)信息”部分下找到该 Web 托管帐户的两个名称服务器。它有时也称为DNS 服务器(DNS Servers)。
如果不存在,请查看您的虚拟主机提供的任何其他帐户信息页面以查找这些服务器。
拥有这些后,登录您的域提供商帐户并找到您的注册域。在您的域设置中,您应该能够找到名称服务器的定义位置。
更改列出的域以匹配您从托管帐户记录的两个名称服务器。
这会将所有传入该 Web 域的流量发送到您要设置WordPress网站的正确 Web 服务器。(WordPress)
设置您的主机帐户
现在您已将所有流向您的域的网络流量定向到正确的托管帐户,您还需要在您的托管帐户中配置该域。
这意味着您需要根据该域名创建一个新的托管帐户(在托管帐户注册期间配置)。或者,如果您已经有一个托管帐户,您可以向该帐户添加新域。
为此,请登录您的主机帐户并再次进入cPanel。在Domains部分下,选择Addon Domains。
在此部分中,填写与您要在虚拟主机上设置的域名相关的详细信息。
这些详细信息包括域名、子域(通常与末尾没有“.com”的域相同)、存储所有WordPress文件的子文件夹以及强密码。
注意(Note):插件域仅在您的网络主机启用该功能以在单个主机帐户上托管多个域时才有效。如果您的虚拟主机帐户仅使用一个域,则不必担心添加插件域。
测试名称服务器更改
既然您已将域提供商配置为将您的域的所有请求指向您的虚拟主机帐户,并且您已将您的虚拟主机帐户配置为从特定文件夹中提供您的 web 文件,那么是时候测试这些更改是否有效了。
登录您的网络托管帐户,打开 cPanel。在文件(Files)部分下,选择文件管理器(File Manager)。
对于要打开的目录,请选择您刚刚配置的域的文档根目录。选择前往(Go)。
你会看到这个目录当前是完全空的。为了测试站点是否正常工作,您将创建一个仅包含一行
的测试HTML文件。(HTML)
为此,请从顶部菜单中选择新建文件。(New file)
将新文件命名为index.htm。选择创建新文件(Create New File)按钮。现在,您将在该域的根文件夹中看到新的index.htm文件。(index.htm)Index.htm是人们第一次访问网站时登陆的默认网页。
右键单击该文件并选择“编辑(Edit)”以开始编辑该文件。
当访问者进入您的站点时,您不必为此文件在浏览器中显示做任何特别的事情。您需要做的就是输入一行。
This website is currently working correctly.
完成后,选择保存(Save)按钮。然后选择关闭(Close)
按钮。
最后,要测试一切是否正常,请打开 Web 浏览器并在浏览器URL字段中输入您的新域。
您应该会看到您创建的单行显示在浏览器中。
注意(Note):如果您在尝试使用浏览器连接到您的域时看到安全错误,您可能需要为该插件域启用SSL 。如果是这种情况,请联系您的网络主机技术支持,询问如何启用插件域SSL。
复制 WordPress 文件
既然您知道您的新域工作正常并且可以读取该域的 Web 主机根文件夹中的文件,那么您就可以安装
WordPress了。
为确保您安装的是最新版本的WordPress,请访问WordPress.org并下载最新版本。最后,将下载的文件解压缩到计算机上的WordPress目录中。
接下来,在您的计算机上打开一个 FTP 客户端,并通过您的网络托管服务提供商提供的(open an FTP client)FTP凭据连接到您的网络托管帐户。删除您之前创建的index.htm文件,并将该(index.htm)WordPress目录中的所有内容复制到您在虚拟主机帐户中为插件域创建的根目录中。
设置 MySQL 数据库
在安装WordPress之前,您需要为其创建MySQL数据库。这比听起来容易得多。
- 登录(Log)您的网络托管帐户并打开 cPanel。
- 滚动到Databases部分并选择MySQL Databases。
- 在创建新数据库部分中,为新域上的(Create a New Database)WordPress安装键入新数据库的名称。然后选择创建数据库(Create Database)。
接下来,为WordPress(WordPress)设置创建一个管理员帐户。为此,向下滚动到
MySQL 用户(MySQL Users)部分并输入帐户的用户名和密码。
接下来,将该用户与新数据库相关联。向下滚动(Scroll)到将用户添加(Add a User)到数据库(Database)部分。选择您刚刚创建的用户,选择您刚刚创建的新数据库,然后选择添加(Add)按钮。
在下一个屏幕上,您将看到一个向用户应用所有必要权限的窗口。选择所有权限(All Privileges),然后选择进行更改(Make Changes)。
现在您的SQL
数据库和管理员用户已准备好执行WordPress
安装过程。
配置 WP-Config.php 文件
运行WordPress(WordPress)安装例程之前的最后一步是配置wp-config.php文件。该文件将在您网站的根文件夹中找到;您之前复制所有WordPress(WordPress)文件的相同位置。
- (Log)像上一步一样登录到您的网络托管帐户并打开文件管理器。(File Manager)
- 导航到新域的文件夹,右键单击wp-config-sample.php文件,然后选择Edit。
在此文件中,您将看到定义数据库信息的部分。
将单引号中的大写文本替换(Replace)为您在上述步骤中添加新MySQL数据库时创建的所有项目的以下信息:
- 数据库名称:替换database_name_here。
- 数据库用户:替换username_here。
- 数据库密码:替换password_here。
您可以将DB_HOST设置保留为localhost。
- 完成后,选择保存(Save)按钮,然后选择关闭(Close)按钮。
- 最后,将文件wp-config-sample.php重命名为wp-config.php。
您现在已准备好运行WordPress安装!
安装 WordPress
现在您所有的WordPress文件都位于您网站的根目录中,启动(WordPress)WordPress安装所需要做的就是打开 Web 浏览器并访问该域。如果您正确设置了所有内容,您应该会看到以下窗口。
这意味着
WordPress安装已经启动,您正在查看第一步。选择您选择的语言,然后选择继续(Continue)。
在下一个屏幕上,您需要为新网站定义标题,以及网站管理员的帐户名和密码。在您的电子邮件(Your Email)字段中添加您的电子邮件地址。选择安装 WordPress(Install
WordPress)。
如果一切正常,您应该会看到一条成功(Success)消息,说明
WordPress已安装。
下一步
现在,当您在网络浏览器中访问您的域时,您将看到使用基本WordPress主题显示的新网站。
此时您可能已完成WordPress安装,但大多数人对默认(WordPress)WordPress主题的外观和感觉并不完全满意。
您可以做一些重要的事情来立即改善新WordPress网站的外观和感觉。
- 将 WordPress 主题下载到wp-content/themes文件夹,然后将主题安装在 WordPress 仪表板的Appearance/Themes页面中。
- 访问WordPress仪表板中的(WordPress)插件(Plugins)页面并安装关键插件,如SEO、Forms和其他插件,这些插件将增强您网站的功能(许多主题都带有插件)。
- 添加关于我们(About Us)和联系(Contact)页面,使您的网站看起来更专业。
当然,最重要的下一步是,既然您已经准备好新的WordPress
网站并准备就绪,那就是开始创建访问者会喜欢的精彩内容。
How To Manually Set Up WordPress On a Domain
If you have you own domain name already set υp, setting up a WordPress ѕite on іt is very еaѕy. However, there are seνeral things you’ll need to get ready before you can install your WordPress ѕіte and start υsing it.
This guide will walk you through everything you need to know about preparing your domain and your web hosting account for a WordPress installation, how to complete the installation, and finally how to start using your new WordPress website.
Set Up Your Domain
You can purchase
a domain from any domain provider you like, regardless of which web
hosting provider you’ve chosen. The single important setting you
need to worry about in order to set up WordPress on a domain is that
the nameservers for your domain point to the correct web hosting
account.
This is the first thing you’ll need to set up. To do this, log into your web hosting account and go into cPanel. Often, you’ll find the two Nameservers for that web hosting account listed in the left pane under the Stats section. It’s sometimes also called the DNS Servers.
If it’s not there, then look through any other account information pages your web host has provided to find those servers.
Once you have
these, log into your domain provider account and find your registered
domain. In your domain settings, you should be able to find where the
nameservers are defined.
Change the listed
domains to match the two nameservers you recorded from your hosting
account.
This will send
all incoming traffic to that web domain to the correct web server
where you’re going to have your WordPress website set up.
Set Up Your Hosting Account
Now that you have
all web traffic going to your domain directed to the correct hosting
account, you’ll need to configure that domain in your hosting
account as well.
This means you
need to either create a new hosting account based on that domain name
(configured during hosting account sign-up). Or, if you already have
a hosting account, you can add new domains to that account.
To do this, log into your hosting account and go into cPanel again. Under the Domains section, select Addon Domains.
In this section, fill out the details related to the domain name that you want to set up on your web host.
These details include the domain name, the subdomain (usually just the same as the domain without the “.com” at the end), the subfolder where all your WordPress files will be stored, and a strong password.
Note:
Addon domains only work if your web host has enabled the feature to
host multiple domains on a single hosting account. If you’re only
using one domain for your web host account, you won’t have to worry
about adding an addon domain.
Test The Nameserver Changes
Now that you’ve
configured your domain provider to point all requests for your domain
to your web hosting account, and you’ve configured your web hosting
account to server your web files from a specific folder, it’s time
to test that those changes work.
Logged into your
web hosting account, open cPanel. Under the Files section,
select File Manager.
For the directory
to open, select the document root for the domain that you’ve just
configured. Select Go.
You’ll see that
this directory is currently completely empty. To test that the site
is working properly, you’ll create a test HTML file with just a
single line.
To do this, select New file from the top menu.
Name the new file index.htm. Select the Create New File button. Now you’ll see the new index.htm file listed in the root folder for this domain. Index.htm is the default web page that people land on when they first visit a website.
Right-click the file and select Edit to start editing the file.
You don’t have
to do anything special for this file to display in the browser when
visitors enter your site. All you need to do is type a single line.
This website is currently working correctly.
When you’re
done, select the Save button. Then select the Close
button.
Finally, to test
that everything is working properly, open a web browser and type your
new domain into the browser URL field.
You should see
that single line you’ve created show up inside the browser.
Note: If
you see a security error when you try to connect to your domain with
your browser, you may need to enable SSL for that addon domain. If
this is the case, contact your web host tech support to ask how to
enable addon domain SSL.
Copy Over WordPress Files
Now that you know
your new domain is working properly and reading files on your web
host root folder for that domain, you’re ready to install
WordPress.
To make sure you’re installing the latest version of WordPress, visit WordPress.org and download the latest version. Finally, unzip the downloaded file into a WordPress directory on your computer.
Next, open an FTP client on your computer and connect to your web hosting account via the FTP credentials provided by your web hosting provider. Delete the index.htm file you created previously and copy all the contents from that WordPress directory into the root directory you created for your addon domain in your web host account.
Set Up a MySQL Database
Before you can
install WordPress, you need to create MySQL database for it. This is
much easier than it sounds.
- Log into your web hosting account and open cPanel.
- Scroll to the Databases section and select MySQL Databases.
- In the Create a New Database section, type a name for a new database for the WordPress installation on your new domain. Then select Create Database.
Next, create an
admin account for the WordPress setup. To do this, scroll down to the
MySQL Users section and type in the username and password for the
account.
Next, associate that user with the new database. Scroll down to the Add a User to a Database section. Select the user you just created, select the new database you just created, and select the Add button.
On the next
screen you’ll see a window to apply all necessary privileges to the
user. Select All Privileges, and then select Make Changes.
Now your SQL
database and admin user are ready to perform the WordPress
installation procedure.
Configure The WP-Config.php File
The last step before you can run the WordPress installation routine, is to configure the wp-config.php file. This file will be found in the root folder of your site; the same location where you copied over all the WordPress file previously.
- Log into your web hosting account and open the File Manager just like you did in the previous step.
- Navigate to the folder for your new domain, right click the wp-config-sample.php file, and select Edit.
In this file,
you’ll see a section that defines the database information.
Replace the
capitalized text in single quotes with the following information for
all the items you created when you added your new MySQL database in
the step above:
- Database Name: Replace database_name_here.
- Database User: Replace username_here.
- Database Password: Replace password_here.
You can leave the DB_HOST setting as localhost.
- Once you’ve finished, select the Save button, and then the Close button.
- Finally, rename the file wp-config-sample.php as wp-config.php.
You’re now
ready to run the WordPress installation!
Install WordPress
Now that all your WordPress files are at the root directory for your website, all you must do to launch the WordPress installation is to open a web browser and visit that domain. If you set everything up properly, you should see the following window.
This means the
WordPress installation has launched and you’re looking at the first
step. Select the language of your choice and select Continue.
On the next
screen, you’ll need to define a title for your new website, as well
as an account name and password for the administrator of the website.
Add your email address in the Your Email field. Select Install
WordPress.
If everything
worked properly, you should see a Success message stating that
WordPress has been installed.
Next Steps
Now, when you
visit your domain in a web browser, you’ll see your new website
displayed using the basic WordPress theme.
You may be done with your WordPress installation at this point, but most people aren’t completely happy with the look and feel of the default WordPress theme.
There are a few
important things you can do to immediately improve the look and feel
of your new WordPress website.
- Download a WordPress theme to the wp-content/themes folder and install the theme in the Appearance/Themes page in your WordPress dashboard.
- Visit the Plugins page in your WordPress dashboard and install critical plugins like SEO, Forms, and other plugins that will enhance the functionality of your website (many themes come with plugins).
- Add an About Us and Contact pages to make your website look professional.
Of course, the
most important next step, now that you have your new WordPress
website up and ready to go, is to start creating fantastic content
that visitors will enjoy.