Setup LAMP#
GitHub Let install PHP and MariaDB
Here is basic UserData for getting started
#!/bin/bash# install php and mariadbsudo dnf update -ysudo dnf install -y httpd wget php-fpm php-mysqli php-json php php-develsudo dnf install mariadb105-server# download codewget https://github.com/cdk-entest/swinburne-dn-cos20019/archive/php.zipunzip php.zipcd swinburne-dn-cos20019-php/# run the webserverphp -S localhost:3000
First, let install PHP and MariaDB.
sudo dnf update -ysudo dnf install -y httpd wget php-fpm php-mysqli php-json php php-develsudo dnf install mariadb105-server
Start the apache web server
sudo systemctl start httpd
Enable the httpd service
sudo systemctl is-enabled httpd
Change folder /var/www/html permissions
sudo usermod -a -G apache ec2-userexitgroups
Change permissions
sudo chown -R ec2-user:apache /var/wwwsudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;find /var/www -type f -exec sudo chmod 0664 {} \;
Test LAMP Server#
Create a index.php in /var/www/html/index.php
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>PHP - Hello, World!</title></head><body><h1>Hello, World!</h1></body>
Or my book page
book.html
<!DOCTYPE html><!-- entest 29 april 2023 basic tailwind --><html><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><linkhref="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/review-book.css"rel="stylesheet"/></head><body class="bg-gray-100"><div class="bg-green-400 py-3"><nav class="flex mx-auto max-w-5xl justify-between"><a href="#" class="font-bold text-2xl"> Entest </a><ul class="hidden md:flex gap-x-3"><liclass="bg-white hover:bg-green-600 hover:text-white px-3 py-1 rounded-sm"><a href="https://cdk.entest.io/" target="_blank">About Me</a></li></ul></nav></div><divclass="bg-[url('https://d2cvlmmg8c0xrp.cloudfront.net/web-css/singapore.jpg')] bg-no-repeat bg-cover"><div class="mx-auto max-w-5xl pt-20 pb-48 pr-48 mb-10 text-right"><h2 class="invisible md:visible text-3xl font-bold mb-8">Good Books about AWS Cloud Computing</h2></div></div><div class="mx-auto max-w-5xl"><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Data Engineering with AWS</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/data_engineering_with_aws.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>This is a great book for understanding and implementing the lakehouse architecture to integrate your Data Lake with your warehouse.It shows you all the steps you need to orchestrate your datapipeline. From architecture, ingestion, and processing to runningqueries in your data warehouse, I really like the very hands-onapproach that shows you how you can immediately implement the topicsin your AWS account Andreas Kretz, CEO, Learn Data Engineering</p><ahref="https://www.amazon.com/Data-Engineering-AWS-Gareth-Eagar/dp/1800560419/ref=sr_1_1?crid=28BFB3NXGTM9G&keywords=data+engineering+with+aws&qid=1682772617&sprefix=data+engineering+with+aws%2Caps%2C485&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Data Science on AWS</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/data_science_on_aws.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>With this practical book, AI and machine learning practitioners willlearn how to successfully build and deploy data science projects onAmazon Web Services. The Amazon AI and machine learning stackunifies data science, data engineering, and application developmentto help level up your skills. This guide shows you how to build andrun pipelines in the cloud, then integrate the results intoapplications in minutes instead of days. Throughout the book,authors Chris Fregly and Antje Barth demonstrate how to reduce costand improve performance.</p><ahref="https://www.amazon.com/Data-Science-AWS-End-End/dp/1492079391/ref=sr_1_1?crid=17XK1VLHDZH59&keywords=data+science+on+aws&qid=1682772629&sprefix=data+science+on+%2Caps%2C327&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Serverless Analytics with Amazon Athena</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/serverless_athena.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>This book begins with an overview of the serverless analyticsexperience offered by Athena and teaches you how to build and tunean S3 Data Lake using Athena, including how to structure your tablesusing open-source file formats like Parquet. You willl learn how tobuild, secure, and connect to a data lake with Athena and LakeFormation. Next, you will cover key tasks such as ad hoc dataanalysis, working with ETL pipelines, monitoring and alerting KPIbreaches using CloudWatch Metrics, running customizable connectorswith AWS Lambda, and more. Moving on, you will work through easyintegrations, troubleshooting and tuning common Athena issues, andthe most common reasons for query failure.You will also review tipsto help diagnose and correct failing queries in your pursuit ofoperational excellence.Finally, you will explore advanced conceptssuch as Athena Query Federation and Athena ML to generate powerfulinsights without needing to touch a single server.</p><ahref="https://www.amazon.com/Serverless-Analytics-Amazon-Athena-semi-structured/dp/1800562349/ref=sr_1_1?crid=2KSTZBI4HUBZS&keywords=serverless+athena&qid=1682772648&sprefix=serverless+athe%2Caps%2C323&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Serverless ETL and Analytics with AWS Glue</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/serverless_glue.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>Beginning with AWS Glue basics, this book teaches you how to performvarious aspects of data analysis such as ad hoc queries, datavisualization, and real time analysis using this service. It alsoprovides a walk-through of CI/CD for AWS Glue and how to shift lefton quality using automated regression tests. You will find out howdata security aspects such as access control, encryption, auditing,and networking are implemented, as well as getting to grips withuseful techniques such as picking the right file format,compression, partitioning, and bucketing.As you advance, you willdiscover AWS Glue features such as crawlers, Lake Formation,governed tables, lineage, DataBrew, Glue Studio, and customconnectors. The concluding chapters help you to understand variousperformance tuning, troubleshooting, and monitoring options.</p><ahref="https://www.amazon.com/Serverless-ETL-Analytics-Glue-comprehensive/dp/1800564988/ref=sr_1_1?crid=HJXN5QBY7F2P&keywords=serverless+ETL+with+glue+aws&qid=1682772669&sprefix=serverless+etl+with+glue+a%2Caps%2C324&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Simplify Big Data Analytics with Amazon EMR</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/amazon_emr.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>Amazon EMR, formerly Amazon Elastic MapReduce, provides a managedHadoop cluster in Amazon Web Services (AWS) that you can use toimplement batch or streaming data pipelines. By gaining expertise inAmazon EMR, you can design and implement data analytics pipelineswith persistent or transient EMR clusters in AWS.This book is apractical guide to Amazon EMR for building data pipelines. You willstart by understanding the Amazon EMR architecture, cluster nodes,features, and deployment options, along with their pricing. Next,the book covers the various big data applications that EMR supports.You will then focus on the advanced configuration of EMRapplications, hardware, networking, security, troubleshooting,logging, and the different SDKs and APIs it provides. Later chapterswill show you how to implement common Amazon EMR use cases,including batch ETL with Spark, real time streaming with SparkStreaming, and handling UPSERT in S3 Data Lake with Apache Hudi.Finally, you will orchestrate your EMR jobs and strategize onpremises Hadoop cluster migration to EMR. In addition to this, youwill explore best practices and cost optimization techniques whileimplementing your data analytics pipeline in EMR</p><ahref="https://www.amazon.com/Simplify-Big-Data-Analytics-Amazon/dp/1801071071/ref=sr_1_1?crid=1BHYUKJ14LKNU&keywords=%22Simplify+Big+Data+Analytics+with+Amazon+EMR&qid=1682772695&sprefix=simplify+big+data+analytics+with+amazon+emr%2Caps%2C322&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Scalable Data Streaming with Amazon Kinesis</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/amazon_kinesis.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>Amazon Kinesis is a collection of secure, serverless, durable, andhighly available purpose built data streaming services. This datastreaming service provides APIs and client SDKs that enable you toproduce and consume data at scale. Scalable Data Streaming withAmazon Kinesis begins with a quick overview of the core concepts ofdata streams, along with the essentials of the AWS Kinesislandscape. You will then explore the requirements of the use caseshown through the book to help you get started and cover the keypain points encountered in the data stream life cycle. As youadvance, you will get to grips with the architectural components ofKinesis, understand how they are configured to build data pipelines,and delve into the applications that connect to them for consumptionand processing. You will also build a Kinesis data pipeline fromscratch and learn how to implement and apply practical solutions.Moving on, you will learn how to configure Kinesis on a cloudplatform. Finally, you will learn how other AWS services can beintegrated into Kinesis. These services include Redshift, DynamoDatabase, AWS S3, Elastic Search, and third-party applications suchas Splunk.</p><ahref="https://www.amazon.com/Scalable-Data-Streaming-Amazon-Kinesis/dp/1800565402/ref=sr_1_1?crid=1CC6W33MEW2GE&keywords=Scalable+Data+Streaming+with+Amazon+Kinesis&qid=1682772706&sprefix=scalable+data+streaming+with+amazon+kinesis%2Caps%2C312&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Actionable Insights with Amazon QuickSight</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/amazon_quicksight.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>Amazon Quicksight is an exciting new visualization that rivalsPowerBI and Tableau, bringing several exciting features to the tablebut sadly, there are not many resources out there that can help youlearn the ropes. This book seeks to remedy that with the help of anAWS certified expert who will help you leverage its fullcapabilities. After learning QuickSight is fundamental concepts andhow to configure data sources, you will be introduced to the mainanalysis-building functionality of QuickSight to develop visuals anddashboards, and explore how to develop and share interactivedashboards with parameters and on screen controls. You will diveinto advanced filtering options with URL actions before learning howto set up alerts and scheduled reports.</p><ahref="https://www.amazon.com/Actionable-Insights-Amazon-QuickSight-learning-driven/dp/1801079293/ref=sr_1_1?crid=1F6H7KDE97RHA&keywords=Actionable+Insights+with+Amazon+QuickSight&qid=1682772719&sprefix=actionable+insights+with+amazon+quicksight%2Caps%2C305&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Amazon Redshift Cookbook</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/redshift_cook_book.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>Amazon Redshift is a fully managed, petabyte-scale AWS cloud datawarehousing service. It enables you to build new data warehouseworkloads on AWS and migrate on-premises traditional datawarehousing platforms to Redshift. This book on Amazon Redshiftstarts by focusing on Redshift architecture, showing you how toperform database administration tasks on Redshift.You will thenlearn how to optimize your data warehouse to quickly execute complexanalytic queries against very large datasets. Because of the massiveamount of data involved in data warehousing, designing your databasefor analytical processing lets you take full advantage of Redshiftscolumnar architecture and managed services.As you advance, you willdiscover how to deploy fully automated and highly scalable extract,transform, and load (ETL) processes, which help minimize theoperational efforts that you have to invest in managing regular ETLpipelines and ensure the timely and accurate refreshing of your datawarehouse. Finally, you will gain a clear understanding of Redshiftuse cases, data ingestion, data management, security, and scaling sothat you can build a scalable data warehouse platform.</p><ahref="https://www.amazon.com/Amazon-Redshift-Cookbook-warehousing-solutions/dp/1800569688/ref=sr_1_1?crid=2P8V7A8548HBG&keywords=Amazon+Redshift+Cookbook&qid=1682772732&sprefix=amazon+redshift+cookbook%2Caps%2C315&sr=8-1&ufe=app_do%3Aamzn1.fos.006c50ae-5d4c-4777-9bc0-4513d670b6bc"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Automated Machine Learning on AWS</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/automated_ml_on_aws.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>Automated Machine Learning on AWS begins with a quick overview ofwhat the machine learning pipeline/process looks like and highlightsthe typical challenges that you may face when building a pipeline.Throughout the book, you'll become well versed with various AWSsolutions such as Amazon SageMaker Autopilot, AutoGluon, and AWSStep Functions to automate an end-to-end ML process with the help ofhands-on examples. The book will show you how to build, monitor, andexecute a CI/CD pipeline for the ML process and how the variousCI/CD services within AWS can be applied to a use case with theCloud Development Kit (CDK). You'll understand what adata-centric ML process is by working with the Amazon ManagedServices for Apache Airflow and then build a managed Airflowenvironment. You'll also cover the key success criteria for anMLSDLC implementation and the process of creating a self-mutatingCI/CD pipeline using AWS CDK from the perspective of the platformengineering team</p><ahref="https://www.amazon.com/Automated-Machine-Learning-AWS-production-ready/dp/1801811822/ref=sr_1_1?crid=30X8QQER05M37&keywords=Automated+Machine+Learning+on+AWS&qid=1682772744&sprefix=automated+machine+learning+on+aws%2Caps%2C327&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Kubernetes Up and Running</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/kubernetes_up_running.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>In just five years, Kubernetes has radically changed the waydevelopers and ops personnel build, deploy, and maintainapplications in the cloud. With this book is updated third edition,you will learn how this popular container orchestrator can help yourcompany achieve new levels of velocity, agility, reliability, andefficiency whether you are new to distributed systems or have beendeploying cloud native apps for some time.</p><ahref="https://www.amazon.com/Kubernetes-Running-Dive-Future-Infrastructure/dp/109811020X/ref=sr_1_1?crid=2H4E57L24G3C5&keywords=Kubernetes+Up+and+Running&qid=1682772756&sprefix=kubernetes+up+and+running%2Caps%2C332&sr=8-1&ufe=app_do%3Aamzn1.fos.006c50ae-5d4c-4777-9bc0-4513d670b6bc"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Getting Started with Containerization</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/containerization.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>Kubernetes is an open source orchestration platform for managingcontainers in a cluster environment. This Learning Path introducesyou to the world of containerization, in addition to providing youwith an overview of Docker fundamentals. As you progress, you willbe able to understand how Kubernetes works with containers. Startingwith creating Kubernetes clusters and running applications withproper authentication and authorization, you will learn how tocreate high- availability Kubernetes clusters on Amazon WebServices(AWS), and also learn how to use kubeconfig to managedifferent clusters.Whether it is learning about Docker containersand Docker Compose, or building a continuous delivery pipeline foryour application, this Learning Path will equip you with all theright tools and techniques to get started with containerization.</p><ahref="https://www.amazon.com/Getting-Started-Containerization-operational-automating-ebook/dp/B07Q4952SH/ref=sr_1_1?crid=3PUMFFKQW7EG6&keywords=getting+started+with+containerization&qid=1682772768&sprefix=getting+started+with+containerizatio%2Caps%2C318&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Production Kubernetes</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/singapore.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>Kubernetes has become the dominant container orchestrator, but manyorganizations that have recently adopted this system are stillstruggling to run actual production workloads. In this practicalbook, four software engineers from VMware bring their sharedexperiences running Kubernetes in production and provide insight onkey challenges and best practices. The brilliance of Kubernetes ishow configurable and extensible the system is, from pluggableruntimes to storage integrations. For platform engineers, softwaredevelopers, infosec, network engineers, storage engineers, andothers, this book examines how the path to success with Kubernetesinvolves a variety of technology, pattern, and abstractionconsiderations.</p><ahref="https://www.amazon.com/Production-Kubernetes-Successful-Application-Platforms/dp/B0C2JG8HN4/ref=sr_1_1?crid=2VL6HBN63YSKR&keywords=Production+Kubernetes&qid=1682772779&sprefix=production+kubernetes%2Caps%2C320&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Practical Vim</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/practical_vim.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>Vim is a fast and efficient text editor that will make you a fasterand more efficient developer. It's available on almost every OS,and if you master the techniques in this book, you will never needanother text editor. In more than 120 Vim tips, you will quicklylearn the editor's core functionality and tackle your trickiestediting and writing tasks. This beloved bestseller has been revisedand updated to Vim 8 and includes three brand-new tips and fivefully revised tips.</p><ahref="https://www.amazon.com/Practical-Vim-Edit-Speed-Thought/dp/1680501275/ref=sr_1_1?crid=37R58M1VK37ED&keywords=Practical+Vim&qid=1682772791&s=audible&sprefix=practical+vim%2Caudible%2C304&sr=1-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">CSS In Depth</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/css_in_depth.jpeg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>CSS in Depth exposes you to a world of CSS techniques that rangefrom clever to mind-blowing. This instantly useful book is packedwith creative examples and powerful best practices that will sharpenyour technical skills and inspire your sense of design.</p><ahref="https://www.amazon.com/CSS-Depth-Keith-J-Grant/dp/1617293458/ref=sr_1_1?crid=SRUEMD3CZ94C&keywords=CSS+In+Depth&qid=1682772805&sprefix=css+in+depth%2Caps%2C326&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Effective Typescript</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/effective_typescript.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>TypeScript is a typed superset of JavaScript with the potential tosolve many of the headaches for which JavaScript is famous. ButTypeScript has a learning curve of its own, and understanding how touse it effectively can take time. This book guides you through 62specific ways to improve your use of TypeScript</p><ahref="https://www.amazon.com/Effective-TypeScript-Specific-Ways-Improve/dp/1492053740/ref=sr_1_1?crid=1BPGNPZ1QMNOI&keywords=%22Effective+Typescript&qid=1682772816&sprefix=effective+typescript%2Caps%2C318&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Unix and Linux System Administration Handbook</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/unix_linux_admin.jpeg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>UNIX and Linux System Administration Handbook, Fifth Edition, istoday definitive guide to installing, configuring, and maintainingany UNIX or Linux system, including systems that supply coreInternet and cloud infrastructure. Updated for new distributions andcloud environments, this comprehensive guide covers best practicesfor every facet of system administration, including storagemanagement, network design and administration, security, webhosting, automation, configuration management, performance analysis,virtualization, DNS, security, and the management of IT serviceorganizations. The authors―world-class, hands-on technologists―offerindispensable new coverage of cloud platforms, the DevOpsphilosophy, continuous deployment, containerization, monitoring, andmany other essential topics.Whatever your role in running systemsand networks built on UNIX or Linux, this conversational,well-written ¿guide will improve your efficiency and help solve yourknottiest problems.</p><ahref="https://www.amazon.com/UNIX-Linux-System-Administration-Handbook/dp/0134277554/ref=sr_1_1?crid=1HWI8UE6KJ6PT&keywords=Unix+and+Linux+System+Administration+Handbook&qid=1682772831&sprefix=unix+and+linux+system+administration+handbook%2Caps%2C320&sr=8-1"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div><div class="md:flex gap-x-5 flex-row mb-8"><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Computer Organization and Design</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/computer_organization.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p>Computer Organization and Design, Fifth Edition, is the latestupdate to the classic introduction to computer organization. Thetext now contains new examples and material highlighting theemergence of mobile computing and the cloud. It explores thisgenerational change with updated content featuring tablet computers,cloud infrastructure, and the ARM (mobile computing devices) and x86(cloud computing) architectures. The book uses a MIPS processor coreto present the fundamentals of hardware technologies, assemblylanguage, computer arithmetic, pipelining, memory hierarchies andI/Because an understanding of modern hardware is essential toachieving good performance and energy efficiency, this edition addsa new concrete example, Going Faster, used throughout the text todemonstrate extremely effective optimization techniques. There isalso a new discussion of the Eight Great Ideas of computerarchitecture. Parallelism is examined in depth with examples andcontent highlighting parallel hardware and software topics. The bookfeatures the Intel Core i7, ARM Cortex A8 and NVIDIA Fermi GPU asreal world examples, along with a full set of updated and improvedexercises.</p><ahref="https://www.amazon.com/Computer-Organization-Design-RISC-V-Architecture/dp/0128203315/ref=sr_1_1?crid=2SWQJ2EPAWKZT&keywords=Computer+Organization+and+Design&qid=1682772842&sprefix=computer+organization+and+design%2Caps%2C329&sr=8-1&ufe=app_do%3Aamzn1.fos.006c50ae-5d4c-4777-9bc0-4513d670b6bc"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div><div class="ml-4 bg-white flex-auto w-full"><h4 class="font-bold mb-8">Database Systems The Complete Book</h4><div><imgsrc="https://d2cvlmmg8c0xrp.cloudfront.net/web-css/database_system.jpg"class="float-left h-auto w-64 mr-6"alt="book-image"/></div><p></p><p>Database Systems: The Complete Book is ideal for Database Systemsand Database Design and Application courses offered at the junior,senior and graduate levels in Computer Science departments. A basicunderstanding of algebraic expressions and laws, logic, basic datastructure, OOP concepts, and programming environments is implied.Written by well-known computer scientists, this introduction todatabase systems offers a comprehensive approach, focusing ondatabase design, database use, and implementation of databaseapplications and database management systems.</p><ahref="https://www.amazon.com/Database-Systems-Complete-Book-2nd/dp/0131873253/ref=sr_1_1?crid=3E1GPJPYRNH9Z&keywords=Database+Systems+The+Complete+Book&qid=1682772851&sprefix=database+systems+the+complete+book%2Caps%2C336&sr=8-1&ufe=app_do%3Aamzn1.fos.f5122f16-c3e8-4386-bf32-63e904010ad0"target="_blank"><buttonclass="bg-orange-300 px-14 py-3 rounded-md shadow-md hover:bg-orange-400">Amazon</button></a></div></div></div><footer class="bg-gray-200 mt-12 text-gray-00 py-4"><div class="mx-auto max-w-5xl text-center text-base">Copyright © 2023 entest, Inc</div></footer></body></html>
Install MariaDB#
Start MariabDB
sudo systemctl start mariadb
Stop MariaDB
sudo systemctl stop mariadb
Enable as a service when start the service
sudo systemctl enable mariadb
Since we install it locally, can access db by
sudo mysqlsudo mysql -h localhost -P 3306 -u root
Secure installation here
sudo mysql_secure_installation
Remote Access MariaDB#
Install a client, please follow here
# amazon linux 2023sudo dnf install mariadb105# amazon linux 2sudo yum install mariadb
Connect to mariadb
mysql -h localhost -P 3306 -u <mymasteruser> -p
For example
mysql -h localhost -P 3306 -u dev -p
Test
sudo mysql -h localhost -P 3306 -u root
MariaDB as Admin#
Access as root
sudo mysql
List all users
select user from mysql.user;
List databases and table
show databases;
Select a database
use mysql;
List schema
show schemas;
List table of a database
show tables;
Create a database
CREATE DATABASE IF NOT EXISTS demo;
Use the newly created db
use demo;
Create a book table
CREATE TABLE IF NOT EXISTS book (id int auto_increment primary key,author text,title text,amazon text,image text);
Insert data into book table
INSERT INTO book(author, title, amazon, image) VALUES ('Hai Tran', 'Deep Learning', '', 'hello.jpg');
MariaDB as User#
Create an user with password
CREATE USER IF NOT EXISTS 'dev'@'localhost' IDENTIFIED by 'Admin2024';GRANT ALL PRIVILEGES ON * . * TO 'dev'@'localhost';FLUSH PRIVILEGES;
Or granta access to only demo database
GRANT ALL PRIVILEGES on 'demo'.*to 'dev'@'localhost';
Remote connect
mysql -h localhost -P 3306 -u dev -p Admin2024;
PHP Dev#
Create a simple project
|--book.php|--hello.php|--template.php
Start php server at this directory (current)
php -S localhost:3000
Query MariaDB and present data
<body class="body"><div class="container"><?php$servername = "localhost";$username = "dev";$password = "Admin2024";$dbname = "demo";// Create connection$conn = new mysqli($servername, $username, $password, $dbname);// Check connectionif ($conn->connect_error) {die("Connection failed: " . $conn->connect_error);}$sql = "SELECT id, author, title, amazon, image FROM book";$result = $conn->query($sql);if ($result->num_rows > 0) {echo "<div class='grid'>";// output data of each rowwhile ($row = $result->fetch_assoc()) {echo "<div class='card'>". "<h4 class='title'>" .$row["title"] ."</h4>". "<h4 class='title'>" .$row["author"] ."</h4>". "<img src='https://d2cvlmmg8c0xrp.cloudfront.net/web-css/singapore.jpg' class='image' />". "<p>" . "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Officia officiis voluptates ab eum totam atque deleniti accusantium nulla illo provident et nesciunt, nisi laudantium iusto animi rem repudiandae, asperiores consequuntur Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque ipsam deserunt quaerat corrupti nihil error amet libero. Dignissimos, dolorem laudantium optio id, blanditiis eveniet repellendus pariatur neque facilis reprehenderit excepturi! Lorem ipsum dolor sit amet consectetur, adipisicing elit. Non repellendus, praesentium quasi quidem itaque numquam qui ex ducimus harum, perferendis officia deserunt libero magni assumenda mollitia aut ratione ipsam illo! Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime, corporis suscipit, natus odio nobis vel totam atque vitae porro animi in, cupiditate mollitia pariatur minus quos! Maiores assumenda explicabo expedita?" . "</p>". "</div>";}echo "</div>";} else {echo "0 results";}$conn->close();?><div></body>
The full page with style here
template.php
<html><head><style>:root {box-sizing: border-box;}*,::before,::after {box-sizing: inherit;}.body {background-color: antiquewhite;}.container {max-width: 800px;margin-left: auto;margin-right: auto;}.grid {display: grid;row-gap: 10px;column-gap: 10px;grid-template-columns: repeat(1, minmax(0, 1fr));}.card {margin-left: 4px;margin-right: 4px;padding: 0.5em;background-color: white;width: 100%;}@media (min-width: 800px) {.grid {grid-template-columns: repeat(2, minmax(0, 1fr));}}.image {float: left;height: auto;width: 128px;margin-right: 6px;}.title {font: bold;margin-bottom: 8px;}</style></head><body class="body"><div class="container"><?php$servername = "localhost";$username = "dev";$password = "Admin2024";$dbname = "demo";// Create connection$conn = new mysqli($servername, $username, $password, $dbname);// Check connectionif ($conn->connect_error) {die("Connection failed: " . $conn->connect_error);}$sql = "SELECT id, author, title, amazon, image FROM book";$result = $conn->query($sql);if ($result->num_rows > 0) {echo "<div class='grid'>";// output data of each rowwhile ($row = $result->fetch_assoc()) {echo "<div class='card'>". "<h4 class='title'>" .$row["title"] ."</h4>". "<h4 class='title'>" .$row["author"] ."</h4>". "<img src='https://d2cvlmmg8c0xrp.cloudfront.net/web-css/singapore.jpg' class='image' />". "<p>" . "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Officia officiis voluptates ab eum totam atque deleniti accusantium nulla illo provident et nesciunt, nisi laudantium iusto animi rem repudiandae, asperiores consequuntur Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque ipsam deserunt quaerat corrupti nihil error amet libero. Dignissimos, dolorem laudantium optio id, blanditiis eveniet repellendus pariatur neque facilis reprehenderit excepturi! Lorem ipsum dolor sit amet consectetur, adipisicing elit. Non repellendus, praesentium quasi quidem itaque numquam qui ex ducimus harum, perferendis officia deserunt libero magni assumenda mollitia aut ratione ipsam illo! Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime, corporis suscipit, natus odio nobis vel totam atque vitae porro animi in, cupiditate mollitia pariatur minus quos! Maiores assumenda explicabo expedita?" . "</p>". "</div>";}echo "</div>";} else {echo "0 results";}$conn->close();?><div></body></html>
PHP Upload#
- Form to upload file
- Save file to server
- Create a record in database
Let create a form for uploading files. It is just a simple form doing a POST request to ./handle-upload.php
<form enctype="multipart/form-data" action="./handle-upload.php" method="post"><input type="file" name="myFile" /><input type="submit" value="upload" /></form>
Here is the full detail
upload.php
<html><head><style>:root {box-sizing: border-box;}body {background-color: antiquewhite;}.container {max-width: 800px;margin-left: auto;margin-right: auto;}.input-upload {width: 350px;max-width: 100%;color: #444;padding: 5px;background: #fff;border-radius: 10px;border: 1px solid #555;}.input-upload::-webkit-file-upload-button {margin-right: 20px;border: none;background: #084cdf;padding: 10px 20px;border-radius: 10px;color: #fff;cursor: pointer;transition: background 0.2s ease-in-out;}.input-submit {background-color: #084cdf;color: white;border: none;padding: 10px 30px;border-radius: 10px;cursor: pointer;margin-top: 10px;}.drop-container {position: relative;display: flex;gap: 10px;flex-direction: column;justify-content: center;align-items: center;padding: 20px;height: 200px;border: 2px dashed #555;color: #444;cursor: pointer;transition: background 0.2s ease-in-out, border 0.2s ease-in-out;}.drop-container:hover {background: #eee;border-color: #111;}.drop-container:hover .drop-title {color: #222;}.drop-title {color: #444;font-size: 20px;font-weight: bold;text-align: center;transition: color 0.2s ease-in-out;}</style></head><body><div class="container"><div><form enctype="multipart/form-data" action="./handle-upload.php" method="post"><label for="file" class="drop-container" id="dropcontainer"><input type="file" class="input-upload" id="file" name="myFile"/></label><input type="submit" class="input-submit" /></form></div></div></body><script></script></html>
Let create a php file to handle to upload file. Let create the logic for parse the uploaded filename, save file to server, and create a record in database
$servername = "localhost";$username = "dev";$password = "Admin2024";$dbname = "demo";// Create connection$conn = new mysqli($servername, $username, $password, $dbname);// Check connectionif ($conn->connect_error) {die("Connection failed: " . $conn->connect_error);}// uploaded file name$filename = $_FILES['myFile']['name'];// save uploaded filemove_uploaded_file($_FILES['myFile']['tmp_name'], "./static/" . basename($filename));// create a record in database$sql = "INSERT INTO book(author, title, amazon, image) VALUES ('Hai Tran', 'Deep Learning', '', '$filename')";$result = $conn->query($sql);
Here is the full detail
handler-upload.php
<html><head><style>:root {box-sizing: border-box;}*,::before,::after {box-sizing: inherit;}.body {background-color: antiquewhite;}.container {max-width: 800px;margin-left: auto;margin-right: auto;}</style></head><body class="body"><div class="container"><?php$servername = "localhost";$username = "dev";$password = "Admin2024";$dbname = "demo";// Create connection$conn = new mysqli($servername, $username, $password, $dbname);// Check connectionif ($conn->connect_error) {die("Connection failed: " . $conn->connect_error);}// uploaded file name$filename = $_FILES['myFile']['name'];// save uploaded filemove_uploaded_file($_FILES['myFile']['tmp_name'], "./static/" . basename($filename));// create a record in database$sql = "INSERT INTO book(author, title, amazon, image) VALUES ('Hai Tran', 'Deep Learning', '', '$filename')";$result = $conn->query($sql);// response to browserecho "<h1> Sucessfully upload file $filename </h1>"?></div></body></html>
Basic MySQL#
Let update a row
UPDATE bookSET image = "golang-idiomatic.jpg"WHERE id = 2;
Insert a row
INSERT INTO book(author, title, amazon, image)VALUES ('Hai Tran', 'Deep Learning', '', 'hello.jpg');
Delete a row
DELETE FROM bookWHERE id = 1;
Setup Nginx#
This section shows how to setup nginx to serve static files without running the apache web server. Here is structure of /etc/nginx/.
|--conf.d|--entest.conf|--php-fpm.conf|--default.d|--php.conf|--nginx.conf
/etc/nginx/nginx.conf file is the default configuration entry point used by the NGINX service.
/etc/nginx/conf.d/ directory contains the default HTTP server configuration file. Files in this directory ending with .conf are included in the top-level http block from within /etc/nginx/nginx.conf file. Here is content of entest.conf.
server {listen 80;listen [::]:80;server_name nginx.entest.io;root /var/www/html/;index info.php;access_log /var/log/nginx/entest.io.access.log;error_log /var/log/nginx/entest.io.error.log;location ~ \.php$ {try_files $uri =404;fastcgi_pass unix:/run/php-fpm/www.sock;# fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;include fastcgi_params;}location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {expires max;log_not_found off;}}
It is possible to setup a local domain by editing /etc/hosts.
127.0.0.1 localhost nginx.entest.io
Here is some command for troubleshooting.
sudo fuser -k 80/tcpsudo fuser -k 443/tcpsudo service nginx restart