{"id":3135,"date":"2015-11-13T11:22:24","date_gmt":"2015-11-13T11:22:24","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=3135"},"modified":"2021-02-08T05:01:50","modified_gmt":"2021-02-08T05:01:50","slug":"how-to-build-working-ubuntu-server","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/","title":{"rendered":"HOW TO BUILD WORKING UBUNTU SERVER"},"content":{"rendered":"<p><span style=\"color: #000000;\">In this tutorial we will install and setup Apache web server and PHP. There are many newbies out there who are really new to Linux, VPS or Server, so here i am posting easier way to setup a working live server to host websites in it.<\/span><!--more--><\/p>\n<p><span style=\"color: #000000;\">Login to your server and\u00a0make sure you do some<\/span> <a href=\"https:\/\/cpanelplesk.com\/wp62\/basic-ubuntu-setup-before-building-a-working-server\/\">basic optimization tasks<\/a><span style=\"color: #000000;\"> for a newly created Ubuntu server.<\/span><\/p>\n<h2>INSTALL APACHE WEB SERVER<\/h2>\n<p><span style=\"color: #000000;\">Apache is truly a default web server which is license free and opensource. It has been utilized by numerous servers around the globe. There are couple of other web server like Litespeed and Nginx yet Apache is as yet ruling on the grounds because its effectiveness.<\/span><\/p>\n<p><span style=\"color: #000000;\">Use following command:<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">sudo apt-get -y update\r\nsudo apt-get -y upgrade<\/pre>\n<\/div>\n<p><span style=\"color: #000000;\">Wait for the process to complete then type the following command:<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">sudo apt-get -y install apache2-prefork-dev apache2-utils apache2.2-bin apache2.2-common apache2\r\n<\/pre>\n<\/div>\n<h2>INSTALL PHP5<\/h2>\n<p><span style=\"color: #000000;\">Use following command to install PHP5 on your Ubuntu server:<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">sudo apt-get -y install php5 php5-cgi php5-cli php5-common php5-curl php5-dev php5-gd php5-tidy php5-xmlrpc php5-xsl php5-suhosin php5-mcrypt php5-imap php5-imagick libapache2-mod-php5\r\n<\/pre>\n<\/div>\n<h2>ADD PHP TO DIRECTORY INDEX (OPTIONAL)<\/h2>\n<p><span style=\"color: #000000;\">Normally Apache will start looking at index.html document before index.php. You can change that order by altering &#8220;dir.conf&#8221; record. Use\u00a0the following command:<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">sudo nano \/etc\/apache2\/mods-enabled\/dir.conf<\/pre>\n<\/div>\n<p><span style=\"color: #000000;\">Now move \u201cindex.php\u201d into the beginning part so it will look like this:<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">&lt;ifmodule mod_dir.c=\"\"&gt;\r\n          DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm\r\n&lt;\/ifmodule&gt;\r\n<\/pre>\n<\/div>\n<p><span style=\"color: #000000;\">Once done, save and exit the editor.<\/span><\/p>\n<p><span style=\"color: #000000;\">You can test your PHP by simply creating a<\/span> <a href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-view-php-settings-using-a-phpinfo-page\/\">phpinfo.php<\/a> <span style=\"color: #000000;\">file under <strong>\/var\/www<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Don&#8217;t forget to restart your Apache2 service<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">service apache2 restart<\/pre>\n<\/div>\n<p><span style=\"color: #000000;\">Then try accessing that phpinfo.php file into your favorite browser by typing your IP in address bar:<\/span><\/p>\n<p><span style=\"color: #000000;\">http:\/\/68.46.2.127\/phpinfo.php<\/span><\/p>\n<h2 class=\"heading1\">Setup CSF Firewall<\/h2>\n<p><span style=\"color: #000000;\">You can use CSF for managing your firewall. Follow the below steps to install it.<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">cd \/opt\r\nwget http:\/\/www.configserver.com\/free\/csf.tgz\r\ntar xzf csf.tgz<\/pre>\n<\/div>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">cd \/opt\r\nwget http:\/\/www.configserver.com\/free\/csf.tgz\r\ntar xzf csf.tgz<\/pre>\n<\/div>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">cd \/opt\/csf\r\nsh install.sh<\/pre>\n<\/div>\n<p><span style=\"color: #000000;\">Now enable<a href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-csf-firewall-on-cpanel-server\/\"> CSF <\/a>to work as production. By default, it installed in test mode.<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">nano \/etc\/csf\/csf.conf\r\n\r\nTESTING=0<\/pre>\n<\/div>\n<p><span style=\"color: #000000;\">Finally restart CSF service using following command.<\/span><\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">cd \/etc\/csf\r\ncsf -r<\/pre>\n<\/div>\n<p>That is it. Presently you have a working server to host your PHP-based\u00a0scripts and run it on your browser.<\/p>\n<p><span style=\"color: #000000;\">In the next post,I\u2019ll write about <span id=\"IL_AD1\" class=\"IL_AD\">how to install<\/span> MySQL server .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we will install and setup Apache web server and PHP. There are many newbies out there who are really new to Linux, VPS or Server, so here i am posting easier way to setup a working live server to host websites in it. [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,14],"tags":[],"class_list":["post-3135","post","type-post","status-publish","format-standard","hentry","category-cpanel","category-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HOW TO BUILD WORKING UBUNTU SERVER - cPanel Plesk<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"HOW TO BUILD WORKING UBUNTU SERVER - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"In this tutorial we will install and setup Apache web server and PHP. There are many newbies out there who are really new to Linux, VPS or Server, so here i am posting easier way to setup a working live server to host websites in it. [...]Continue Reading...\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Seemab Saleem\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/\"},\"author\":{\"name\":\"Seemab Saleem\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\"},\"headline\":\"HOW TO BUILD WORKING UBUNTU SERVER\",\"datePublished\":\"2015-11-13T11:22:24+00:00\",\"dateModified\":\"2021-02-08T05:01:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/\"},\"wordCount\":316,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"articleSection\":[\"Cpanel\",\"Linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/\",\"name\":\"HOW TO BUILD WORKING UBUNTU SERVER - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"datePublished\":\"2015-11-13T11:22:24+00:00\",\"dateModified\":\"2021-02-08T05:01:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HOW TO BUILD WORKING UBUNTU SERVER\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\",\"name\":\"Seemab Saleem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"caption\":\"Seemab Saleem\"},\"description\":\"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!\",\"sameAs\":[\"https:\/\/cpanelplesk.com\/wp62\"],\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HOW TO BUILD WORKING UBUNTU SERVER - cPanel Plesk","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/","twitter_card":"summary_large_image","twitter_title":"HOW TO BUILD WORKING UBUNTU SERVER - cPanel Plesk","twitter_description":"In this tutorial we will install and setup Apache web server and PHP. There are many newbies out there who are really new to Linux, VPS or Server, so here i am posting easier way to setup a working live server to host websites in it. [...]Continue Reading...","twitter_misc":{"Written by":"Seemab Saleem","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/"},"author":{"name":"Seemab Saleem","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648"},"headline":"HOW TO BUILD WORKING UBUNTU SERVER","datePublished":"2015-11-13T11:22:24+00:00","dateModified":"2021-02-08T05:01:50+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/"},"wordCount":316,"commentCount":0,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"articleSection":["Cpanel","Linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/","url":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/","name":"HOW TO BUILD WORKING UBUNTU SERVER - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"datePublished":"2015-11-13T11:22:24+00:00","dateModified":"2021-02-08T05:01:50+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-build-working-ubuntu-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"HOW TO BUILD WORKING UBUNTU SERVER"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648","name":"Seemab Saleem","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","caption":"Seemab Saleem"},"description":"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!","sameAs":["https:\/\/cpanelplesk.com\/wp62"],"url":"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=3135"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3135\/revisions"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=3135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=3135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=3135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}