{"id":187,"date":"2019-04-19T15:28:03","date_gmt":"2019-04-19T15:28:03","guid":{"rendered":"https:\/\/mumbaiwebhosting.co.in\/portal\/?p=187"},"modified":"2022-02-25T02:47:21","modified_gmt":"2022-02-25T02:47:21","slug":"install-apache-web-server-and-mysql-on-centos-7","status":"publish","type":"post","link":"https:\/\/mumbaiwebhosting.co.in\/portal\/install-apache-web-server-and-mysql-on-centos-7\/","title":{"rendered":"Install Apache web server and Mysql on CentOS 7"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p class=\"\">Hi folks today we are going to learn about Install Apache web server and Mysql on CentOS 7 .<\/p>\n<h2>Install Apache web server and Mysql on CentOS 7<\/h2>\n<h3>Install Apache webserver:<\/h3>\n<p><b>Step 1<\/b>\u00a0\u2212 Install httpd via yum.<\/p>\n<pre class=\"lang:default decode:true \">yum -y install httpd<\/pre>\n<p><b>Step 2<\/b>\u00a0\u2212 Edit httpd.conf file as per our needs, the\u00a0<i>httpd.conf<\/i>\u00a0and is located in\u00a0<i>\/etc\/httpd\/<\/i><\/p>\n<pre class=\"lang:default decode:true \"># Listen: Allows you to bind Apache to specific IP addresses and\/or\r\n# ports, instead of the default. See also the &lt;VirtualHost&gt;\r\n# directive.\r\n#\r\n# Change this to Listen on specific IP addresses as shown below to\r\n# prevent Apache from glomming onto all bound IP addresses.\r\n#\r\n#Listen 12.34.56.78:80\r\nListen 80<\/pre>\n<p>change Apache to listen on a certain port or IP Address.<\/p>\n<p>The &#8220;document root&#8221; is the default directory where Apache will look for an index file to serve for requests upon visiting your sever:\u00a0http:\/\/www.example.com\/\u00a0will retrieve and serve the index file from your document root.<\/p>\n<pre class=\"lang:default decode:true \">#\r\n# DocumentRoot: The directory out of which you will serve your\r\n# documents. By default, all requests are taken from this directory, but\r\n# symbolic links and aliases may be used to point to other locations.\r\n#\r\nDocumentRoot \"\/var\/www\/html\"<\/pre>\n<p><b>Step 3<\/b>\u00a0\u2212 Start and Enable the httpd Service.<\/p>\n<pre class=\"lang:default decode:true \">[root@mail]# systemctl start httpd &amp;&amp; systemctl reload httpd \r\n[root@mail]#<\/pre>\n<p><b>Step 4<\/b>\u00a0\u2212 Configure firewall to allow access to port 80 requests.<\/p>\n<pre class=\"lang:default decode:true \">[root@mail]# firewall-cmd --add-service=http --permanent<\/pre>\n<h3><strong>\u00a0Installing Mysql :<\/strong><\/h3>\n<p><b>Step 1<\/b>\u00a0\u2212 Download the Repository.<\/p>\n<p>Download and install the MySQL repository from\u00a0http:\/\/repo.mysql.com\/mysql-community-release-el7-5.noarch.rpm<\/p>\n<p>The repository comes conveniently packaged in an rpm package for easy installation. It can be downloaded with<\/p>\n<p>wget\u00a0 command .<\/p>\n<pre class=\"lang:default decode:true\">[root@mail]# wget http:\/\/repo.mysql.com\/mysql-community-release-el75.noarch.rpm\r\n   --2017-02-26 03:18:36--  http:\/\/repo.mysql.com\/mysql-community-release-el75.noarch.rpm\r\n   Resolving repo.mysql.com (repo.mysql.com)... 104.86.98.130<\/pre>\n<p><b>Step 2<\/b>\u00a0\u2212 Install MySQL From yum.<\/p>\n<p>We can now use the\u00a0<i>yum<\/i>\u00a0package manager to install MySQL<\/p>\n<pre class=\"lang:default decode:true \">[root@mail]# yum -y install mysql-server<\/pre>\n<p><b>Step 3<\/b>\u00a0\u2212 Start and Enable the MySQL\u00a0 Service.<\/p>\n<pre class=\"lang:default decode:true \">[root@mail]# systemctl start mysql \r\n[root@mail]# systemctl enable  mysql<\/pre>\n<p>Hope Now you understand how to install Apache webserver and Mysql in CentOS 7.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Hi folks today we are going to learn about Install Apache web server and Mysql on CentOS 7 . Install Apache web server and Mysql on CentOS 7 Install&#8230; <a class=\"read-more-link\" href=\"https:\/\/mumbaiwebhosting.co.in\/portal\/install-apache-web-server-and-mysql-on-centos-7\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/posts\/187"}],"collection":[{"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/comments?post=187"}],"version-history":[{"count":1,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/posts\/187\/revisions"}],"predecessor-version":[{"id":188,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/posts\/187\/revisions\/188"}],"wp:attachment":[{"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/media?parent=187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/categories?post=187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/tags?post=187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}