Namin Convention
Databasenames
All small, no dots, no space
<subdomain><domain>
Correct: stagingserbisyo, serbisyo
Wrong: Stagingnewserbisyo, serbisyo2
Root folder names
The same with the URL
Correct: staging.serbisyo.com, serbisyo.com
Wrong: staging-serbisyo
Create Database
mysql -u root -p
CREATE DATABASE serbisyo;
CREATE USER 'serbisyoadmin'@'localhost' IDENTIFIED BY 'serbisyo@dm1n';
Note: maintain single admin account for all database
GRANT ALL ON serbisyo.* TO 'serbisyoadmin'@'localhost' IDENTIFIED BY 'serbisyo@dm1n' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
Wordpress installation
cd /tmp && wget https://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
mv wordpress /var/www/serbisyo.com
chown -R www-data:www-data /var/www/serbisyo.com
chmod -R 755 /var/www/serbisyo.com
Setup Virtual Host
cd /etc/apache2/sites-available/
https://my.pcloud.com/publink/show?code=kZv5Fa7ZoL6lqRnNwiH4nWlA6Q4CdSDCuORk and copy serbisyo.com.conf
NOTE: Namin Convention is <domain name.ext>.conf
a2ensite serbisyo.com.conf
a2ensite serbisyo.com-le-ssl.conf
service apache2 reload
a2enmod rewrite
systemctl restart apache2
Configure Word Press
cd /var/www/serbisyo.com/
Go to https://my.pcloud.com/publink/show?code=kZv5Fa7ZoL6lqRnNwiH4nWlA6Q4CdSDCuORk
and replace wp-config.php
Location: /var/www/<project name>
NOTE: There is a predefined wp-config.php for serbisyo.com. Just need to copy it.define( 'DB_NAME', 'serbisyo' );/** MySQL database username */define( 'DB_USER', 'serbisyoadmin' );/** MySQL database password */define( 'DB_PASSWORD', 'serbisyo@dm1n' );$table_prefix = 'serbisyo_';SSL Certificate Setup
NOTE: Disable cloudflare (click the orage cloud ICON)
certbot --apache -d serbisyo.com
NOTE: email = serbisyo.com@gmail.com
ls /etc/letsencrypt/live
Verify Certificate
https://www.ssllabs.com/ssltest/analyze.html?d=serbisyo.com&latest
Note:
Ensure WP Settings/Site Address (URL) is https
The http to https redirection should be from the cloudflare site. Not from the serbisyo.com.conf. Thus select 1 option in certbot --apache -d serbisyo.com command
Install Wordpress
Go to https://www.serbisyo.com/wp-admin/install.php