라벨이 Nginx Server Setup인 게시물 표시

[7] Nging Server Setup - Building a Text Detection API using Drogon Server with OpenCV

이미지
Setting up text detection in RHEL and integrating it with a Drogon server to develop functionality that extracts text information as an API and displays it to clients. Note: The purpose is Text Detection, not OCR (Optical Character Recognition). OCR will be integrated later. --- ## 0. Search for Text Detection Frameworks | Framework | Language | Pros | Cons | |---------------------|-----------------|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------| | Tesseract OCR | C++ (Python, etc.) | Open source, supports multiple languages, customizable | Can have degraded performance without preprocessing, requires integration wit...

[6] Nginx Server Setup - Implementing Upload/Download + Simple Upload Client

이미지
With directory listing set up, let's implement file upload/download functionality using Drogon. --- ## 1. Server Function Implementation ### 1-1. Implementing Drogon Controller Register the Drogon Controller. (This step is required for it to be recognized during the build.) ``` cd /root/drogon2/drogon/build/drogon_ctl drogon_ctl create controller FileController ``` --- ### 1-2. Implement Upload/Download Functionality Source path: `/root/drogon2/drogon/build/drogon_ctl/testAPI/controllers` FileController.h #pragma once #include using namespace drogon; class FileController : public HttpController { public: std::string _storagePath = "/root/storage/"; METHOD_LIST_BEGIN // Handles POST requests for "/upload" ADD_METHOD_TO(FileController::handleUpload, "/upload", Post); // Handles GET requests for "/download/{filename}" ADD_METHOD_TO(FileController::handleDownload, "/download/{1}...

[5] Nginx Server Setup - Folder Listing on Web

이미지
Before implementing file upload/download functionality, let's first create a local storage directory and make it accessible via the web. --- ## 1. Create Storage and Set Permissions - Create storage directory ``` mkdir /root/storage cd /root/storage vi test.txt # Add any content, save, and exit ``` - Grant permissions to the directory for the user running NGINX ``` ps aux | grep nginx ``` --- For example, if the NGINX process runs as "nobody", change the folder's ownership: ``` [root@vbox build] (master) $ ps aux | grep nginx root 52636 0.0 0.0 4544 2412 ? Ss 01:26 0:00 nginx: master process ./nginx root 59772 0.0 0.1 13064 9600 pts/1 T 06:04 0:00 /usr/bin/vim nginx.conf nobody 60676 0.0 0.0 13168 5484 ? S 06:23 0:00 nginx: worker process nobody 60677 0.0 0.0 13168 5612 ? S 06:23 0:00 nginx: worker process ``` --- - Change permissions and ownership sudo chmod -...

[4] Nginx Server Setup - Writing a Drogon Test API

이미지
Let's create an API using Drogon to return specific values as a test. --- ## 1. Setting up the Drogon Test Project - Run the following command in the directory where `drogon_ctl` is installed: ``` drogon_ctl create project testAPI cd testAPI ``` --- ## 2. Build - The full path will be /root/drogon2/drogon/build/drogon_ctl/testAPI/build ``` mkdir build cd build cmake .. make ``` --- If the following error occurs, it’s best to set the environment variable and reinstall Drogon: ``` CMake Error at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package): By not providing "FindJsoncpp.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Jsoncpp", but CMake did not find one. Could not find a package configuration file provided by "Jsoncpp" with any of the following names: JsoncppConfig.cmake jsoncpp-config.cmake Add the installation ...

[3] Nginx Server Setup - Connecting to C++ Web Framework

이미지
## 0. Researching C++ Web Frameworks To achieve the goal of building a server in C++, I've started by researching suitable C++ web frameworks. According to GPT recommendations, **Drogon** is popular, so I'll proceed with this framework first. --- | Framework | Advantages | Disadvantages | |------------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------| | **Drogon** | Supports modern C++14/17 standards Asynchronous programming and multi-thread support Supports HTTP2 and WebSocket High performance and user-friendly API Active community and support | Initial setup can be complex due to many features | | **Pistache** | Lightweight design enables quick web server implementation Suitable for RESTful API development Simple code an...

[2] Nginx Server Setup - Downloading and Setting Up a Specific Version of Nginx

이미지
Instead of installing Nginx directly to the system path, this guide explains how to download, build, and set up Nginx manually. --- ## Setup Environment - Red Hat Enterprise Linux release 9.4 (Plow) ## 1. Download and Extract Nginx To download and extract Nginx: ``` wget http://nginx.org/download/nginx-1.21.6.tar.gz tar -xvf nginx-1.21.6.tar.gz ``` To download a different version, simply change the version number in the command and proceed with the steps as outlined. --- ## 2. Install Required Libraries Install essential libraries: ``` sudo yum install -y gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel ``` ``` Explanation of each library: - gcc: The C compiler required to compile Nginx source code into an executable. - pcre: Provides regular expression handling for Nginx. - pcre-devel: Contains development headers needed when compiling Nginx. - zlib: Enables gzip compression in Nginx. - zlib-devel: Provides zlibs development files needed for compiling. - openssl: N...

[1] Nginx Server Setup - VirtualBox Installation and Putty Connection

이미지
# How to Set Up a Linux Virtual Environment for Testing Using VirtualBox on Windows 10 Setting up a Linux virtual environment can be helpful for testing purposes. This guide walks you through setting up a virtual machine on Windows 10 using VirtualBox. --- ## 1. VirtualBox Download To begin, download VirtualBox. - Go to [VirtualBox Downloads](https://www.virtualbox.org/wiki/Downloads). - Download the installer for your OS (choose "Windows hosts" for Windows 10). --- After downloading, proceed with the installation by following the prompts. --- ## 2. RHEL (Red Hat Enterprise Linux) OS Download Since CentOS reached its End of Life (EOL), it's recommended to use RHEL. - Visit [RHEL Downloads](https://developers.redhat.com/products/rhel/download) (version 9.4 as of 2024.11.02). - To use RHEL for free, register for an Individual Developer Subscription. There is no cost for registration. --- ## 3. VirtualBox - Setting Up a RHEL Virtual Machine 1. **Create...

이 블로그의 인기 게시물

윤석열 계엄령 선포! 방산주 대폭발? 관련주 투자 전략 완벽 분석

대통령 퇴진운동 관련주: 방송·통신·촛불수혜주 완벽 분석

키움 OPEN API MFC 개발 (1)