{"id":560,"date":"2017-05-30T13:46:54","date_gmt":"2017-05-30T11:46:54","guid":{"rendered":"http:\/\/itsimple.info\/?p=560"},"modified":"2024-11-28T01:15:05","modified_gmt":"2024-11-27T23:15:05","slug":"how-to-install-wordpress-on-centos-7","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=560","title":{"rendered":"How To Install WordPress On CentOS 7"},"content":{"rendered":"<h3><\/h3>\n<h3><\/h3>\n<h3>This guide will help you install WordPress on Linux CantOS, First Lets update your system :<\/h3>\n<pre><code>sudo yum update -y<\/code><\/pre>\n<p>Then install all Prerequisites like LAMP Packages :<\/p>\n<pre><code>sudo yum install httpd mariadb mariadb-server php php-common <\/code><code>php-mysqlnd <\/code><code>php-gd php-xml php-mbstring php-mcrypt php-xmlrpc unzip wget -y<\/code><\/pre>\n<p>Once the packages finished installation, Make them enabled and start on boot :<\/p>\n<pre><code>sudo systemctl start httpd\nsudo systemctl start mariadb\nsudo systemctl enable httpd\nsudo systemctl enable mariadb<\/code><\/pre>\n<p>Then we will need to configure the database :<\/p>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<p>You can answare the wizrad as shown below<\/p>\n<pre><code>Set root password? [Y\/n] n\nRemove anonymous users? [Y\/n] y\nDisallow root login remotely? [Y\/n] y\nRemove test database and access to it? [Y\/n] y\nReload privilege tables now? [Y\/n] y\n\n<\/code><\/pre>\n<p>Then we will need to configure the MariaDB, the user@localhost and the password will be used for the connection to the database on the WordPress configuration file (you can change this):<\/p>\n<pre><code>mysql -u root -p<\/code><\/pre>\n<pre><code>MariaDB [(none)]&gt;CREATE DATABASE wordpress;\nMariaDB [(none)]&gt;GRANT ALL PRIVILEGES on wordpress.* to 'user'@'localhost' identified by 'password';\nMariaDB [(none)]&gt;FLUSH PRIVILEGES;\nMariaDB [(none)]&gt;exit<\/code><\/pre>\n<p>Now we are ready to install WordPress itself, lets get the latest version for WordPress :<\/p>\n<pre><code>wget http:\/\/wordpress.org\/latest.tar.gz<\/code><\/pre>\n<p>You will need to extract it to the current directory :<\/p>\n<pre>tar -xzvf latest.tar.gz<\/pre>\n<p>The copy it to Apache root directory, in our case\u00a0 :<\/p>\n<pre><code>sudo cp -avr wordpress\/* \/var\/www\/html\/<\/code><\/pre>\n<p>You also want to prepare directory to upload files to the system :<\/p>\n<pre><code>sudo mkdir \/var\/www\/html\/wp-content\/uploads<\/code><\/pre>\n<p>now we need to give permission and owner to the WordPress folders:<\/p>\n<pre>sudo chown -R apache:apache \/var\/www\/html\/\nsudo chmod -R 755 \/var\/www\/html\/<\/pre>\n<p>If you are using SElinux you also need to allow access :<\/p>\n<pre> chcon -R --reference=\/var\/www \/var\/www\/html\/<\/pre>\n<p>Now we need to configure the WordPress to be able to use the Database,we will use the sample file as template to start with :<\/p>\n<pre><code>cd \/var\/www\/html\/\nsudo mv wp-config-sample.php wp-config.php\nsudo nano wp-config.php<\/code><\/pre>\n<p>Change the value according to the date you enter before, and save the file :<\/p>\n<pre><code>define('DB_NAME', 'wordpress');\ndefine('DB_USER', 'user');\ndefine('DB_PASSWORD', 'password');<\/code><\/pre>\n<p>Now You will need to allow access through the firewall :<\/p>\n<pre><code>sudo firewall-cmd --permanent --zone=public --add-service=http\nsudo firewall-cmd --permanent --zone=public --add-service=https\nsudo firewall-cmd --reload<\/code><\/pre>\n<p>That&#8217;s It !!!\u00a0 now open browser and start the wordpress configuration at :<\/p>\n<pre>http:\/\/your-server-IP<\/pre>\n<p>From here you will need to follow the wizard through to the end<\/p>\n<hr \/>\n<h4>Good Luck<\/h4>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide will help you install WordPress on Linux CantOS, First Lets update your system : sudo yum update -y Then install all Prerequisites like LAMP Packages : sudo yum install httpd mariadb mariadb-server php php-common php-mysqlnd php-gd php-xml php-mbstring php-mcrypt php-xmlrpc unzip wget -y Once the packages finished installation, Make them enabled and start [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,13,12],"tags":[],"class_list":["post-560","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-tutorials"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=560"}],"version-history":[{"count":2,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/560\/revisions"}],"predecessor-version":[{"id":2879,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/560\/revisions\/2879"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}