I have resolved this issue by changing my owner from root
to apache
as below.
chown -R apache:apache /var/www/html/mydomain
chown -R apache:apache /var/www/html/mydomain
And then I have change the permission of the wp-content/uploads/
to 775
.
After that, I have tried to upload an image in the media. I was successful to upload the image.