Giunsa ang Pag-install sa WordPress nga adunay FAMP Stack sa FreeBSD


Sa kini nga panudlo mahibal-an namon kung giunsa ang pag-install sa WordPress sa FAMP stack sa FreeBSD. Ang FAMP stack usa ka acronym nga nagpasabot sa FreeBSD Unix operating system, Apache HTTP server (usa ka sikat nga popular nga open-source web server), MariaDB relational database management system (MySQL database fork nga karon gimentinar sa komunidad), ug PHP dynamic programming language nga nagdagan sa kilid sa server.

Ang WordPress mao ang labing inila nga CMS framework sa kalibutan nga gigamit alang sa paghimo og yano nga mga blog o propesyonal nga mga website.

  1. Giya sa Pag-instalar sa FreeBSD

Lakang 1: I-install ang FAMP Stack sa FreeBSD

1. Aron ma-deploy ang usa ka website sa WordPress sa imong lugar, kinahanglan nimo nga sigurohon nga ang mga mosunod nga sangkap sa FAMP na-install ug naglihok sa FreeBSD.

Ang una nga serbisyo nga kinahanglan nimo i-install sa FreeBSD mao ang Apache HTTP server. Aron ma-install ang Apache 2.4 HTTP server binary package pinaagi sa opisyal nga FreeBSD ports repository, i-isyu ang mosunod nga command sa imong server console.

# pkg install apache24

2. Sunod, pagana ug pagsugod sa Apache HTTP daemon sa FreeBSD pinaagi sa pagpatuman sa mosunod nga mga sugo.

# sysrc apache24_enable="yes"
# service apache24 start

3. Ablihi ang usa ka browser ug navigate sa IP address sa imong server o FQDN pinaagi sa HTTP protocol aron makita ang default nga web page sa Apache. ‘It works!’ nga mensahe kinahanglang ipakita sa imong browser.

http://yourdomain.tld

4. Sunod, i-install ang PHP 7.1 nga bersyon sa imong server nga adunay sa ubos nga gikinahanglan nga extension pinaagi sa pag-isyu sa ubos nga sugo. Ang among website sa WordPress i-deploy sa ibabaw niini nga bersyon sa PHP.

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

5. Sa sunod nga lakang, paghimo sa php.conf configuration file para sa Apache web server nga adunay mosunod nga sulod.

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

Idugang ang mosunod nga configuration sa php.conf file.

<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. I-save ug isira kini nga file ug i-restart ang Apache daemon aron magamit ang mga pagbag-o pinaagi sa pag-isyu sa ubos nga mando.

# service apache24 restart

7. Ang katapusang component nga nawala mao ang MariaDB database. Aron i-install ang pinakabag-o nga bersyon sa MariaDB database server sa FreeBSD ipatuman pinaagi sa mosunod nga sugo.

# pkg install mariadb102-client mariadb102-server

8. Sunod, himoa ang pagpagana sa serbisyo sa MariaDB sa FreeBSD ug pagsugod sa database daemon pinaagi sa pagpadagan sa ubos nga mga sugo.

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

9. Sa sunod nga lakang, i-execute ang mysql_secure_installation script aron ma-secure ang MariaDB. Gamita ang ubos nga script output sample aron ma-secure ang MariaDB database.

# /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. Sa kataposan, paghimo ug WordPress installation database sa MariaDB server. Aron mahimo ang database, pag-log in sa MariaDB console ug i-isyu ang mosunod nga mga sugo.

Pagpili og usa ka deskriptibo nga ngalan alang niini nga database, paghimo og database user ug password sa pagdumala niini nga database.

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

Lakang 2: I-install ang WordPress sa FreeBSD

11. Aron ma-install ang pinakabag-o nga bersyon sa WordPress sa FreeBSD, adto sa WordPress download page ug kuhaa ang pinakabag-o nga available nga traball version sa tabang sa wget utility.

Kuhaa ang tarball ug kopyaha ang tanan nga mga file sa pag-install sa WordPress ngadto sa gamut sa dokumento sa Apache pinaagi sa pag-isyu sa mosunod nga mga sugo.

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

12. Sunod, hatagi ang Apache www group write permissions sa WordPress installation directory pinaagi sa pag-isyu sa ubos nga mga sugo.

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

13. Karon, pagsugod sa pag-instalar sa WordPress. Ablihi ang usa ka browser ug navigate sa imong server IP address o domain name pinaagi sa HTTP protocol. Sa unang screen, i-hit sa Let's go! buton aron masugdan ang proseso sa pag-install.

14. Sunod, idugang ang MySQL database name, user ug password ug i-hit sa Submit button aron magpadayon, ingon sa gihulagway sa screenshot sa ubos.

15. Sa sunod nga screen, ang WordPress installer magpahibalo kanimo nga kini malampuson nga makakonektar sa MySQL database. I-hit sa Run ang instalar nga buton aron ma-install ang database schema.

16. Sa sunod nga screen, pilia ang titulo sa imong site ug usa ka username nga adunay lig-on nga password sa pagdumala sa WordPress site. Usab, idugang ang imong e-mail address ug i-hit ang I-install ang WordPress button aron mahuman ang proseso sa pag-install.

17. Sa diha nga ang proseso sa pag-instalar makompleto, usa ka mensahe ang magpahibalo kanimo nga ang WordPress CMS malampuson nga na-install. Niini nga panid makit-an usab nimo ang mga kredensyal nga gikinahanglan aron maka-log in sa imong admin panel sa website, ingon sa gihulagway sa imahe sa ubos.

18. Sa katapusan, pag-log in sa WordPress admin dashboard gamit ang mga kredensyal nga gipresentar sa miaging lakang ug mahimo ka na nga magsugod sa pagdugang bag-ong mga post para sa imong website.

19. Aron makabisita sa imong website frontend page, navigate sa imong server IP address o domain name diin imong makita ang default post nga ginganlag \Hello World!, ingon sa gihulagway sa ubos nga hulagway.

http://yourdomain.tld

Mga pahalipay! Malampuson nimong na-install ang WordPress content management system ubos sa FAMP stack sa FreeBSD.