Me pehea te whakauru i te WordPress ki a Ubuntu 18.04 me nga paanui?

Ubuntu18.04 WordPress

Kua kotahi te mana o WordPress o nga punaha whakahaere ihirangi (CMS) e rongonui ana, e whakamahia ana i te whatunga, Na te mea ka taea te whakarereke ki nga momo whakamahinga, he maha ano nga mono-mai e ahei ana koe ki te whakarei ake i tana whakamahinga me te kore e waiho nga kaupapa, nga hiako ranei o tenei roto.

Tenei wa ka tohaina e maatau tetahi aratohu maamaa mo te whakauru i te WordPress ki Ubuntu, tenei kia whai papaanga whakamatautau ranei mo nga taangata kaore ano kia mohio ki tana mahi.

Nga mahi whakaurunga

I mua i te mahi i tetahi mea, me whakahou e koe te punaha me:

sudo apt-get upgrade && sudo apt-get upgrade -y

Nginx whakauru

Hei whakauru i te WordPress ki ta maatau punaha, ka whirinaki atu maatau ki etahi taputapu hei mahi maana, te tuatahi ko Nginx:

sudo apt-get install nginx -y

MariaDB whakauru

para te ratonga pātengi raraunga ka tohua e maatau MariaDB, mo tana whakauru ka mahia e maatau:

sudo apt-get install mariadb-server -y

Kua oti tenei inaianei ka mahia e matou tenei whakahau e whai ake nei hei whirihora i te kaituku pātengi raraunga:

mysql_secure_installation

Anei anake ka whai maatau i nga tohutohu ka tono mai ki a maatau ki te whakarite i tetahi kupuhipa, e kore e warewarehia e tatou.

hanga o te pātengi raraunga

Me takiuru tatou me nga tohu ka whakauruhia e tatou, mena ka waihohia e maatau nga mea taunoa, me penei:

mysql -u root -p

Ki te kore e waiho e ratou to ingoa kaiwhakamahi i muri i -u me to kupu huna i muri i -p

Mahia tenei kua tae ki te wa ki te hanga paerewa korero, ma tenei e tukuna ai a WordPress ma te whakamahi i enei whakahau:

CREATE DATABASE wordpress;

CREATE USER `tu-usuario`@`localhost` IDENTIFIED BY 'tucontraseña';

GRANT ALL ON wordpress.* TO `wpuser`@`localhost`;

FLUSH PRIVILEGES;

exit;

Anei i roto i enei ka whakakapihia e koe te ingoa kaiwhakamahi me to kupu huna mo te paataka raraunga.

Whakauru PHP

Hei whakauru i te PHP me ona whakawhirinaki me ona waahanga e tika ana, whakahaerehia te whakahau e whai ake nei:

sudo apt-tiki whakauru php-fpm php-curl php-mysql php-gd php-mbstring php-xml php-xmlrpc -y

Whakamutua tenei kite wa ka whakatika matou i te konae php.ini.

sudo nano /etc/php/7.2/fpm/php.ini

Y titiro mo tenei raina:

;cgi.fix_pathinfo=1

Me whakarereke e tatou te raina te tango i te; huri i te = 1 ki = 0, e whai ake nei:

cgi.fix_pathinfo=0

I muri i ka rapuhia e maatau nga raina e whai ake nei i roto i te konae php.ini ka waiho nga uara e whai ake nei, me penei te ahua:

upload_max_filesize = 100M
post_max_size = 1000M
memory_limit = 1000M
max_execution_time = 120

Tangohia te WordPress

Kupu-ubuntu

I teie nei kia tango a i te waahanga hou o te WordPress a ka waiho e maatau ki te raarangiarangi Nginx taunoa:

cd /var/www/html

wget https://wordpress.org/latest.tar.gz

Wewetehia te konae hou me te:

tar -zxvf latest.tar.gz --strip-components=1

I teie nei kia hurihia nga whakaaetanga o te kōpaki Nginx:

chown -R www-data:www-data /var/www/html/
chmod -R 755

Mahia tenei kia hanga he konae whirihoranga me:

nano /etc/nginx/sites-available/example.com

Y hoatu e matou te whai ake:

server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.php index.html index.htm;
server_name example.com www.example.com;
client_max_body_size 500M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

I teie nei me whakaahei e tatou ma:

ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

I teie nei whakaara ano i a Nginx me PHP kia whai mana nga panoni

sudo systemctl restart nginx.service
sudo systemctl restart php7.2-fpm.service

Te whakatuu i a WordPress

I teie nei kia whakatika a te konae whirihora WordPress ka waiho e maatau nga tohu o te paataka raraunga:

mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php

sudo nano /var/www/html/wp-config.php

Y ka whakarerekehia e maatau nga korero o roto ia:

define('DB_NAME', 'wordpress');
define('DB_USER', 'usuario-de-la-base-de-datos');
define('DB_PASSWORD', 'contraseña-de-la-base-de-datos');

Mahia tenei mo nga take ahuru, me whakahou e raatau nga ki o te ahuru i roto i to wp-config.

Na e me whakaputa e tatou ki a raatau, ka mahi maatau ma te toro tenei hononga ka whakarerekehia e maatau nga uara e homai ana ki tenei papaanga ki ta maatau konae whirihoranga.

Ka oti Kua oti i a maatau a WordPress te whakauru ki ta maatau punaha.

Hei tiimata ki te whakamahi maatau Me whakatuwhera he tirotiro tirotiro ka tuu ai ki te paetaumaki te huarahi e taea ai e taatau te paanui / var / www / html / to maatau ip ranei.


Ko nga korero o te tuhinga e piri ana ki o maatau kaupapa o matatika whakatika. Ki te ripoata i tetahi paatene paato Here.

2 korero, waiho maau

Waiho to korero

Ka kore e whakaputaina tō wāhitau īmēra. Kua tohua ngā āpure e hiahiatia ana ki *

*

*

  1. He kawenga mo nga raraunga: Miguel Ángel Gatón
  2. Te kaupapa o te raraunga: Whakahaerehia te SPAM, te whakahaere korero.
  3. Ture: To whakaae
  4. Whakawhitinga korero: Kaore nga korero e tukuna ki nga taha tuatoru engari ma te ture herenga.
  5. Rokiroki raraunga: Paetukutuku e whakahaerehia ana e Occentus Networks (EU)
  6. Tika: I nga wa katoa ka taea e koe te whakaiti, te whakaora me te muku i o korero.

  1.   kohatu ka mea

    I tenei ka hurihia e maatau nga whakaaetanga o te kōpaki Nginx:

    chown -R www-raraunga: www-data / var / www / html /
    chmod -R 755

    Hapa i muri i te chmod -R 755 (parameter ngaro)

  2.   Romuald ka mea

    Tena whakatikahia sudo apt-get upgrade && sudo apt-get upgrade -y

    e

    sudo apt-get update && sudo apt-get upgrade -y