Sidee loo rakibaa WordPress on Ubuntu 18.04 iyo derivatives?

Ubuntu18.04WordPress

WordPress wuxuu noqday mid ee nidaamyada maaraynta maaddada (CMS) ugu caansan oo loo isticmaalo shabakadda, Tani waxay sabab u tahay xaqiiqda ah in lala qabsan karo noocyada isticmaalka kala duwan, waxay sidoo kale leedahay tiro badan oo fiilooyin ah oo kuu oggolaanaya inaad sii xoojiso isticmaalkiisa oo aanad ka tegin mawduucyada ama maqaarka harada.

Markan waxaan la wadaageynaa hage fudud oo ku saabsan sida loo rakibo WordPress-ka Ubuntu, tan si loo helo goob imtixaan ama dadka aan wali aqoon shaqadooda.

Habka rakibida

Kahor intaadan wax sameyn, waa inaad ku cusboonaysiisaa nidaamka:

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

Rakibida Nginx

Si loo rakibo WordPress nidaamkayaga, waxaan isku halleyneynaa xoogaa qalab ah oo ku shaqeynaya, midka hore waa Nginx:

sudo apt-get install nginx -y

Rakibaadda MariaDB

para adeegga keydka macluumaadka ee aan dooran doonno MariaDB, rakibideeda waxaan fulineynaa:

sudo apt-get install mariadb-server -y

Tan ayaa hadda la sameeyay waxaan fulineynaa amarka soo socda si aan u qaabeyno serverka keydka keydka:

mysql_secure_installation

Halkan kaliya waan raaci doonaa tilmaamaha waxayna na weydiin doontaa inaan dejino erey sir ah, taas oo ay tahay inaan ilaawin.

abuurista keydka macluumaadka

Waa inaan ku galnaa aqoonsiyada aan gelinoHaddii aan ka tagno kuwii hore, waa inay noqotaa sida soo socota:

mysql -u root -p

Haddayna dhigin magacaaga usernka ka dib -u iyo lambarkaaga sirta ah kadib -p

Tan ayaa la sameeyay waa waqtigii la abuuri lahaa xog-ururin, kaas oo WordPress loogu adeegi doono iyadoo la fulinayo amarradan:

CREATE DATABASE wordpress;

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

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

FLUSH PRIVILEGES;

exit;

Halkan kuwan waxaad ku bedeleysaa magaca isticmaalaha lambarkaaga sirta ah ee keydka macluumaadka.

Rakibaadda PHP

Si loo rakibo PHP dhammaan ku tiirsanaanta lagama maarmaanka u ah iyo qaybaha, ordo amarka soo socda:

sudo apt-hel rakib php-fpm php-curl php-mysql php-gd php-mbstring php-xml php-xmlrpc -y

Tan ayaa loo sameeyayWaqtiga aan wax ka badalayno faylka php.ini.

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

Y raadi xariiqan:

;cgi.fix_pathinfo=1

Waa inaan xariijinta xariijinta ka saarida; beddel = 1 illaa = 0, hadhay sida soo socota:

cgi.fix_pathinfo=0

Kadib waxaan ka raadin doonnaa khadadka soo socda feylka php.ini oo waxaan dhigeynaa qiyamka soo socda, waa inay u ekaadaan sidan:

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

Soo dejiso WordPress

WordPress-ubuntu

Hadda aan kala soo baxno nooca ugu dambeeya ee WordPress oo waxaan ku ridi doonnaa galka caadiga ah ee Nginx:

cd /var/www/html

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

Feeji faylka hadda lagu soo dejiyey:

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

Hadda aan bedelno rukhsadaha galka Nginx:

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

Tan ayaa la sameeyay aan ku abuurno feyl isku xir ah:

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

Y waxaan dhigaynaa waxyaabaha soo socda:

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;
}
}

Hadda waa inaan ku awood siino:

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

Hadda dib u bilaw Nginx iyo PHP si isbeddeladu u dhaqan galaan

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

Dejinta WordPress

Hadda aan wax ka bedelno feylka qaabeynta WordPress halkaas oo aan dhigeyno aqoonsiga macluumaadka:

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

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

Y waxaan ku badali doonaa macluumaadka gudaha isagu:

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

Tan ayaa la sameeyay sababo amni awgood, waa inay cusboonaysiiyaan furayaasha amniga ku jira wp-config.

Marka taas waa inaan abuurnaa, waxaan tan ku sameeynaa booqashada xidhiidhkan oo waxaan bedeleynaa qiimaha ay boggan naga siinayaan feylkeena qaabeynta.

Oo lagu sameeyo Waxaan horeyba ugu rakibnay WordPress nidaamkayaga.

Si aad u bilowdo isticmaalkeeda si fudud Waa inaan furnaa biraawsar oo aan dhignaa cinwaanka barta cinwaanka aan ku leenahay wordpress / var / www / html / ama cinwaankayaga ip.


Nuxurka maqaalka wuxuu u hogaansamayaa mabaadi'deena anshaxa tifaftirka. Si aad u soo sheegto khalad guji Halkan.

2 faallooyin, ka tag taada

Ka tag faalladaada

cinwaanka email aan la daabacin doonaa.

*

*

  1. Masuul ka ah xogta: Miguel Ángel Gatón
  2. Ujeedada xogta: Xakamaynta SPAM, maaraynta faallooyinka.
  3. Sharci: Oggolaanshahaaga
  4. Isgaarsiinta xogta: Xogta looma gudbin doono dhinacyada saddexaad marka laga reebo waajibaadka sharciga ah.
  5. Kaydinta xogta: Macluumaadka ay martigelisay Shabakadaha Occentus (EU)
  6. Xuquuqda: Waqti kasta oo aad xadidi karto, soo ceshan karto oo tirtiri karto macluumaadkaaga.

  1.   dhagax dijo

    Hadda waxaan bedeleynaa rukhsadaha galka Nginx:

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

    Cilad kadib chmod -R 755 (dhimaya dhumucda)

  2.   Romuald dijo

    Fadlan sax sudo apt-get casriyaynta && sudo apt-get upgrade -y

    by

    sudo apt-get update && sudo apt-get casriyaynta -y