Yadda ake girka WordPress akan Ubuntu 18.04 da abubuwan ban sha'awa?

Ubuntu 18.04 WordPress

WordPress ya zama ɗaya na tsarin sarrafa abun ciki (CMS) mafi mashahuri kuma ana amfani dashi a cikin hanyar sadarwa, Wannan saboda za'a iya daidaita shi zuwa nau'ikan amfani da dama, shima yana da adadi mai yawa wanda zai ba ku damar haɓaka amfani da shi ba tare da barin jigogi ko fatun wannan tafkin ba.

Wannan lokaci zamu raba jagora mai sauki kan yadda ake girka WordPress a cikin Ubuntu, wannan don samun shafin gwaji ko na mutanen da basu san aikin sa ba tukunna.

Tsarin shigarwa

Kafin yin komai, dole ne ku sabunta tsarin tare da:

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

Nginx kafuwa

Domin sanya WordPress akan tsarinmu, za mu dogara da wasu 'yan kayayyakin aiki, na farko shine Nginx:

sudo apt-get install nginx -y

Shigar MariaDB

para sabis ɗin bayanan da za mu zaɓi MariaDB, don girkawa muna aiwatarwa:

sudo apt-get install mariadb-server -y

Anyi wannan yanzu za mu aiwatar da wannan umarni don saita sabar uwar garken bayanai:

mysql_secure_installation

A nan kawai za mu bi umarnin kuma zai tambaye mu saita kalmar sirri, wanda bai kamata mu manta da shi ba.

ƙirƙirar bayanan bayanai

Dole ne mu shiga tare da takardun shaidarka da muka sanya, idan muka bar tsoffin, ya zama kamar haka:

mysql -u root -p

Idan bai kamata su sanya sunan mai amfani bayan -u da kalmar wucewarsu ba bayan -p

Anyi wannan lokaci ya yi da za a kirkiro bayanai, tare da abin da za a yi amfani da WordPress ta hanyar aiwatar da waɗannan umarnin:

CREATE DATABASE wordpress;

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

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

FLUSH PRIVILEGES;

exit;

Anan cikin wadannan za ku maye gurbin sunan mai amfani tare da kalmar sirrinku don ajiyar bayanan.

Shigar PHP

Don shigar da PHP tare da duk abubuwan dogaro da matakan sa, gudanar da umarnin mai zuwa:

sudo apt-samun shigar php-fpm php-curl php-mysql php-gd php-mbstring php-xml php-xmlrpc -y

Anyi wannan zuwalokacin da zamu shirya fayil ɗin php.ini.

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

Y nemi wannan layin:

;cgi.fix_pathinfo=1

Dole ne mu damu da layin cirewa; canza = 1 zuwa = 0, zauna kamar haka:

cgi.fix_pathinfo=0

Después zamu bincika layuka masu zuwa a cikin fayil ɗin php.ini kuma sanya waɗannan ƙimar masu zuwa, ya kamata su yi kama da wannan:

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

Zazzage WordPress

WordPress-ubuntu

Yanzu bari mu zazzage sabon sigar WordPress kuma za mu sanya shi a cikin tsoffin kundin adireshin Nginx:

cd /var/www/html

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

Cire sabon fayil ɗin da aka zazzage tare da:

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

Yanzu bari mu canza izini na babban fayil na Nginx:

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

Anyi wannan bari mu ƙirƙiri fayil ɗin daidaitawa tare da:

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

Y mun sanya wadannan:

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

Yanzu dole ne mu taimaka ta tare da:

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

Yanzu sake kunna Nginx da PHP don canje-canje suyi tasiri

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

Kafa WordPress

Yanzu bari mu shirya fayil ɗin sanyi na WordPress inda za mu sanya takaddun bayanan bayanai:

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

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

Y za mu canza bayanin a ciki shi:

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

Anyi wannan saboda dalilan tsaro, dole ne su sabunta makullan tsaro a cikin wp-config.

Don haka dole ne mu samar da su, muna yin wannan ta ziyartar wannan haɗin kuma muna canza ƙimomin da wannan rukunin yanar gizon yake ba mu a cikin fayil ɗinmu na daidaitawa.

Kuma anyi dashi Mun riga mun shigar da WordPress akan tsarinmu.

Don fara amfani dashi kawai Dole ne mu buɗe burauzar kuma mu sanya a cikin adireshin adireshin hanyar da muke da rubutun kalmomi / var / www / html / ko adireshinmu na ip.


Abubuwan da ke cikin labarin suna bin ka'idodinmu na ka'idojin edita. Don yin rahoton kuskure danna a nan.

2 comments, bar naka

Bar tsokaci

Your email address ba za a buga. Bukata filayen suna alama da *

*

*

  1. Mai alhakin bayanan: Miguel Ángel Gatón
  2. Dalilin bayanan: Gudanar da SPAM, gudanar da sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.

  1.   Pierre m

    Yanzu zamu canza izini na babban fayil na Nginx:

    chown -R www-bayanai: www-data / var / www / html /
    Saukewa -R755

    Kuskure bayan chmod -R 755 (bataccen siga)

  2.   Romualdo m

    Da fatan za a gyara sudo apt-samu haɓakawa && sudo dace-samu haɓaka -y

    de

    sudo apt-samun sabuntawa && sudo apt-samun haɓaka -y