WordPress on RockyLinux CentOS

To start the most popular blog platform we need L[CentOS] A[pache] M[ariaDB] and P[HP].

Requirements are mentioned above, but we have to install these modules of php:

dnf install php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt php-xmlrpc -y

1. Create the database:

mysql -u root -p
CREATE DATABASE intranet CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'intranet' IDENTIFIED BY 'password';
GRANT USAGE ON *.* TO intranet@'localhost' IDENTIFIED BY 'password';
GRANT ALL privileges ON intranet.* TO intranet@localhost;
FLUSH PRIVILEGES;

2. download the latest version and extract it

wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz

3. move the files to destination location

mv wordpress/* /var/www/html/intranet

4. create the dir for uploads

mkdir /var/www/html/intranet/wp-content/uploads

5. add permissions

chown -R apache:apache /var/www/html/intranet
chmod -R 755 /var/www/html/intranet
chmod -R 755 /var/www/html/intranet/wp-content/uploads

6. set SELinux context

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/intranet(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/intranet/wp-content/uploads(/.*)?'/

6. Enter:

http://hostname/intranet

 

Leave a Reply

Your email address will not be published. Required fields are marked *