Monday, June 22, 2020

[Solved] Fixing Apache suexec and mod_fcgid: Error Reading Data from FastCGI Server

When running PHP applications under Apache using mod_fcgid combined with suexec privilege separation, web requests may suddenly abort with HTTP 500 Internal Server Errors and the following message in Apache error logs:

Error Message: End of script output before headers: php.fcgi • mod_fcgid: error reading data from FastCGI server

Root Cause

suexec enforces strict security checks on the FastCGI wrapper script and user directory:

  1. The wrapper script and parent directories must be owned exclusively by the virtual server user and group—not root or apache.
  2. File permissions cannot be group-writeable (chmod 755 is required, 775 or 777 causes instant suexec rejection).
  3. The target script must reside strictly inside the compiled suexec document root (e.g. /home/user/public_html).

Resolution Steps

Inspect /var/log/httpd/suexec.log to reveal the exact permission violation, and enforce correct ownership:

# Fix permissions and ownership
chown -R user:user /home/user/fcgi-bin /home/user/public_html
chmod 755 /home/user/fcgi-bin/php.fcgi
chmod 755 /home/user/public_html

Wednesday, June 3, 2020

How to Install Virtualmin with Multiple PHP and MySQL Versions on CentOS 8

Deploying a production web hosting stack on CentOS 8 with Virtualmin requires modern multi-PHP support (allowing legacy applications to run PHP 5.6 or 7.2 while modern apps run PHP 7.4 or 8.0) and reliable database server management via Remi repositories.

Stack: CentOS 8 • Virtualmin 6.x • Remi Software Collections (SCL) • MySQL 8.0 • Multi-PHP

1. Fix Perl UTF-8 Locale Warnings

cat << 'EOF' > /etc/environment
LANGUAGE=en_US.utf8
LC_ALL=en_US.utf-8
LANG=en_US.utf8
LC_TYPE=en_US.utf8
EOF

2. Enable EPEL and Remi Repositories

dnf install epel-release -y
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
dnf module reset php -y
dnf module enable php:remi-7.4 -y

3. Installing Parallel PHP Versions

dnf install php56-php-fpm php72-php-fpm php74-php-fpm php80-php-fpm -y

4. Install Virtualmin

wget http://software.virtualmin.com/gpl/scripts/install.sh
sh install.sh

Friday, May 29, 2020

How to Forward Public IP Traffic to a WireGuard Client Behind NAT While Preserving Client IPs

When exposing a local server located behind a residential CGNAT (Carrier-Grade NAT) to the public internet using a cloud VPS as a front-end gateway, standard DNAT/MASQUERADE setups rewrite incoming packets with the WireGuard gateway's internal IP. This destroys client IP visibility, making rate-limiting, geo-blocking, and security auditing impossible. Here is how to configure policy-based routing and iptables PREROUTING to preserve the original client IP all the way to your backend application.

Architecture: Public Client (IP: X) → Cloud VPS (Public IP: Y) → WireGuard Tunnel → Home Server Behind NAT (Sees Real Client IP: X)

1. Cloud VPS Gateway Configuration

On the cloud VPS, forward external ports directly through the WireGuard interface (wg0) without applying SNAT/MASQUERADE to the incoming packets:

# Enable IP forwarding
sysctl -w net.ipv4.ip_forward=1

# Forward HTTP port 80 to WireGuard client (10.200.200.2)
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.200.200.2:80
iptables -A FORWARD -p tcp -d 10.200.200.2 --dport 80 -j ACCEPT

2. Home Server Policy Routing (The Secret to Preserving IPs)

Because the incoming packet preserves the public client IP, the home server's reply would normally route through its default residential gateway rather than returning via the WireGuard tunnel (causing asymmetric routing drop). Resolve this using Linux policy routing:

# 1. Create a custom routing table
echo "200 custom_vpn" >> /etc/iproute2/rt_tables

# 2. Route responses to traffic arriving on wg0 back through wg0
ip rule add from 10.200.200.2 table custom_vpn
ip route add default via 10.200.200.1 dev wg0 table custom_vpn

Now your backend web application logs the true public client IP address for every visitor!

Thursday, April 16, 2020

How to Access Native SIP / VoIP Account Settings Across Different Android Versions

Many Android releases include a built-in native SIP client directly integrated into the system Dialer application, allowing users to make and receive VoIP calls over Wi-Fi and mobile data without installing third-party battery-draining apps. However, OEM custom skins (Samsung, Huawei, Asus, Xiaomi) frequently relocate the configuration menu.

