在AWS亚马逊Linux上安装WordPress

我安装了WordPress,因此做了记录。

用过的版本

パッケージバージョンhttpdApache/2.4.23 (Amazon)php5.6.24mysql5.6.32wordpress4.6

WordPress安装

创建WordPress用户并将WordPress放置在主目录中。

所需的软件包

yum install -y httpd24 php56 mysql56-server
yum install -y php56-mcrypt php56-intl php56-mbstring php56-mysqlnd php56-opcache php56-devel

用户创建

使用root用户创建。

sudo su
useradd wordpress

安装WordPress

使用WordPress的用户进行安装。

su wordpress
cd ~
wget https://ja.wordpress.org/wordpress-4.6-ja.zip
unzip wordpress-4.6-ja.zip

权限设置。

我将在root用户下更改权限(以使apache能够加载)进行设置。

exit
chmod 770 /home/wordpress
chgrp apache -R /home/wordpress
find /home/wordpress -type d -exec chmod 0770 {} \;
find /home/wordpress -type f -exec chmod 0660 {} \;

httpd的配置

在root用户下进行设置。

vi /etc/httpd/conf.d/wordpress.conf
ServerName [ドメインかIPを入力]
<VirtualHost *:80>
        Servername [ドメインかIPを入力]
     DocumentRoot /home/wordpress/wordpress

         <Directory "/home/wordpress/wordpress">
                Options FollowSymlinks
                AllowOverride All
                Require all granted
         </Directory>

        ErrorLog /var/log/httpd/wordpress-error_log
        CustomLog /var/log/httpd/wordpress-access_log common

</VirtualHost>

启动httpd
/etc/init.d/httpd start

mysql配置

以根用户的身份进行设置。

作为示例,我们创建一个数据库:WordPress,用户:WordPress,密码:WordPress。

/etc/init.d/mysql start
mysql
create database wordpress CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON wordpress.* TO wordpress@localhost IDENTIFIED BY 'wordpress';
quit

在网页上显示

キャャ.PNG
キャプ.PNG

也许最好将不再使用的wp-admin/setup-config.php文件的权限更改,让Apache无法访问。
执行命令:chmod 600 /home/wordpress/wordpress/wp-admin/setup-config.php。

bannerAds