[go: up one dir, main page]

Menu

Home

Saumitra Kumar Paul

What is Orion?

Orion is a full-featured local development server stack for Windows, designed for developers who need speed, flexibility, and simplicity. It includes:

  • Web Servers: NGINX (default) and Apache (optional)
  • Databases: MariaDB (default) and MySQL (optional)
  • PHP: 8.4.12 NTS with FastCGI support
  • Debugging: XDebug pre-configured for seamless IDE integration
  • Database GUI: HeidiSQL v12.11

Everything is bundled together with a single Controller.bat, making starting, stopping, and switching components effortless.


Installation

  • Get the latest Orion zip file from SourceForge.
  • Extract it to a folder, e.g., D:\Orion.

By default, Orion uses D:\Orion directory.


Directory Structure

Make sure the extracted folder has this structure:

Orion/
├── apache/
├── nginx/
├── php/
├── mysql/
├── mariadb/
├── www/           # Your web projects
├── logs/          # Logs folder for Apache/NGINX
├── start.bat      # Script to start Orion
└── readme.txt

Ports Check

Orion uses the following port by default -

  • 80 - NGINX/Apache,
  • 3306 - MariaDB/MySQL and
  • 8412 - for PHP FastCGI.

So, ensure ports 80, 3306, and 8412 are free.

But you can customize the ports. You may update nginx.conf, httpd.conf, or php.ini to use different ports.

Starting Orion

Double click Controller.bat to start the services.

Orion – Component Versions

- Apache: 2.4.65 (Win64)
- NGINX: 1.28.0
- MySQL: 8.4
- MariaDB: 11.8
- PHP: 8.4.12 NTS
- HeidiSQL: v12.11

Default Orion Stack Configuration:

- Web Server: NGINX (Port 80)
- Database: MariaDB  (Port 3306)
- PHP Version: 8.4.12 NTS (FastCGI)  (Port 8412)
- Apache, MySQL, HeidiSQL available as optional components

Web Server Choice (NGINX vs Apache)

Edit Controller.bat with Notepad:

:: --- Start Nginx ---
echo Starting Nginx...
start /b "Nginx" cmd /c "cd /d %BASEDIR%nginx && nginx.exe"
echo Nginx started.
echo.

:: --- Start Apache ---
:: echo Starting Apache...
:: start /b "Apache" cmd /c "cd /d %BASEDIR%apache\bin && httpd.exe"
:: echo Apache started.
:: echo.

By default, NGINX is started.
If you want Apache as the main server, you can:
- Comment out the NGINX lines (:: before every line).
- Uncomment Apache lines (remove ::).

Option to run both:
- Uncomment Apache lines but change Apaches port in httpd.conf to avoid conflict with NGINX on port 80 (e.g., use 8080).

Database Choice (MariaDB vs MySQL)

Edit Controller.bat with Notepad:

:: --- Start MariaDB ---
echo Starting MariaDB...
start /b "MariaDB" cmd /c "cd /d %BASEDIR%mariadb\mariadb-11.8\bin && mysqld --defaults-file=%BASEDIR%mariadb\mariadb-11.8\my.ini"
echo MariaDB started.
echo.

:: --- Start MySQL ---
:: echo Starting MySQL...
:: start /b "MySQL" cmd /c "cd /d %BASEDIR%mysql\mysql-8.4\bin && mysqld --defaults-file=%BASEDIR%mysql\mysql-8.4\my.ini"
:: echo MySQL started.
:: echo.

By default, MariaDB is started.
To use MySQL instead of MariaDB, comment out MariaDB lines and uncomment MySQL lines.

Important:

Ensure MariaDB and MySQL do not run on the same port simultaneously (default port 3306).

If you want both running, change one of their ports in their my.ini files (e.g., MySQL  3307).

PHP FastCGI

:: --- Start PHP FastCGI ---
start /b "PHP" cmd /c "%BASEDIR%php\php-8.4.12\php-cgi.exe -b 127.0.0.1:8412 -c %BASEDIR%php\php-8.4.12\php.ini"

PHP is always started.
It communicates with NGINX or Apache via FastCGI (port 8412).

Web Root Configuration

Default Web Root is D:/Orion/www for both NGINX and Apache.

You can set the web root to any folder on your system.

Changing web root for NGINX-

  • Open Orion\nginx\conf\sites-available\default.conf and modify the root directive:
  • You'll see root D:/Orion/www; on the 5th line.
  • Modify as per your requirement i.e. root C:/MyProjects;

Changing web root for Apache-

  • Open \Orion\apache\conf\httpd.conf
  • Go to the line 229. You'll see -
DocumentRoot "D:/Orion/www"
<Directory "D:/Orion/www">
            Options Indexes FollowSymLinks ExecCGI
            AllowOverride All
           Require all granted
           AddHandler fcgid-script .php
</Directory>

Modify the path as you want.

But, you should keep the path same for NGINX and Apache, if you want to swtich the path frequently.

PHP Debugging with XDebug

## XDebug Configuration
    - XDebug is pre-enabled in php.ini.
    - FastCGI port for PHP: 8412

## Setting Up Your IDE
    - VSCode, PHPStorm, or any IDE that supports XDebug can be used.
    - Configure the IDE to listen on port 9003 (XDebug default).
    - Place breakpoints in your PHP code.

## VSCode Debugging Configuration
    A sample launch.json file is already provided in your web root: www\.vscode\launch.json
    This allows you to quickly start PHP debugging with XDebug in VSCode.

Adding a New Site in Nginx

  1. Create the site’s web root
    Inside Orion’s www folder, make a directory for your project:
    /www/mysite
    Add your files here (index.php, index.html, etc.).

  2. Create a site config

    • Go to: /nginx/sites-available/
    • Create a file called mysite.test.conf:
  3. Paste the following content -
    server {
    listen 80;
    server_name mysite.test;

        root D:/Orion/www/mysite;
        index index.php index.html;
    
        access_log logs/mysite.access.log;
        error_log  logs/mysite.error.log;
    
        location ~ /\.(?!well-known) {
                deny all;
                access_log off;
                log_not_found off;
        }
    
        location ~* \.(env|git|sql|bak|ini)$ {
                deny all;
                access_log off;
                log_not_found off;
        }
    
        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
                expires 1y;
                add_header Cache-Control "public, immutable";
                access_log off;
        }
    
        location ~ \.php$ {
                include fastcgi.conf;
                fastcgi_pass 127.0.0.1:8412;
                fastcgi_index index.php;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_buffers 16 16k;
                fastcgi_buffer_size 32k;
        }
    
        error_page 404 /index.php;
    

    }

  4. Enable the site -
    From sites-available → copy into sites-enabled:

  5. Update hosts file
    - Tell Windows where to find mysite.test:
    - Open C:\Windows\System32\drivers\etc\hosts in a text editor (as Admin), and add:
    127.0.0.1 mysite.test

  6. Reload Nginx

    • Restart Orion (or just Nginx):