Otu esi etinye WordPress na FAMP Stack na FreeBSD


N'ime nkuzi a anyị ga-amụta ka esi etinye WordPress na FAMP stack na FreeBSD. FAMP stack bụ acronym nke na-anọchi anya FreeBSD Unix sistemụ arụmọrụ, Apache HTTP nkesa (sava weebụ mepere emepe ama ama), MariaDB relational database management system ( MySQL database fork ugbu a nke obodo na-edobe), na PHP ike mmemme asụsụ nke na-agba ọsọ na. akụkụ nkesa.

WordPress bụ usoro CMS kachasị ama n'ụwa nke ejiri wuo blọọgụ dị mfe ma ọ bụ webụsaịtị ọkachamara.

  1. Ntuziaka nwụnye FreeBSD

Kwụpụ 1: Wụnye FAMP Stack na FreeBSD

1. Iji tinye webụsaịtị WordPress na ụlọ gị, ịkwesịrị ijide n'aka na etinyere ihe FAMP ndị a ma rụọ ọrụ na FreeBSD.

Ọrụ mbụ ịchọrọ ịwụnye na FreeBSD bụ sava Apache HTTP. Iji tinye ngwungwu ọnụọgụ abụọ nke sava Apache 2.4 HTTP site na ebe nchekwa ọdụ ụgbọ mmiri FreeBSD, nye iwu a na njikwa ihe nkesa gị.

# pkg install apache24

2. Na-esote, mee ma malite Apache HTTP daemon na FreeBSD site na ime iwu ndị a.

# sysrc apache24_enable="yes"
# service apache24 start

3. Mepee ihe nchọgharị wee gaa na adreesị IP nke ihe nkesa gị ma ọ bụ FQDN site na protocol HTTP ka ịlele ibe weebụ Apache. Ekwesịrị igosi ozi 'Ọ na-arụ ọrụ!' na ihe nchọgharị gị.

http://yourdomain.tld

4. Ọzọ, wụnye PHP 7.1 version na gị na ihe nkesa na n'okpuru chọrọ ndọtị site n'inye n'okpuru iwu. A ga-ebuga webụsaịtị WordPress anyị n'elu ụdị PHP a.

# pkg install php71 php71-mysqli mod_php71 php71-mbstring php71-gd php71-json php71-mcrypt php71-zlib php71-curl

5. Na nzọụkwụ ọzọ, mepụta faịlụ nhazi php.conf maka sava weebụ Apache na ọdịnaya ndị a.

# nano /usr/local/etc/apache24/Includes/php.conf

Tinye nhazi na-eso na faịlụ php.conf.

<IfModule dir_module>
    DirectoryIndex index.php index.html
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
</IfModule>

6. Chekwaa ma mechie faịlụ a ma malitegharịa Apache daemon iji tinye mgbanwe ndị ahụ site n'inye iwu dị n'okpuru.

# service apache24 restart

7. Akụkụ ikpeazụ na-efu bụ MariaDB nchekwa data. Iji wụnye ụdị nkesa nchekwa data MariaDB kachasị ọhụrụ na FreeBSD mebie site na iwu a.

# pkg install mariadb102-client mariadb102-server

8. Ọzọ, mee ka ọrụ MariaDB rụọ ọrụ na FreeBSD wee malite daemon nchekwa data site na ịme iwu ndị dị n'okpuru.

# sysrc mysql_enable="YES"
# service mysql-server start

9. Na nzọụkwụ ọzọ, mebie mysql_secure_installation script iji chekwaa MariaDB. Jiri sample mmepụta edemede dị n'okpuru ebe a iji chekwaa nchekwa data MariaDB.

# /usr/local/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
 
Enter current password for root (enter for none):
OK, successfully used password, moving on...
 
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
 ... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
 ... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

10. N'ikpeazụ, mepụta nchekwa data nwụnye WordPress na sava MariaDB. Iji mepụta nchekwa data, banye na MariaDB console wee nye iwu ndị a.

Họrọ aha nkọwa maka nchekwa data a, mepụta onye ọrụ nchekwa data na paswọọdụ iji jikwaa nchekwa data a.

# mysql -u root -p
MariaDB [(none)]> create database wordpress;
MariaDB [(none)]> grant all privileges on wordpress.* to 'user_wordpress'@'localhost' identified by 'password';
MariaDB [(none)]> flush privileges;

Kwụpụ 2: Wụnye WordPress na FreeBSD

11. Iji wụnye ụdị WordPress kachasị ọhụrụ na FreeBSD, gaa na ibe nbudata WordPress wee jide ụdị traball kachasị ọhụrụ site na enyemaka nke wget utility.

Wepụ tarball wee detuo faịlụ nrụnye WordPress niile na mgbọrọgwụ akwụkwọ Apache site n'inye iwu ndị a.

# wget https://wordpress.org/latest.tar.gz
# tar xfz latest.tar.gz
# cp -rf wordpress/* /usr/local/www/apache24/data/

12. Ọzọ, nye Apache www otu ide ikike na WordPress nwụnye ndekọ site n'inye iwu n'okpuru.

# chown -R root:www /usr/local/www/apache24/data/
# chmod -R 775 /usr/local/www/apache24/data/

13. Ugbu a, malite ịwụnye WordPress. Mepee ihe nchọgharị wee gaa na adreesị IP ma ọ bụ aha ngalaba ihe nkesa gị site na protocol HTTP. Na ihuenyo mbụ, pịa Ka anyị gaa! bọtịnụ ịmalite usoro nrụnye.

14. Ọzọ, tinye MySQL aha nchekwa data, onye ọrụ na paswọọdụ wee kụọ na Nyefee bọtịnụ ka ọ gaa n'ihu, dị ka e gosiri na nseta ihuenyo dị n'okpuru.

15. Na ihuenyo ọzọ, WordPress installer ga-agwa gị na ọ nwere ike jikọọ na MySQL nchekwa data nke ọma. Pịa na Gbaa bọtịnụ wụnye ka ịwụnye atụmatụ nchekwa data.

16. Na ihuenyo ọzọ, họrọ aha saịtị gị na aha njirimara nwere paswọọdụ siri ike iji jikwaa saịtị WordPress. Ọzọkwa, tinye adreesị ozi-e gị wee kụọ bọtịnụ Wụnye WordPress ka ịmechaa usoro nrụnye.

17. Mgbe usoro nrụnye gachara, ozi ga-agwa gị na etinyere WordPress CMS nke ọma. Na ibe a, ị ga-ahụkwa nzere achọrọ iji banye na ngalaba nchịkwa weebụsaịtị gị, dị ka e gosiri na foto dị n'okpuru.

18. N'ikpeazụ, abanye na WordPress admin dashboard site na iji nzere ewepụtara na nzọụkwụ gara aga ma ị nwere ike ịmalite tinye ọhụrụ posts maka ebe nrụọrụ weebụ gị.

19. Iji gaa na ebe nrụọrụ weebụ gị n'ihu, gaa na adreesị IP nke ihe nkesa gị ma ọ bụ aha ngalaba ebe ị ga-ahụ ọkwa nke ndabara aha ya bụ Hello World!, dị ka e gosiri na foto dị n'okpuru.

http://yourdomain.tld

Ekele! Ị tinyela usoro njikwa ọdịnaya WordPress nke ọma n'okpuru nchịkọta FAMP na FreeBSD.