1:HL["/_next/static/media/560d0dc937e89811-s.p.woff2",{"as":"font","type":"font/woff2"}] 2:HL["/_next/static/css/2e92341f2f2a549e.css",{"as":"style"}] 0:["990hTVHkZlVsRanvA0-KC",[[["",{"children":["blog",{"children":[["slug","set-up-development-environment-in-ubuntu-22-04-lamp-and-more","c"],{"children":["__PAGE__?{\"slug\":[\"set-up-development-environment-in-ubuntu-22-04-lamp-and-more\"]}",{}]}]}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2e92341f2f2a549e.css","precedence":"next"}]],"$L4"]]]] 5:HL["/_next/static/css/aa77ab9bba161dd5.css",{"as":"style"}] 6:I{"id":8464,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","504:static/chunks/504-3bf38d4755258f20.js","185:static/chunks/app/layout-a3c0484fb4b40d70.js"],"name":"ThemeProviders","async":false} 7:I{"id":3015,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","504:static/chunks/504-3bf38d4755258f20.js","185:static/chunks/app/layout-a3c0484fb4b40d70.js"],"name":"","async":false} 8:I{"id":3657,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","504:static/chunks/504-3bf38d4755258f20.js","185:static/chunks/app/layout-a3c0484fb4b40d70.js"],"name":"KBarSearchProvider","async":false} 9:I{"id":6685,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","797:static/chunks/app/blog/[...slug]/page-3271df622a55882d.js"],"name":"","async":false} a:I{"id":7005,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","504:static/chunks/504-3bf38d4755258f20.js","185:static/chunks/app/layout-a3c0484fb4b40d70.js"],"name":"KBarButton","async":false} b:I{"id":6914,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","504:static/chunks/504-3bf38d4755258f20.js","185:static/chunks/app/layout-a3c0484fb4b40d70.js"],"name":"","async":false} c:I{"id":8766,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","504:static/chunks/504-3bf38d4755258f20.js","185:static/chunks/app/layout-a3c0484fb4b40d70.js"],"name":"","async":false} d:I{"id":7767,"chunks":["272:static/chunks/webpack-ab432321c71a0084.js","971:static/chunks/fd9d1056-3a33dcaeb8d53e3c.js","596:static/chunks/596-58227000ca6846a8.js"],"name":"default","async":false} e:I{"id":7920,"chunks":["272:static/chunks/webpack-ab432321c71a0084.js","971:static/chunks/fd9d1056-3a33dcaeb8d53e3c.js","596:static/chunks/596-58227000ca6846a8.js"],"name":"default","async":false} 4:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"Set Up Development Environment in Ubuntu 22.04 - LAMP and More | akbv - Atanas Korabov"}],["$","meta","2",{"name":"description","content":"Learn how to set up a development environment in Ubuntu 22.04 using LAMP (Linux, Apache, MySQL, PHP) stack, along with additional tools like Xdebug, Fail2ban, SSL, and firewall. Follow this step-by-step guide to configure your system for web development.\""}],["$","meta","3",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","4",{"name":"robots","content":"index, follow"}],["$","meta","5",{"name":"googlebot","content":"index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"}],["$","link","6",{"rel":"canonical","href":"https://akbv.dev/blog/set-up-development-environment-in-ubuntu-22-04-lamp-and-more"}],["$","link","7",{"rel":"alternate","type":"application/rss+xml","href":"https://akbv.dev/feed.xml"}],["$","meta","8",{"property":"og:title","content":"Set Up Development Environment in Ubuntu 22.04 - LAMP and More"}],["$","meta","9",{"property":"og:description","content":"Learn how to set up a development environment in Ubuntu 22.04 using LAMP (Linux, Apache, MySQL, PHP) stack, along with additional tools like Xdebug, Fail2ban, SSL, and firewall. Follow this step-by-step guide to configure your system for web development.\""}],["$","meta","10",{"property":"og:url","content":"https://akbv.dev/blog/set-up-development-environment-in-ubuntu-22-04-lamp-and-more"}],["$","meta","11",{"property":"og:site_name","content":"akbv - Atanas Korabov"}],["$","meta","12",{"property":"og:locale","content":"en_US"}],["$","meta","13",{"property":"og:image","content":"https://akbv.dev/static/images/setup.png"}],["$","meta","14",{"property":"og:type","content":"article"}],["$","meta","15",{"property":"article:published_time","content":"2023-09-01T00:00:00.000Z"}],["$","meta","16",{"property":"article:modified_time","content":"2023-09-01T00:00:00.000Z"}],["$","meta","17",{"property":"article:author","content":"Atanas Korabov"}],["$","meta","18",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","19",{"name":"twitter:title","content":"Set Up Development Environment in Ubuntu 22.04 - LAMP and More"}],["$","meta","20",{"name":"twitter:description","content":"Learn how to set up a development environment in Ubuntu 22.04 using LAMP (Linux, Apache, MySQL, PHP) stack, along with additional tools like Xdebug, Fail2ban, SSL, and firewall. Follow this step-by-step guide to configure your system for web development.\""}],["$","meta","21",{"name":"twitter:image","content":"https://akbv.dev/static/images/setup.png"}],["$","meta","22",{"name":"next-size-adjust"}]] 3:[["$","html",null,{"lang":"en-us","className":"__variable_8c5df3 scroll-smooth","suppressHydrationWarning":true,"children":[["$","link",null,{"rel":"apple-touch-icon","sizes":"76x76","href":"/static/favicons/apple-touch-icon.png"}],["$","link",null,{"rel":"icon","type":"image/png","sizes":"32x32","href":"/static/favicons/favicon-32x32.png"}],["$","link",null,{"rel":"icon","type":"image/png","sizes":"16x16","href":"/static/favicons/favicon-16x16.png"}],["$","link",null,{"rel":"manifest","href":"/static/favicons/site.webmanifest"}],["$","link",null,{"rel":"mask-icon","href":"/static/favicons/safari-pinned-tab.svg","color":"#5bbad5"}],["$","meta",null,{"name":"msapplication-TileColor","content":"#000000"}],["$","meta",null,{"name":"theme-color","media":"(prefers-color-scheme: light)","content":"#fff"}],["$","meta",null,{"name":"theme-color","media":"(prefers-color-scheme: dark)","content":"#000"}],["$","link",null,{"rel":"alternate","type":"application/rss+xml","href":"/feed.xml"}],["$","body",null,{"className":"bg-white text-black antialiased dark:bg-gray-950 dark:text-white","children":["$","$L6",null,{"children":[["$undefined","$undefined","$undefined","$undefined",[["$","$L7",null,{"strategy":"afterInteractive","src":"https://www.googletagmanager.com/gtag/js?id=G-E6QL49GCHT"}],["$","$L7",null,{"strategy":"afterInteractive","id":"ga-script","children":"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', 'G-E6QL49GCHT');\n "}]]],["$","section",null,{"className":"mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0","children":["$","div",null,{"className":"flex h-screen flex-col justify-between font-sans","children":[["$","$L8",null,{"kbarConfig":{"searchDocumentsPath":"search.json"},"children":[["$","header",null,{"className":"flex items-center justify-between py-10","children":[["$","div",null,{"children":["$","$L9",null,{"href":"/","aria-label":"akbv.dev","children":["$","div",null,{"className":"flex items-center justify-between","children":[["$","div",null,{"className":"mr-3","children":["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","xmlnsXlink":"http://www.w3.org/1999/xlink","width":53.87,"height":43.61,"viewBox":"344.564 330.278 111.737 91.218","children":[["$","defs",null,{"children":[["$","path",null,{"id":"logo_svg__a","d":"M453.3 331.28v28.57l-64.66 58.65v-30.08l64.66-57.14Z"}],["$","path",null,{"id":"logo_svg__c","d":"M410.23 331.28v28.57l-64.67 58.65v-30.08l64.67-57.14Z"}],["$","linearGradient",null,{"id":"logo_svg__b","x1":"0%","x2":"100%","y1":"0%","y2":"0%","children":[["$","stop",null,{"offset":"0%","style":{"stopColor":"#00ff8f"}}],["$","stop",null,{"offset":"100%","style":{"stopColor":"#00a1ff"}}]]}]]}],["$","use",null,{"xlinkHref":"#logo_svg__a","fill":"url(#logo_svg__b)"}],["$","use",null,{"xlinkHref":"#logo_svg__c","fill":"url(#logo_svg__b)"}]]}]}],["$","div",null,{"className":"hidden h-6 text-2xl font-semibold sm:block","children":"akbv.dev"}]]}]}]}],["$","div",null,{"className":"flex items-center leading-5 space-x-4 sm:space-x-6","children":[[["$","$L9",null,{"href":"/blog","className":"hidden sm:block font-medium text-gray-900 dark:text-gray-100","children":"Blog"}],["$","$L9",null,{"href":"/tags","className":"hidden sm:block font-medium text-gray-900 dark:text-gray-100","children":"Tags"}],["$","$L9",null,{"href":"/projects","className":"hidden sm:block font-medium text-gray-900 dark:text-gray-100","children":"Projects"}],["$","$L9",null,{"href":"/about","className":"hidden sm:block font-medium text-gray-900 dark:text-gray-100","children":"About"}]],["$","$La",null,{"aria-label":"Search","children":["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24","strokeWidth":1.5,"stroke":"currentColor","className":"text-gray-900 dark:text-gray-100 h-6 w-6","children":["$","path",null,{"strokeLinecap":"round","strokeLinejoin":"round","d":"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"}]}]}],["$","$Lb",null,{}],["$","$Lc",null,{}]]}]]}],["$","main",null,{"className":"mb-auto","children":["$","$Ld",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$Le",null,{}],"templateStyles":"$undefined","notFound":["$","div",null,{"className":"flex flex-col items-start justify-start md:mt-24 md:flex-row md:items-center md:justify-center md:space-x-6","children":[["$","div",null,{"className":"space-x-2 pb-8 pt-6 md:space-y-5","children":["$","h1",null,{"className":"text-6xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 md:border-r-2 md:px-6 md:text-8xl md:leading-14","children":"404"}]}],["$","div",null,{"className":"max-w-md","children":[["$","p",null,{"className":"mb-4 text-xl font-bold leading-normal md:text-2xl","children":"Sorry we couldn't find this page."}],["$","p",null,{"className":"mb-8","children":"But dont worry, you can find plenty of other things on our homepage."}],["$","$L9",null,{"href":"/","className":"focus:shadow-outline-blue inline rounded-lg border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium leading-5 text-white shadow transition-colors duration-150 hover:bg-blue-700 focus:outline-none dark:hover:bg-blue-500","children":"Back to homepage"}]]}]]}],"notFoundStyles":[],"childProp":{"current":["$","$Ld",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$Le",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$Ld",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children",["slug","set-up-development-environment-in-ubuntu-22-04-lamp-and-more","c"],"children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$Le",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$Lf",null],"segment":"__PAGE__?{\"slug\":[\"set-up-development-environment-in-ubuntu-22-04-lamp-and-more\"]}"},"styles":[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/aa77ab9bba161dd5.css","precedence":"next"}]]}],"segment":["slug","set-up-development-environment-in-ubuntu-22-04-lamp-and-more","c"]},"styles":[]}],"segment":"blog"},"styles":[]}]}]]}],["$","footer",null,{"children":["$","div",null,{"className":"mt-16 flex flex-col items-center","children":[["$","div",null,{"className":"mb-3 flex space-x-4","children":[["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"mailto:address@yoursite.com","children":[["$","span",null,{"className":"sr-only","children":"mail"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 20 20","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":[["$","path",null,{"d":"M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z"}],["$","path",null,{"d":"M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"}]]}]]}],["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"https://github.com/a-kbv","children":[["$","span",null,{"className":"sr-only","children":"github"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 24 24","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":["$","path",null,{"d":"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"}]}]]}],["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"https://facebook.com","children":[["$","span",null,{"className":"sr-only","children":"facebook"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 24 24","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":["$","path",null,{"d":"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"}]}]]}],null,["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"https://www.linkedin.com/in/atanaskorabov/","children":[["$","span",null,{"className":"sr-only","children":"linkedin"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 24 24","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":["$","path",null,{"d":"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"}]}]]}],["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"https://twitter.com/AtanasKorabov","children":[["$","span",null,{"className":"sr-only","children":"twitter"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 24 24","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":["$","path",null,{"d":"M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"}]}]]}]]}],["$","div",null,{"className":"mb-2 flex space-x-2 text-sm text-gray-500 dark:text-gray-400","children":[["$","div",null,{"children":"Atanas Korabov"}],["$","div",null,{"children":" • "}],["$","div",null,{"children":"© 2023"}],["$","div",null,{"children":" • "}],["$","$L9",null,{"href":"/","children":"akbv - Atanas Korabov"}]]}],["$","div",null,{"className":"mb-8 text-sm text-gray-500 dark:text-gray-400","children":["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://github.com/timlrx/tailwind-nextjs-starter-blog","children":"Tailwind Nextjs Theme"}]}]]}]}]]}]}]]}]}]]}],null] 10:I{"id":2630,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","797:static/chunks/app/blog/[...slug]/page-3271df622a55882d.js"],"name":"","async":false} 11:I{"id":2529,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","797:static/chunks/app/blog/[...slug]/page-3271df622a55882d.js"],"name":"","async":false} 12:I{"id":5940,"chunks":["685:static/chunks/685-3720320f1c2a7834.js","797:static/chunks/app/blog/[...slug]/page-3271df622a55882d.js"],"name":"","async":false} f:[["$","script",null,{"type":"application/ld+json","dangerouslySetInnerHTML":{"__html":"{\"@context\":\"https://schema.org\",\"@type\":\"BlogPosting\",\"headline\":\"Set Up Development Environment in Ubuntu 22.04 - LAMP and More\",\"datePublished\":\"2023-09-01T00:00:00.000Z\",\"dateModified\":\"2023-09-01T00:00:00.000Z\",\"description\":\"Learn how to set up a development environment in Ubuntu 22.04 using LAMP (Linux, Apache, MySQL, PHP) stack, along with additional tools like Xdebug, Fail2ban, SSL, and firewall. Follow this step-by-step guide to configure your system for web development.\\\"\",\"url\":\"https://akbv.dev/blog/set-up-development-environment-in-ubuntu-22-04-lamp-and-more\",\"author\":[{\"@type\":\"Person\",\"name\":\"Atanas Korabov\"}]}"}}],["$","section",null,{"className":"mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0","children":[["$","$L10",null,{}],["$","article",null,{"children":["$","div",null,{"children":[["$","div",null,{"className":"space-y-1 pb-10 text-center dark:border-gray-700","children":[["$","div",null,{"className":"w-full","children":["$","div",null,{"className":"relative mt-6 -mx-6 md:-mx-8 2xl:-mx-24","children":["$","div",null,{"className":"aspect-[2/1] w-full relative","children":["$","img",null,{"src":"/static/images/setup.png","alt":"Set Up Development Environment in Ubuntu 22.04 - LAMP and More","fill":true,"className":"object-cover"}]}]}]}],["$","div",null,{"className":"pt-10 relative","children":["$","h1",null,{"className":"text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-5xl md:leading-14","children":"Set Up Development Environment in Ubuntu 22.04 - LAMP and More"}]}],["$","div",null,{"className":"flex justify-center gap-5 py-4","children":[["$","span",null,{"className":"flex items-center gap-1.5","children":[["$","svg",null,{"stroke":"currentColor","fill":"none","strokeWidth":"2","viewBox":"0 0 24 24","aria-hidden":"true","className":"h-5 w-5","children":["$undefined",[["$","path","0",{"strokeLinecap":"round","strokeLinejoin":"round","d":"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z","children":"$undefined"}]]],"style":{"color":"$undefined"},"height":"1em","width":"1em","xmlns":"http://www.w3.org/2000/svg"}],2965," words"]}],["$","span",null,{"className":"flex items-center gap-1.5","children":[["$","svg",null,{"stroke":"currentColor","fill":"none","strokeWidth":"2","viewBox":"0 0 24 24","aria-hidden":"true","className":"h-5 w-5","children":["$undefined",[["$","path","0",{"strokeLinecap":"round","strokeLinejoin":"round","d":"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z","children":"$undefined"}]]],"style":{"color":"$undefined"},"height":"1em","width":"1em","xmlns":"http://www.w3.org/2000/svg"}],"15 min read"]}]]}]]}],["$","div",null,{"className":"prose max-w-none py-4 dark:prose-invert","children":[["$","h1",null,{"id":"set-up-development-environment-in-ubuntu-2204---lamp-and-more","children":[["$","a",null,{"href":"#set-up-development-environment-in-ubuntu-2204---lamp-and-more","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Set Up Development Environment in Ubuntu 22.04 - LAMP and More"]}],["$","p",null,{"children":"Are you an aspiring developer looking to set up your development environment in Ubuntu 22.04? Look no further! In this guide, we will walk you through the process of setting up a powerful development environment using the LAMP (Linux, Apache, MySQL, PHP) stack. We will also cover additional tools like Xdebug, Fail2ban, SSL, and firewall to ensure the security and smooth functioning of your development environment. So let's get started!"}],["$","h2",null,{"id":"prerequisites","children":[["$","a",null,{"href":"#prerequisites","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Prerequisites"]}],["$","p",null,{"children":"Before we begin, make sure you have a fresh installation of Ubuntu 22.04. Once you have that, open up a terminal and let's get started with the setup process."}],["$","h2",null,{"id":"step-1-update-and-upgrade","children":[["$","a",null,{"href":"#step-1-update-and-upgrade","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 1: Update and Upgrade"]}],["$","p",null,{"children":"The first step is to update and upgrade your system. Run the following commands in your terminal:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," update\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," dist-upgrade\n"]}]]}]}],["$","p",null,{"children":"These commands will update your package lists and upgrade any existing packages to their latest versions. This ensures that your system is up to date and ready for the installation of other components."}],["$","h2",null,{"id":"step-2-install-essential-tools","children":[["$","a",null,{"href":"#step-2-install-essential-tools","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 2: Install Essential Tools"]}],["$","p",null,{"children":"Next, we will install some essential tools that will come in handy during the setup process. Run the following command:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," ",["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"curl"}]," ",["$","span",null,{"className":"token function","children":"htop"}]," ",["$","span",null,{"className":"token function","children":"mc"}]," net-tools\n"]}]}]}],["$","p",null,{"children":["This command will install ",["$","code",null,{"children":"sudo"}]," (if it's not already installed), ",["$","code",null,{"children":"curl"}],", ",["$","code",null,{"children":"htop"}],", ",["$","code",null,{"children":"mc"}],", and ",["$","code",null,{"children":"net-tools"}],". These tools will make it easier for you to manage your system and perform various tasks."]}],["$","h2",null,{"id":"step-3-add-user-to-sudoers","children":[["$","a",null,{"href":"#step-3-add-user-to-sudoers","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 3: Add User to Sudoers"]}],["$","p",null,{"children":["By default, the ",["$","code",null,{"children":"sudo"}]," command is only available to the root user. To add your user to the sudoers list and allow them to run commands with root privileges, run the following command:"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"usermod"}]," ",["$","span",null,{"className":"token variable parameter","children":"-aG"}]," ",["$","span",null,{"className":"token function","children":"sudo"}]," YOUR_USER\n"]}]}]}],["$","p",null,{"children":["Replace ",["$","code",null,{"children":"YOUR_USER"}]," with your actual username. This command will add your user to the ",["$","code",null,{"children":"sudo"}]," group, allowing them to execute commands as a superuser."]}],["$","h2",null,{"id":"step-4-install-apache2","children":[["$","a",null,{"href":"#step-4-install-apache2","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 4: Install Apache2"]}],["$","p",null,{"children":"Now, let's install the Apache web server. Apache is a widely used web server that will serve as the backbone of our development environment. Run the following command:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," apache2 apache2-utils\n"]}]}]}],["$","p",null,{"children":"This command will install Apache and its utilities. Once the installation is complete, Apache will be up and running on your system."}],["$","h2",null,{"id":"step-5-activate-apache2-modules","children":[["$","a",null,{"href":"#step-5-activate-apache2-modules","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 5: Activate Apache2 Modules"]}],["$","p",null,{"children":"To enhance the functionality of Apache, we need to activate some essential modules. Run the following command to activate the required modules:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," a2enmod rewrite ssl headers http2 vhost_alias\n"]}]}]}],["$","p",null,{"children":"These modules will enable features like URL rewriting, SSL support, HTTP/2 protocol, and virtual host aliasing. Enabling these modules will enhance the performance and security of your web server."}],["$","h2",null,{"id":"step-6-configure-apache2-ssl","children":[["$","a",null,{"href":"#step-6-configure-apache2-ssl","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 6: Configure Apache2 SSL"]}],["$","p",null,{"children":"To secure your web server and enable SSL encryption, we need to generate a self-signed SSL certificate. Run the following commands to generate the certificate:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," openssl req ",["$","span",null,{"className":"token variable parameter","children":"-x509"}]," ",["$","span",null,{"className":"token variable parameter","children":"-nodes"}]," ",["$","span",null,{"className":"token variable parameter","children":"-days"}]," ",["$","span",null,{"className":"token number","children":"365"}]," ",["$","span",null,{"className":"token variable parameter","children":"-newkey"}]," rsa:2048 ",["$","span",null,{"className":"token variable parameter","children":"-keyout"}]," /etc/ssl/private/apache-selfsigned.key ",["$","span",null,{"className":"token variable parameter","children":"-out"}]," /etc/ssl/certs/apache-selfsigned.crt\n"]}]}]}],["$","p",null,{"children":"These commands will create a self-signed SSL certificate and place it in the appropriate directories. Note that this is a self-signed certificate and should only be used for development purposes. For production environments, consider using a trusted SSL certificate."}],["$","h2",null,{"id":"step-7-update-apache2-configuration","children":[["$","a",null,{"href":"#step-7-update-apache2-configuration","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 7: Update Apache2 Configuration"]}],["$","p",null,{"children":["To optimize the Apache configuration for your development environment, we need to make some changes to the ",["$","code",null,{"children":"apache2.conf"}]," file. Run the following command to open the file in a text editor:"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"nano"}]," /etc/apache2/apache2.conf\n"]}]}]}],["$","p",null,{"children":["Once the file is open, locate the ",["$","code",null,{"children":""}]," section and modify it as follows:"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token operator","children":"<"}],"Directory /var/www/",["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" Options ",["$","span",null,{"className":"token variable parameter","children":"-Indexes"}]," +FollowSymLinks\n"]}],["$","span",null,{"className":"code-line","children":" AllowOverride All\n"}],["$","span",null,{"className":"code-line","children":" Require all granted\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token operator","children":"<"}],"/Directory",["$","span",null,{"className":"token operator","children":">"}],"\n"]}]]}]}],["$","p",null,{"children":["These changes will disable directory listing, allow the use of ",["$","code",null,{"children":".htaccess"}]," files for directory-specific configurations, and grant access to all users. Save the file and exit the text editor."]}],["$","h2",null,{"id":"step-8-install-mariadb","children":[["$","a",null,{"href":"#step-8-install-mariadb","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 8: Install MariaDB"]}],["$","p",null,{"children":"Next, we will install MariaDB, a fork of MySQL, which is a popular relational database management system. Run the following command to install MariaDB:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," mariadb-server mariadb-client\n"]}]}]}],["$","p",null,{"children":"This command will install MariaDB and its client component. Once the installation is complete, you will be prompted to set the root password and perform some additional security configurations. Follow the on-screen instructions to secure your MariaDB installation."}],["$","h2",null,{"id":"step-9-create-a-database-user","children":[["$","a",null,{"href":"#step-9-create-a-database-user","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 9: Create a Database User"]}],["$","p",null,{"children":"After installing MariaDB, it's recommended to create a dedicated database user for your applications. To create a database user with root access, run the following commands:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," mysql ",["$","span",null,{"className":"token variable parameter","children":"-u"}]," root ",["$","span",null,{"className":"token variable parameter","children":"-p"}],"\n"]}]}]}],["$","p",null,{"children":"Enter your root password when prompted. Once you are in the MariaDB console, execute the following commands to create a user and grant them full privileges:"}],["$","$L11",null,{"children":["$","code",null,{"className":"code-highlight language-mysql","children":[["$","span",null,{"className":"code-line","children":"CREATE USER 'user'@'%' IDENTIFIED BY 'userpass';\n"}],["$","span",null,{"className":"code-line","children":"GRANT ALL ON *.* TO 'user'@'%' WITH GRANT OPTION;\n"}]]}]}],["$","p",null,{"children":["Replace ",["$","code",null,{"children":"'user'"}]," and ",["$","code",null,{"children":"'userpass'"}]," with your desired username and password. These commands will create a user with the specified credentials and grant them all privileges on all databases. This user can be used to authenticate your applications with the database."]}],["$","h2",null,{"id":"step-10-add-repo-for-php","children":[["$","a",null,{"href":"#step-10-add-repo-for-php","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 10: Add Repo for PHP"]}],["$","p",null,{"children":"To install the latest version of PHP, we need to add a repository that provides the latest PHP packages. Run the following command to add the repository:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," add-apt-repository ppa:ondrej/php\n"]}]}]}],["$","p",null,{"children":"This command will add the repository maintained by Ondřej Surý, which provides updated and custom versions of PHP for Ubuntu."}],["$","h2",null,{"id":"step-11-install-php","children":[["$","a",null,{"href":"#step-11-install-php","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 11: Install PHP"]}],["$","p",null,{"children":"Now, let's install PHP along with some commonly used modules. Run the following command to install PHP and the required modules:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," php8.1 php8.1-",["$","span",null,{"className":"token punctuation","children":"{"}],"fpm,mysql,intl,apcu,zip,dev,curl,cli,imagick,mbstring,gd,bcmath,redis,memcached,xml",["$","span",null,{"className":"token punctuation","children":"}"}],"\n"]}]}]}],["$","p",null,{"children":"This command will install PHP 8.1 and its corresponding modules. If you prefer a different version of PHP, you can modify the version number accordingly."}],["$","h2",null,{"id":"step-12-enable-php-fpm-for-apache2","children":[["$","a",null,{"href":"#step-12-enable-php-fpm-for-apache2","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 12: Enable PHP-FPM for Apache2"]}],["$","p",null,{"children":"To enable PHP-FPM (FastCGI Process Manager) for Apache2, run the following commands:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," a2enmod proxy_fcgi setenvif\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," a2enconf php8.1-fpm\n"]}]]}]}],["$","p",null,{"children":"These commands will enable the necessary modules and configurations to use PHP-FPM with Apache2. PHP-FPM improves the performance and scalability of PHP by utilizing separate worker processes."}],["$","h2",null,{"id":"step-13-install-xdebug","children":[["$","a",null,{"href":"#step-13-install-xdebug","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 13: Install Xdebug"]}],["$","p",null,{"children":"Xdebug is a powerful debugging and profiling tool for PHP. To install Xdebug, run the following command:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," php8.1-xdebug\n"]}]}]}],["$","p",null,{"children":"This command will install Xdebug for PHP 8.1. If you are using a different version of PHP, adjust the package name accordingly."}],["$","h2",null,{"id":"step-14-configure-xdebug","children":[["$","a",null,{"href":"#step-14-configure-xdebug","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 14: Configure Xdebug"]}],["$","p",null,{"children":"To configure Xdebug, we need to create a configuration file. Run the following command to create the file:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"nano"}]," ",["$","span",null,{"className":"token number","children":"80"}],"-tuning.ini\n"]}]}]}],["$","p",null,{"children":"Paste the following code into the file:"}],["$","$L11",null,{"className":"language-ini","children":["$","code",null,{"className":"code-highlight language-ini","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token comment","children":"; Maximum amount of memory a script may consume"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"memory_limit"}]," ",["$","span",null,{"className":"token punctuation","children":"="}]," ",["$","span",null,{"className":"token attr-value value","children":"1024M"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token comment","children":"; Maximum execution time of each script, in seconds"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"max_execution_time"}]," ",["$","span",null,{"className":"token punctuation","children":"="}]," ",["$","span",null,{"className":"token attr-value value","children":"60"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token comment","children":"; Maximum size of POST data that PHP will accept."}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"post_max_size"}]," ",["$","span",null,{"className":"token punctuation","children":"="}]," ",["$","span",null,{"className":"token attr-value value","children":"1024M"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token comment","children":"; Maximum allowed size for uploaded files."}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"upload_max_filesize"}]," ",["$","span",null,{"className":"token punctuation","children":"="}]," ",["$","span",null,{"className":"token attr-value value","children":"1024M"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token comment","children":"; Xdebug settings"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"xdebug.mode"}],["$","span",null,{"className":"token punctuation","children":"="}],["$","span",null,{"className":"token attr-value value","children":"debug"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"xdebug.start_with_request"}],["$","span",null,{"className":"token punctuation","children":"="}],["$","span",null,{"className":"token attr-value value","children":"yes"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"xdebug.client_port"}],["$","span",null,{"className":"token punctuation","children":"="}],["$","span",null,{"className":"token attr-value value","children":"9000"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token comment","children":"; Xdebug OLD settings"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"xdebug.remote_enable"}],["$","span",null,{"className":"token punctuation","children":"="}],["$","span",null,{"className":"token attr-value value","children":"1"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"xdebug.remote_port"}],["$","span",null,{"className":"token punctuation","children":"="}],["$","span",null,{"className":"token attr-value value","children":"9000"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"xdebug.remote_autostart"}],["$","span",null,{"className":"token punctuation","children":"="}],["$","span",null,{"className":"token attr-value value","children":"1"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"xdebug.remote_connect_back"}],["$","span",null,{"className":"token punctuation","children":"="}],["$","span",null,{"className":"token attr-value value","children":"1"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token attr-name key","children":"xdebug.log_level"}],["$","span",null,{"className":"token punctuation","children":"="}],["$","span",null,{"className":"token attr-value value","children":"0"}],"\n"]}]]}]}],["$","p",null,{"children":"Save the file and exit the text editor."}],["$","h2",null,{"id":"step-15-create-xdebug-configuration-script","children":[["$","a",null,{"href":"#step-15-create-xdebug-configuration-script","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 15: Create Xdebug Configuration Script"]}],["$","p",null,{"children":"To automate the process of creating symbolic links for the Xdebug configuration file, we will create a shell script. Run the following command to create the script file:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"nano"}]," create-symlink-80-tuning.sh\n"]}]}]}],["$","p",null,{"children":"Paste the following code into the file:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token important shebang","children":"#!/bin/bash"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token keyword","children":"if"}]," ",["$","span",null,{"className":"token punctuation","children":"["}]," ",["$","span",null,{"className":"token variable parameter","children":"-f"}]," ",["$","span",null,{"className":"token string","children":"\"80-tuning.ini\""}]," ",["$","span",null,{"className":"token punctuation","children":"]"}],["$","span",null,{"className":"token punctuation","children":";"}]," ",["$","span",null,{"className":"token keyword","children":"then"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token builtin class-name","children":"echo"}]," ",["$","span",null,{"className":"token string","children":"\"Copying PHP tuning to /etc/php/80-tuning.ini\""}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token function","children":"cp"}]," ",["$","span",null,{"className":"token number","children":"80"}],"-tuning.ini /etc/php/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token keyword","children":"else"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token builtin class-name","children":"echo"}]," ",["$","span",null,{"className":"token string","children":"\"80-tuning.ini - File not found!\""}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token builtin class-name","children":"return"}]," ",["$","span",null,{"className":"token number","children":"1"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token keyword","children":"fi"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token builtin class-name","children":"echo"}]," ",["$","span",null,{"className":"token string","children":"\"Creating symlinks to /etc/php/80-tuning.ini\""}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/7.1/fpm/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/7.1/cli/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/7.3/fpm/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/7.3/cli/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/7.4/fpm/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/7.4/cli/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/8.0/fpm/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/8.0/cli/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/8.1/fpm/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/8.1/cli/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/8.2/fpm/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"ln"}]," ",["$","span",null,{"className":"token variable parameter","children":"-s"}]," /etc/php/80-tuning.ini /etc/php/8.2/cli/conf.d/80-tuning.ini\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token builtin class-name","children":"echo"}]," ",["$","span",null,{"className":"token string","children":"\"Restarting PHP-FPM...\""}],"\n"]}],["$","span",null,{"className":"code-line","children":"systemctl restart php7.1-fpm\n"}],["$","span",null,{"className":"code-line","children":"systemctl restart php7.3-fpm\n"}],["$","span",null,{"className":"code-line","children":"systemctl restart php7.4-fpm\n"}],["$","span",null,{"className":"code-line","children":"systemctl restart php8.0-fpm\n"}],["$","span",null,{"className":"code-line","children":"systemctl restart php8.1-fpm\n"}],["$","span",null,{"className":"code-line","children":"systemctl restart php8.2-fpm\n"}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token builtin class-name","children":"echo"}]," ",["$","span",null,{"className":"token string","children":"\"Done!\""}],"\n"]}]]}]}],["$","p",null,{"children":"Save the file and exit the text editor. Then, make the script executable by running the following command:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"chmod"}]," +x create-symlink-80-tuning.sh\n"]}]}]}],["$","p",null,{"children":"Finally, execute the script with the following command:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ./create-symlink-80-tuning.sh\n"]}]}]}],["$","p",null,{"children":"This script will copy the Xdebug configuration to the appropriate directory and create symbolic links for various PHP versions. It will also restart the corresponding PHP-FPM services."}],["$","h2",null,{"id":"step-16-install-composer-optional","children":[["$","a",null,{"href":"#step-16-install-composer-optional","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 16: Install Composer (Optional)"]}],["$","p",null,{"children":["If you are working with PHP projects that require external dependencies, it's highly recommended to install Composer. Composer is a dependency management tool for PHP that allows you to easily install and update packages. To install Composer, follow the official documentation at ",["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://getcomposer.org/download/","children":"https://getcomposer.org/download/"}],"."]}],["$","h2",null,{"id":"step-17-configure-security-settings","children":[["$","a",null,{"href":"#step-17-configure-security-settings","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 17: Configure Security Settings"]}],["$","p",null,{"children":"To enhance the security of your development environment, we will configure the firewall and enable fail2ban. Run the following commands to install and configure these security tools:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," ufw\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ufw allow ",["$","span",null,{"className":"token function","children":"ssh"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ufw allow http\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ufw allow https\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ufw allow mysql\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ufw ",["$","span",null,{"className":"token builtin class-name","children":"enable"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," fail2ban\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"nano"}]," /etc/fail2ban/jail.local\n"]}]]}]}],["$","p",null,{"children":["In the ",["$","code",null,{"children":"jail.local"}]," file, add the following lines to enable fail2ban for MySQL authentication:"]}],["$","$L11",null,{"className":"language-js","children":["$","code",null,{"className":"code-highlight language-js","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token punctuation","children":"["}],"mysqld",["$","span",null,{"className":"token operator","children":"-"}],"auth",["$","span",null,{"className":"token punctuation","children":"]"}],"\n"]}],["$","span",null,{"className":"code-line","children":["enabled ",["$","span",null,{"className":"token operator","children":"="}]," ",["$","span",null,{"className":"token boolean","children":"true"}],"\n"]}]]}]}],["$","p",null,{"children":"Save the file and exit the text editor. These settings will enable the firewall, allow SSH, HTTP, HTTPS, and MySQL traffic, and enable fail2ban for MySQL authentication."}],["$","h2",null,{"id":"step-18-configure-virtual-hosts-and-ssl","children":[["$","a",null,{"href":"#step-18-configure-virtual-hosts-and-ssl","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 18: Configure Virtual Hosts and SSL"]}],["$","p",null,{"children":"To organize and manage multiple websites on your development environment, it's recommended to set up virtual hosts. Virtual hosts allow you to host multiple websites on a single Apache server by assigning different domain names or subdomains to each site. We will also configure SSL to secure the websites."}],["$","p",null,{"children":"To configure virtual hosts and SSL, follow these steps:"}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":["Create a new configuration file for your virtual host. Replace ",["$","code",null,{"children":"websiteName"}]," with your desired domain name or subdomain. Run the following command to create the configuration file:"]}],["$","$L11",null,{"className":"language-js","children":["$","code",null,{"className":"code-highlight language-js","children":["$","span",null,{"className":"code-line","children":["sudo nano ",["$","span",null,{"className":"token operator","children":"/"}],"etc",["$","span",null,{"className":"token operator","children":"/"}],"apache2",["$","span",null,{"className":"token operator","children":"/"}],"sites",["$","span",null,{"className":"token operator","children":"-"}],"available",["$","span",null,{"className":"token operator","children":"/"}],"websiteName",["$","span",null,{"className":"token punctuation","children":"."}],["$","span",null,{"className":"token property-access","children":"conf"}],"\n"]}]}]}]]}],["$","li",null,{"children":["$","p",null,{"children":"Paste the following configuration into the file:"}]}]]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"VirtualHost *:8",["$","span",null,{"className":"token operator","children":[["$","span",null,{"className":"token important file-descriptor","children":"0"}],">"]}],"\n"]}],["$","span",null,{"className":"code-line","children":[" DocumentRoot ",["$","span",null,{"className":"token string","children":"\"/var/www/example.com\""}],"\n"]}],["$","span",null,{"className":"code-line","children":" ServerName example.com\n"}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"Directory ",["$","span",null,{"className":"token string","children":"\"/var/www/example.com\""}],["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" Options ",["$","span",null,{"className":"token variable parameter","children":"-Indexes"}]," +FollowSymLinks +MultiViews\n"]}],["$","span",null,{"className":"code-line","children":" Require all granted\n"}],["$","span",null,{"className":"code-line","children":" AllowOverride All\n"}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"/Directory",["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"FilesMatch ",["$","span",null,{"className":"token string","children":"\".+\\.ph(ar|p|tml)$\""}],["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" SetHandler ",["$","span",null,{"className":"token string","children":"\"proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost\""}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"/FilesMatch",["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"/VirtualHost",["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"VirtualHost *:44",["$","span",null,{"className":"token operator","children":[["$","span",null,{"className":"token important file-descriptor","children":"3"}],">"]}],"\n"]}],["$","span",null,{"className":"code-line","children":[" DocumentRoot ",["$","span",null,{"className":"token string","children":"\"/var/www/example.com\""}],"\n"]}],["$","span",null,{"className":"code-line","children":" ServerName example.com\n"}],["$","span",null,{"className":"code-line","children":" SSLEngine on\n"}],["$","span",null,{"className":"code-line","children":" SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt\n"}],["$","span",null,{"className":"code-line","children":" SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key\n"}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"Directory ",["$","span",null,{"className":"token string","children":"\"/var/www/example.com\""}],["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" Options ",["$","span",null,{"className":"token variable parameter","children":"-Indexes"}]," +FollowSymLinks +MultiViews\n"]}],["$","span",null,{"className":"code-line","children":" Require all granted\n"}],["$","span",null,{"className":"code-line","children":" AllowOverride All\n"}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"/Directory",["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"FilesMatch ",["$","span",null,{"className":"token string","children":"\".+\\.ph(ar|p|tml)$\""}],["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" SetHandler ",["$","span",null,{"className":"token string","children":"\"proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost\""}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"/FilesMatch",["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"/VirtualHost",["$","span",null,{"className":"token operator","children":">"}],"\n"]}]]}]}],["$","p",null,{"children":["In this example, we assume that your website's files are located at ",["$","code",null,{"children":"/var/www/example.com"}],". Replace this path with the actual path to your website's root directory."]}],["$","p",null,{"children":["The configuration includes both HTTP (",["$","code",null,{"children":""}],") and HTTPS (",["$","code",null,{"children":""}],") sections. For the SSL section, we assume you have already generated the SSL certificate and key files and placed them at ",["$","code",null,{"children":"/etc/ssl/certs/apache-selfsigned.crt"}]," and ",["$","code",null,{"children":"/etc/ssl/private/apache-selfsigned.key"}],", respectively. Modify these paths if necessary."]}],["$","ol",null,{"start":"3","children":[["$","li",null,{"children":["$","p",null,{"children":"Save the file and exit the text editor."}]}],["$","li",null,{"children":[["$","p",null,{"children":"Enable the virtual host by creating a symbolic link:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," a2ensite websiteName.conf\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Restart Apache to apply the changes:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," systemctl restart apache2\n"]}]}]}]]}]]}],["$","p",null,{"children":["Now you can access your website by navigating to ",["$","code",null,{"children":"http://skypebridge.localhost"}]," for HTTP and ",["$","code",null,{"children":"https://skypebridge.localhost"}]," for HTTPS."]}],["$","p",null,{"children":"Repeat these steps for each virtual host you want to set up, ensuring that each configuration file has a unique name and points to the appropriate document root directory and SSL certificate files."}],["$","p",null,{"children":"With this configuration, your websites will be accessible over both HTTP and HTTPS secured connections."}],["$","h2",null,{"id":"step-19-install-and-configure-ssl-certificates","children":[["$","a",null,{"href":"#step-19-install-and-configure-ssl-certificates","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 19: Install and Configure SSL Certificates"]}],["$","p",null,{"children":"If you want to secure your websites with trusted SSL certificates, you can obtain them from a certificate authority (CA) or use Let's Encrypt, a free and open certificate authority. Let's Encrypt provides automated tools to obtain and renew SSL certificates. Follow the steps below to set up SSL certificates using Let's Encrypt:"}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":"Install the Let's Encrypt client, Certbot:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," certbot python3-certbot-apache\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Obtain SSL certificates for your virtual hosts (replace ",["$","code",null,{"children":"example.com"}]," with your domain/subdomain):"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," certbot ",["$","span",null,{"className":"token variable parameter","children":"--apache"}]," ",["$","span",null,{"className":"token variable parameter","children":"-d"}]," example.com ",["$","span",null,{"className":"token variable parameter","children":"-d"}]," www.example.com\n"]}]}]}]]}],["$","li",null,{"children":["$","p",null,{"children":"Follow the prompts to provide the necessary information and agree to the Terms of Service."}]}],["$","li",null,{"children":["$","p",null,{"children":"Certbot will automatically configure Apache with the SSL certificates and enable HTTPS for your virtual hosts."}]}],["$","li",null,{"children":["$","p",null,{"children":"Certbot will also set up a monthly cron job to renew the SSL certificates automatically."}]}]]}],["$","p",null,{"children":"With SSL certificates installed, your websites will be accessible over secure HTTPS connections."}],["$","h2",null,{"id":"step-20-set-up-remote-mysql-access-optional","children":[["$","a",null,{"href":"#step-20-set-up-remote-mysql-access-optional","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 20: Set Up Remote MySQL Access (Optional)"]}],["$","p",null,{"children":"If you want to access your MySQL/MariaDB database remotely, for example, from a database management tool on your local machine, you can configure your database server to allow remote access."}],["$","p",null,{"children":"Follow these steps to set up remote MySQL access:"}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":"Edit the MySQL/MariaDB configuration file:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"nano"}]," /etc/mysql/mariadb.conf.d/50-server.cnf\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Locate the ",["$","code",null,{"children":"bind-address"}]," directive and comment it out or change its value to your server's IP address:"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token comment","children":"# bind-address = 127.0.0.1"}],"\n"]}]}]}]]}],["$","li",null,{"children":["$","p",null,{"children":"Save the file and exit the text editor."}]}],["$","li",null,{"children":[["$","p",null,{"children":"Restart MySQL/MariaDB to apply the changes:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," systemctl restart mariadb\n"]}]}]}]]}]]}],["$","p",null,{"children":"Now you will be able to connect to your remote MySQL/MariaDB server from your local machine using a database management tool like MySQL Workbench or phpMyAdmin."}],["$","p",null,{"children":"Please note that enabling remote access to your database server can pose security risks. Make sure to secure your database server by choosing strong passwords and restricting access to trusted IP addresses."}],["$","h2",null,{"id":"step-21-enable-php-error-logging","children":[["$","a",null,{"href":"#step-21-enable-php-error-logging","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 21: Enable PHP Error Logging"]}],["$","p",null,{"children":"To debug PHP errors and warnings and troubleshoot issues in your application, it's helpful to enable error logging in PHP."}],["$","p",null,{"children":"To enable PHP error logging, follow these steps:"}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":"Edit the PHP configuration file for the desired PHP version:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"nano"}]," /etc/php/8.1/fpm/php.ini\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Find the ",["$","code",null,{"children":"error_reporting"}]," directive and set it to the desired error reporting level. For example, to log all errors, warnings, and notices, use the following value:"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":["error_reporting ",["$","span",null,{"className":"token operator","children":"="}]," E_ALL\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Find the ",["$","code",null,{"children":"display_errors"}]," directive and set it to ",["$","code",null,{"children":"Off"}],":"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":["display_errors ",["$","span",null,{"className":"token operator","children":"="}]," Off\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Find the ",["$","code",null,{"children":"log_errors"}]," directive and set it to ",["$","code",null,{"children":"On"}],":"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":["log_errors ",["$","span",null,{"className":"token operator","children":"="}]," On\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Specify the path to the log file using the ",["$","code",null,{"children":"error_log"}]," directive. For example:"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":["error_log ",["$","span",null,{"className":"token operator","children":"="}]," /var/log/php/php_error.log\n"]}]}]}]]}],["$","li",null,{"children":["$","p",null,{"children":"Save the file and exit the text editor."}]}],["$","li",null,{"children":[["$","p",null,{"children":"Restart PHP-FPM to apply the changes:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," systemctl restart php8.1-fpm\n"]}]}]}]]}]]}],["$","p",null,{"children":"PHP errors will now be logged to the specified file. You can then check the log file for any errors or warnings encountered during the execution of your PHP scripts."}],["$","h2",null,{"id":"step-22-set-up-git-version-control","children":[["$","a",null,{"href":"#step-22-set-up-git-version-control","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 22: Set Up Git Version Control"]}],["$","p",null,{"children":"Git is a popular version control system that allows you to track changes in your codebase and collaborate with others. To set up Git, follow these steps:"}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":"Install Git:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," ",["$","span",null,{"className":"token function","children":"git"}],"\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Configure your Git username and email:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"git"}]," config ",["$","span",null,{"className":"token variable parameter","children":"--global"}]," user.name ",["$","span",null,{"className":"token string","children":"\"Your Name\""}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"git"}]," config ",["$","span",null,{"className":"token variable parameter","children":"--global"}]," user.email ",["$","span",null,{"className":"token string","children":"\"youremail@example.com\""}],"\n"]}]]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Generate an SSH key (if you don't already have one) to securely authenticate with remote Git repositories:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":["ssh-keygen ",["$","span",null,{"className":"token variable parameter","children":"-t"}]," rsa ",["$","span",null,{"className":"token variable parameter","children":"-b"}]," ",["$","span",null,{"className":"token number","children":"4096"}]," ",["$","span",null,{"className":"token variable parameter","children":"-C"}]," ",["$","span",null,{"className":"token string","children":"\"youremail@example.com\""}],"\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Add your SSH key to the SSH agent:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token builtin class-name","children":"eval"}]," ",["$","span",null,{"className":"token string","children":["\"",["$","span",null,{"className":"token variable","children":[["$","span",null,{"className":"token variable","children":"$$("}],"ssh-agent ",["$","span",null,{"className":"token variable parameter","children":"-s"}],["$","span",null,{"className":"token variable","children":")"}]]}],"\""]}],"\n"]}],["$","span",null,{"className":"code-line","children":"ssh-add ~/.ssh/id_rsa\n"}]]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Copy the SSH key to your clipboard:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"cat"}]," ~/.ssh/id_rsa.pub\n"]}]}]}]]}],["$","li",null,{"children":["$","p",null,{"children":"Go to your Git hosting provider (e.g., GitHub, GitLab) and add the SSH key to your account settings."}]}]]}],["$","p",null,{"children":"Now you can use Git to track changes in your projects, collaborate with others, and push your code to remote repositories."}],["$","h2",null,{"id":"step-23-install-code-editors-and-development-tools","children":[["$","a",null,{"href":"#step-23-install-code-editors-and-development-tools","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 23: Install Code Editors and Development Tools"]}],["$","p",null,{"children":"Having a reliable code editor and development tools can greatly enhance your productivity and coding experience. Here are a few popular options:"}],["$","p",null,{"children":["To learn how to install Visual Studio Code on Ubuntu 22.04 using the terminal, you can check out our detailed blog post ",["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"http://akbv.dev/blog/vs-code-installation-by-terminal-ubuntu","children":"VS Code Installation Guide for Ubuntu via Terminal"}],". This guide provides step-by-step instructions for installing Visual Studio Code and getting started with the editor."]}],["$","p",null,{"children":"Visual Studio Code offers a wide range of features and extensions that make it a powerful tool for coding in various programming languages. Whether you are a beginner or an experienced developer, having a solid code editor can significantly improve your development workflow."}],["$","p",null,{"children":"So head over to our blog post and follow the instructions to install Visual Studio Code on your Ubuntu 22.04 system."}],["$","h2",null,{"id":"step-24-install-and-configure-redis","children":[["$","a",null,{"href":"#step-24-install-and-configure-redis","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Step 24: Install and Configure Redis"]}],["$","p",null,{"children":"Redis is an in-memory data structure store that can be used as a caching layer or as a messaging broker in your applications. To install Redis, follow these steps:"}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":"Install Redis:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," ",["$","span",null,{"className":"token function","children":"install"}]," redis-server\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Start the Redis service:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," systemctl start redis-server\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Enable Redis to start on boot:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," systemctl ",["$","span",null,{"className":"token builtin class-name","children":"enable"}]," redis-server\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Configure Redis to allow remote connections (if needed). Open the Redis configuration file:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"nano"}]," /etc/redis/redis.conf\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Find the ",["$","code",null,{"children":"bind"}]," directive and change its value to your server's IP address or comment it out to allow connections from any IP:"]}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token comment","children":"# bind 127.0.0.1"}],"\n"]}]}]}]]}],["$","li",null,{"children":["$","p",null,{"children":"Save the file and exit the text editor."}]}],["$","li",null,{"children":[["$","p",null,{"children":"Restart the Redis service to apply the changes:"}],["$","$L11",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," systemctl restart redis-server\n"]}]}]}]]}]]}],["$","p",null,{"children":"Redis is now installed and accessible on your system. You can use the Redis server for caching or as a messaging broker in your applications."}],["$","h2",null,{"id":"conclusion","children":[["$","a",null,{"href":"#conclusion","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Conclusion"]}],["$","p",null,{"children":"Congratulations! You have successfully set up your development environment in Ubuntu 22.04 using the LAMP stack. You now have a powerful web server (Apache), a reliable database management system (MariaDB), the latest version of PHP with essential modules, debugging capabilities with Xdebug, security measures with Fail2ban and a firewall, and optional tools like Composer and Node.js/npm. With this setup, you can start developing and testing your web applications with ease."}],["$","p",null,{"children":"Remember to always keep your system and applications up to date and follow security best practices to ensure a safe and secure development environment. Happy coding!"}],["$","p",null,{"children":["$","em",null,{"children":"Note: This guide assumes a basic understanding of Linux commands and concepts. If you encounter any issues during the setup process, refer to the official documentation of the respective tools or seek assistance from the developer community."}]}]]}],["$","div",null,{"className":"pb-6 pt-6 text-center text-gray-700 dark:text-gray-300","id":"comment","children":["$","$L12",null,{"slug":"set-up-development-environment-in-ubuntu-22-04-lamp-and-more"}]}],["$","footer",null,{"children":["$","div",null,{"className":"flex flex-col text-sm font-medium sm:flex-row sm:justify-between sm:text-base","children":[["$","div",null,{"className":"pt-4 xl:pt-8","children":["$","$L9",null,{"href":"/blog/skype-web-api-for-php","className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","aria-label":"Previous post: Skype Web API for PHP: A Comprehensive Guide","children":["← ","Skype Web API for PHP: A Comprehensive Guide"]}]}],["$","div",null,{"className":"pt-4 xl:pt-8","children":["$","$L9",null,{"href":"/blog/php8-new-features-and-updates","className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","aria-label":"Next post: PHP 8: New Features and Improvements","children":["PHP 8: New Features and Improvements"," →"]}]}]]}]}]]}]}]]}]]