{"id":951,"date":"2011-04-24T15:21:44","date_gmt":"2011-04-24T07:21:44","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=951"},"modified":"2023-06-26T22:06:57","modified_gmt":"2023-06-26T22:06:57","slug":"how-to-install-wordpress-blog-on-centos-5-5","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-wordpress-blog-on-centos-5-5\/","title":{"rendered":"How to Install WordPress Blog on CentOS 5.5"},"content":{"rendered":"<p>WordPress, a renowned Content Management System (CMS), is a robust open-source blogging tool and publishing platform powered by PHP and MySQL. It can be installed on both Windows and Linux servers, offering a plethora of features, including plugins that modernize and empower your blog.<\/p>\n<p>This guide will walk you through the process of installing WordPress on a CentOS server, assuming you have already set up a LAMP (Linux, Apache, MySQL, and PHP) server. For more information on different server types, you can explore our articles on <a href=\"https:\/\/webhostinggeeks.com\/blog\/apache-http-server-explained\/\">Apache<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/nginx-server-explained\/\">Nginx<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/litespeed-web-server-explained\/\">LiteSpeed<\/a>.<\/p>\n<h2>Step 1: Access Your Web Server Root Directory<\/h2>\n<p>Start by navigating to your web server root directory. You can do this by entering the following command:<\/p>\n<pre>\r\ncd \/var\/www\r\n<\/pre>\n<h2>Step 2: Download the Latest WordPress<\/h2>\n<p>Next, download the latest version of WordPress using the wget command:<\/p>\n<pre>\r\nwget http:\/\/wordpress.org\/latest.tar.gz\r\n<\/pre>\n<h2>Step 3: Extract the Compressed Archives<\/h2>\n<p>After downloading WordPress, you need to extract the compressed archives with the following command:<\/p>\n<pre>\r\ntar xzvf latest.tar.gz\r\n<\/pre>\n<h2>Step 4: Rename the Extracted File<\/h2>\n<p>The extracted file will be named &#8216;wordpress&#8217;. You can rename it to anything you want. For the purpose of this tutorial, we will rename it to &#8216;blog&#8217;:<\/p>\n<pre>\r\ncp wordpress blog\r\n<\/pre>\n<p>Your URL will now look like this: http:\/\/servername\/blog<\/p>\n<h2>Step 5: Create the Database and Database User<\/h2>\n<p>Next, create the database and database user. You can do this by entering the following commands:<\/p>\n<pre>\r\nCREATE DATABASE blogdb;\r\nCREATE USER 'bloguser'@'localhost' IDENTIFIED BY 'blogpassword';\r\nGRANT ALL PRIVILEGES ON blogdb.* to bloguser@localhost;\r\n<\/pre>\n<h2>Step 6: Navigate to Your Blog URL<\/h2>\n<p>Now, navigate your browser to http:\/\/servername\/blog. You will be prompted to create a wp-config.php file. Click on &#8220;Create a Configuration File&#8221;.<\/p>\n<h2>Step 7: Setup Configuration File<\/h2>\n<p>You will be redirected to the WordPress Setup Configuration File page. Here, you will need to provide some information on the database. Fill in the details as per the database and user you created in Step 5. If your Apache and MySQL are on the same server, your Database host will be &#8216;localhost&#8217;.<\/p>\n<p>Click on &#8220;Let&#8217;s Go!&#8221; to proceed.<\/p>\n<h2>Step 8: Fill in the Form and Submit<\/h2>\n<p>Fill in the form with the following details and click Submit:<\/p>\n<pre>\r\nDatabase name = blogdb\r\nDatabase username = bloguser\r\nDatabase password = blogpassword\r\nDatabase host = localhost\r\nTable prefix = wp_\r\n<\/pre>\n<p>You will be redirected to a page where you will be asked to manually create the wp-config.php file.<\/p>\n<h2>Step 9: Create the wp-config.php File<\/h2>\n<p>To create the wp-config.php file, go back to your web server terminal or SSH to your web server. Copy and rename wp-config-sample.php to wp-config.php using the following command:<\/p>\n<pre>\r\ncp \/var\/www\/blog\/wp-config-sample.php \/var\/www\/blog\/wp-config.php\r\n<\/pre>\n<h2>Step 10: Modify the wp-config.php File<\/h2>\n<p>Next, you need to modify the wp-config.php file. Open the file using the vi editor:<\/p>\n<pre>\r\nvi \/var\/www\/blog\/wp-config.php\r\n<\/pre>\n<p>Change the following lines to match the database details you set up earlier:<\/p>\n<pre>\r\n\/** The name of the database for WordPress = Line 19 *\/\r\ndefine('DB_NAME', 'blogdb');\r\n\r\n\/** MySQL database username = Line 22 *\/\r\ndefine('DB_USER', 'bloguser');\r\n\r\n\/** MySQL database password = Line 25 *\/\r\ndefine('DB_PASSWORD', 'blogpassword');\r\n\r\n\/** MySQL hostname = Line 28 *\/\r\ndefine('DB_HOST', 'localhost');\r\n<\/pre>\n<p>Save the wp-config.php file and exit from the web server.<\/p>\n<h2>Step 11: Run the Install<\/h2>\n<p>Now, continue to the following URL:<\/p>\n<pre>\r\nhttp:\/\/servername\/blog\/wp-admin\/setup-config.php?step=2\r\n<\/pre>\n<p>Click on &#8220;Run the install&#8221;.<\/p>\n<h2>Step 12: Complete the Form and Install WordPress<\/h2>\n<p>Finally, complete the form with your preferred site title, username, password, and email, and click on &#8220;Install WordPress&#8221;. To log in to your new WordPress site, navigate your browser to http:\/\/servername\/blog\/wp-login.php.<\/p>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">cd \/var\/www<\/span> \u2013 Navigates to the web server root directory<\/li>\n<li><span class=\"fw-bold\">wget http:\/\/wordpress.org\/latest.tar.gz<\/span> \u2013 Downloads the latest version of WordPress<\/li>\n<li><span class=\"fw-bold\">tar xzvf latest.tar.gz<\/span> \u2013 Extracts the downloaded WordPress file<\/li>\n<li><span class=\"fw-bold\">cp wordpress blog<\/span> \u2013 Renames the extracted WordPress file<\/li>\n<li><span class=\"fw-bold\">CREATE DATABASE blogdb;<\/span> \u2013 Creates a new database<\/li>\n<li><span class=\"fw-bold\">CREATE USER &#8216;bloguser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;blogpassword&#8217;;<\/span> \u2013 Creates a new database user<\/li>\n<li><span class=\"fw-bold\">GRANT ALL PRIVILEGES ON blogdb.* to bloguser@localhost;<\/span> \u2013 Grants all privileges to the new user on the new database<\/li>\n<li><span class=\"fw-bold\">cp \/var\/www\/blog\/wp-config-sample.php \/var\/www\/blog\/wp-config.php<\/span> \u2013 Creates a new wp-config.php file<\/li>\n<li><span class=\"fw-bold\">vi \/var\/www\/blog\/wp-config.php<\/span> \u2013 Opens the wp-config.php file for editing<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Installing WordPress on a CentOS server involves a series of steps, including accessing your web server root directory, downloading and extracting WordPress, creating a database and user, and configuring WordPress to connect to your database. <\/p>\n<p>While the process may seem complex, following this step-by-step guide will help you successfully install WordPress and start building your website.<\/p>\n<p>Whether you&#8217;re using a <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated server<\/a>, a <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-cloud-hosting\/\">cloud hosting<\/a>, or <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-shared-hosting\/\">shared hosting<\/a>, WordPress is a versatile platform that can meet your website needs.<\/p>\n<h2>FAQs<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is WordPress?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">WordPress is a popular open-source Content Management System (CMS) usedfor creating websites and blogs. It&#8217;s powered by PHP and MySQL and can be installed on both Windows and Linux servers.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is a LAMP server?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">A LAMP server is a type of web server that uses Linux as its operating system, Apache as its web server, MySQL as its database management system, and PHP as its scripting language. It&#8217;s a popular choice for hosting websites and web applications.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the purpose of the wp-config.php file in WordPress?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The wp-config.php file is one of the most important files in a WordPress installation. It contains the configuration details for the WordPress site, including database connection information, table prefix, secret keys, WordPress language, and ABSPATH.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I log in to my WordPress site after installation?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">After installing WordPress, you can log in to your site by navigating to the wp-login.php file in your browser. The URL will look something like this: http:\/\/yourwebsite.com\/wp-login.php. Enter the username and password you set during installation to log in.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the wget command used for in this tutorial?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The wget command is a free utility for non-interactive download of files from the web. In this tutorial, it&#8217;s used to download the latest version of WordPress from the official WordPress site.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>WordPress, a renowned Content Management System (CMS), is a robust open-source blogging tool and publishing platform powered by PHP and MySQL. It can be installed on both Windows and Linux&#8230;<\/p>\n","protected":false},"author":6,"featured_media":390,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2056],"tags":[1246,1536,1933],"class_list":["post-951","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cms","tag-centos-5-5","tag-linux","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=951"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/951\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/390"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}