Native SIP Client Path Reference by Android OS Version
  • Android 4.2.2 (Jelly Bean):
    Dialer App → Menu → Settings → Internet Call → Accounts
  • Android 5.0 / 5.1 (Lollipop):
    Phone App → Settings → Call Settings → Phone Account Settings → SIP Accounts
  • Android 6.0 (Marshmallow) & 7.0 (Nougat):
    Phone App → Three Dots Menu → Settings → Calling Accounts → SIP Accounts
  • Android 8.0 (Oreo) through Android 11:
    Phone App → Settings → Calls → Calling Accounts → SIP Accounts → Add (+)

Note: In Android 12 and newer, Google deprecated the legacy built-in SIP stack. For modern Android releases, standard standalone clients like Linphone, Grandstream Wave, or MizuDroid are recommended.

Wednesday, April 15, 2020

How to Configure VoIP SIP Settings on GreenPacket DT-350 4G Routers

The GreenPacket DT-350 TD-LTE indoor router includes an integrated hardware VoIP FXS port (RJ-11) for connecting analog telephone handsets directly to SIP servers (such as Asterisk, FreePBX, or telecom IMS gateways). However, on many telecom-branded firmwares (such as Irancell), the VoIP menu is hidden from standard administrative accounts.

Hardware: GreenPacket DT-350 TD-LTE Router • RJ-11 POTS Handset • SIP Protocol

1. Accessing Hidden VoIP Menus

Log in with the root/operator credentials (or inspect the web GUI source to reveal hidden navigation items under /voip_settings.html or /sip.html).

2. SIP Account Configuration

SIP Proxy / Registrar: YOUR.PBX.SERVER.IP
Port: 5060
SIP Transport: UDP
Outbound Proxy: (Optional, set if behind telecom NAT)
Account / Display Name: 101
Authentication Username: 101
Secret / Password: YOUR_SIP_SECRET
Codec Priority: G.711u (PCMU), G.711a (PCMA), G.729

Save and apply settings. Once registered, the Phone LED on the router faceplate illuminates solid green, and connected analog handsets will receive dial tone.

Sunday, March 29, 2020

Fixing Lantronix Spider KVM Java Security Errors: Using the Native Standalone Client

When accessing remote datacenter servers via Lantronix Spider KVM-over-IP devices, modern Java Runtime Environments (Java 7, 8, and newer) block the JNLP applet with strict security exceptions like "unsigned application requesting unrestricted access to system". Adjusting Java deployment security rules and exception lists frequently fails.

Solution: Replace browser-based Java Web Start with Lantronix's official SpiderControl native standalone client.

Direct Native Client Download

Lantronix provides native standalone binaries that connect directly to the Spider KVM without requiring Java or browser plugins:

  • Download the official SpiderControl standalone application for Windows, Linux, or macOS from Lantronix support.
  • Launch the client, enter the Spider's IP address, username, and password.
  • The native client supports virtual media mounting (ISO redirection), low-latency mouse synchronization, and native resolution scaling without certificate validation errors.

Sunday, March 1, 2020

How to Install XFCE Desktop and RealVNC Server on CentOS 7

XFCE is a lightweight, responsive desktop environment ideal for remote graphical management on headless CentOS 7 servers without consuming excessive RAM. However, launching an XFCE session inside RealVNC Server (vncserver-virtual) on CentOS 7 often fails or displays a blank screen because default Xsession startup scripts target GNOME.

Environment: CentOS 7 • XFCE Desktop • RealVNC Server

1. Installing XFCE and RealVNC

yum groupinstall "Xfce" -y
yum install tigervnc-server -y # Or install RealVNC Server RPM

2. Configuring the VNC Virtual Session (/etc/vnc/xstartup.custom)

To ensure RealVNC launches the XFCE desktop environment properly, create or edit /etc/vnc/xstartup.custom:

#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
startxfce4 &

Make the script executable and launch the VNC virtual display:

chmod +x /etc/vnc/xstartup.custom
vncserver-virtual :1

How Google Antigravity Solved the Mysterious NVIDIA Sleep Reboot on My Dell Inspiron 7567 (Ubuntu Linux)

If you run modern Ubuntu or Linux on a Dell Inspiron 15 Gaming (7567) or a similar 7th-gen Intel laptop paired with an NVIDIA GeForce GTX ...