
Kita dapat menginstall wordpress di server localhost, disini saya menggunakan ubuntu 18.04 untuk mencoba memberikan tutorial dari awal paket-paket apa saja yang harus ada untuk menginstall wordpress di server.
dalam artikel ini kita membutuhkan 3 paket yang harus terinstall di server :
- Web Server (Apache/Nginx)
- Database seperti Mysql
- Php 7.3 / terbaru
- Download WordPress
Install Paket
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//Webserver apt get install apache2 service apache2 status //database server sudo apt install mysql-server //install php apt install php libapache2-mod-php php-mysql apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip //wordpress (terdapat 2 opsi) curl -O https://wordpress.org/latest.tar.gz wget https://wordpress.org/latest.tar.gz |
Setting Database
|
1 2 3 4 5 6 7 8 9 |
//login database sudo mysql_secure_installation mysql -u root -p //create database CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; GRANT ALL ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'Putra321'; FLUSH PRIVILEGES; exit |
Lanjut setting file-file yang dibutuhkan seperti mengganti file html dengan php
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
nano /etc/apache2/mods-enabled/dir.conf //Tukar index.html ke index.php <ifModule mod_dir.c> DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm </IfModule> //Buat file conf untuk wordpress nano /etc/apache2/sites-available/wordpress.conf //isikan seperti ini <Directory /var/www/wordpress/> AllowOverride All </Directory> a2enmod rewrite apache2ctl configtest //Output AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message Syntax OK systemctl restart apache2 |
lanjut setting apache dan wordpressnya
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
//unzip file wordpress tar xzvf latest.tar.gz //copy wp-config cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php //buat file baru di directory apache mkdir /tmp/wordpress/wp-content/upgrade //copy file wordpress sudo cp -a /tmp/wordpress/. /var/www/putra //sesuaikan dengan direktori var/www/ |
Berikan akses terhadap direktory wordpress dan install api curl wordpress
|
1 2 3 |
sudo chown -R www-data:www-data /var/www/putra sudo find /var/www/putra/ -type d -exec chmod 750 {} \; sudo find /var/www/putra/ -type f -exec chmod 640 {} \; |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
curl -s https://api.wordpress.org/secret-key/1.1/salt/ define('AUTH_KEY', '1jl/vqfs<XhdXoAPz9 DO NOT COPY THESE VALUES c_j{iwqD^<+c9.k<J@4H'); define('SECURE_AUTH_KEY', 'E2N-h2]Dcvp+aS/p7X DO NOT COPY THESE VALUES {Ka(f;rv?Pxf})CgLi-3'); define('LOGGED_IN_KEY', 'W(50,{W^,OPB%PB<JF DO NOT COPY THESE VALUES 2;y&,2m%3]R6DUth[;88'); define('NONCE_KEY', 'll,4UC)7ua+8<!4VM+ DO NOT COPY THESE VALUES #<code>DXF+[$atzM7 o^-C7g'); define('AUTH_SALT', 'koMrurzOA+|L_lG}kf DO NOT COPY THESE VALUES 07VC*Lj*lD&?3w!BT#-'); define('SECURE_AUTH_SALT', 'p32*p,]z%LZ+pAu:VY DO NOT COPY THESE VALUES C-?y+K0DK_+F|0h{!_xY'); define('LOGGED_IN_SALT', 'i^/G2W7!-1H2OQ+t$3 DO NOT COPY THESE VALUES t6**bRVFSD[Hi])-qS</code>|'); define('NONCE_SALT', 'Q6]U:K?j4L%Z]}h^q7 DO NOT COPY THESE VALUES 1% ^qUswWgn+6&xqHN&%'); //Setting wp-config sudo nano /var/www/putra/wp-config.php define('DB_NAME', 'wordpress'); /** MySQL database username */ define('DB_USER', 'wordpressuser'); /** MySQL database password */ define('DB_PASSWORD', 'Putra123'); . . . define('FS_METHOD', 'direct'); apache2ctl configtest panggil ipaddress di browser jika tampilan sudah seperti di atas, berhasil membuat wordpress.. |