All posts by Don Matteo

lebt in der Schweiz, ist System Engineer MCP bei A-Enterprise GmbH. Mitglied des UNBLOG Knowledge Network. Author und Blogger zu den Themen, Tutorials für Linux und Open Source.

Change WordPress URL

Change website URL and links in wordpress database

WordPress conversions and migration require several steps to customize the URL. Setting the WordPress address is in a new installation, under Settings General for WordPress address (URL) and web page address (URL). Further changes are required for migration and URL changes.

Modify WordPress-Aaddress URL using phpMyAdmin

During migration, access to the WP-Admin may be blocked, after that has already been changed the A Record or CNAME in DNS, also the virtual host configuration on the Web server. The URL also needs to be changed when switching the page from Dev to Live. At this point, the website address and the links in the content can be changed with phpMyAdmin.

Change WordPress address (URL) and website address (URL) to phpMyAdmin

To change the WordPress address and website address in phpMyAdmin, you open the database and go to View, in the now opened tree you select the table wp_options, on the left search for siteurl and home in the column option_name, here Edit and modify the value in the field option_value with the new URL and click OK to confirm.

Illustration: phpMyAdmin

Note: The WordPress default database prefix is wp_, at this point where the prefix was previously changed to wp_futbg5.

If you want to search the database for text, go to Search after opening the database and enter the search argument integrated between % characters. In this case, the developer environment should be made the live page, where dev.artemis.org the developer is URL, and www.artemis.org the live URL of the page.

phpMyAdmin Browsing the Database

In the table(s) click on Select All, followed by OK. As a rule, the hits in the tables are wp_posts and wp_postmeta to be found in the field post_content.

In phpMyAdmin the URL can change by using the following SQL command to Find Replace the tables.

UPDATE wp_posts
SET guid =REPLACE(
    Guid
    "dev.artemis.org,"
    "www.artemis.org"
);

UPDATE wp_posts
SET post_content = REPLACE(
    post_content,
    "dev.artemis.org,"
    "www.artemis.org"
);

UPDATE wp_postmeta
SET meta_value = REPLACE(
    meta_value,
    "dev.artemis.org,"
    "www.artemis.org"
);

UPDATE wp_links
SET link_url = REPLACE(
    link_url,
    "dev.artemis.org,"
    "www.artemis.org"
);

If plugins are used that contain tables with URLs, the content must be changed here.

UPDATE table name
SET field_with_url = REPLACE(
    field_with_url,
    "dev.artemis.org,"
    "www.artemis.org"
);

Instead of the placeholder table name and field_with_url enter the actual table name, the relevant plugins with the tables can be found with text search in phpMyAdmin as described above.

How to install Kali Linux on Windows

Install Kali Linux Desktop on Windows with WSL2

Linux in Windows 10 and 11 with Kali Linux Desktop – Win-KeX (“Windows Kali Desktop EXperience”), starting with feature update 2004 there is an XFCE GUI on the Windows desktop.

Win-KeX provides a Kali Desktop Experience for Windows Subsystem for Linux (WSL 2) with the features that support two dedicated modes.

Win-KeX window mode kex –win is the classic appearance in a window for the Kali Linux desktop.

Win-KeX SL mode kex –sl provides the seamless integration of Kali Linux into the Windows desktop with the Windows Start menu below and the Kali panel at the top of the screen. All applications start in their own windows that use the same desktop as Windows applications.

Win-KeX Features

Win-KeX SL Seamless
Sound support
Support multiple sessions
Run Win-KeX as root
Shared clipboard cut and paste content between Kali and Windows Apps

Install Kali Linux on Windows

To install Kali Linux on Windows, Open PowerShell as administrator and run the command bellow.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Restart the computer now.

Back after reboot run the commands from PowerShell as administrator.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft Windows subsystem Linux /all /norestart

Restart the computer again.

Then download Windows Subsystem for Linux 2 (WSL 2) and run the Update Setup Wizard. Download the latest package here and choose WSL2 Linux kernel update package for x64 machine.

Run the next command from the PowerShell as administrator.

wsl --set-default-version 2

Install Kali Linux from the Microsoft Store.

Kali Linux is a Debian-based Linux distribution that mainly includes penetration testing and digital forensics. Kali Linux is primarily aimed at professional and advanced users.

Now complete the initial setup and launch Kali Linux.

Debian is also available from Microsoft Store.

Debian for Windows Subsystem for Linux

Install Win-KeX

Win-KeX from the terminal as follows.

sudo apt update && sudo apt install -y kali-win-kex

Start Win-KeX

Win-KeX can be run in window mode or Seamless mode. Win-KeX in window mode as follows.

kex --win

Start Win-KeX in Seamless – Sameless mode.

kex --sl

Win-KeX Start Examples

kex - Desktop full screen
kex --win - Desktop Window
kex --sl - Desktop Seamless Mode
kex --sl -s - Desktop Seamless Mode with Sound
kex --sl --wtstart - KeX server and win-kex client in terminal
kex --esm - KeX desktop in native RDP windows

Prerequisite for Win-KeX

The Visual C++ Redistributable packages are required to run Win-KeX, if not already installed, the packages can be downloaded here. Install the Universal C Runtime x86 (vc_redist.x86.exe) and x64 (vc_redist.x64.exe). Kali Linux requires Windows 10 version 2004 or later, and the Windows subsystem for Linux – WSL 2.

To use Win-KeX, a computer with Intel virtualization function VT-x is required. The BIOS provides the operating system with the virtualization function, for which you activate the Intel (R) Virtualization Technology in the UEFI BIOS settings.

Linux Shell in Windows Terminal

Also now is a good time to mention the Windows Terminal, if not already installed, it is worth doing it now.

Windows Terminal can be installed from the Windows Store.

Windows Terminal is a multi-tabbed command-line frontend for Windows 10. The shell of Kali Linux – ZSH can be used with Windows Terminal.

Kali Linux Sources Link kali.org

Troubleshooting

If VcXsrv is trying to start Win-KeX in Seamless Mode, an error is issued by VcXsrv:

A fatal error has occurred and VcXsrv will now exit.

A fatal error has occurred and VcXsrv will now exit.

In the log, it’s the last lines in /tmp/win kexsl_user.log:

winMultiWindowXMsgProc - Fatal error 1 on xcb connection
winClipboardIOErrorHandler!
winClipboardProc - setjmp returned for IO Error Handler.
(II) Server terminated successfully (0). Closing log file.

here you can try to start Win-KeX with sudo:

sudo kex --sl --wtstart -s

A solution also brought the deletion of the logs under /tmp.

sudo rm -f /tmp/*.log

And stop the KeX server with the –stop and –kill option.

sudo kex --stop
sudo kex --kill

After that, the start of kex as a normal user became possible.

kex --sl --wtstart -s

Also, a Win-KeX reinstallation can fix the error:

sudo kex --stop
sudo kex --kill
sudo apt-get purge kali-win-kex
sudo apt-get install kali-win-kex
sudo apt-get install dbus-x11

The Win-KeX help can also be useful.

kex --help

        Win-Kex 2.10 provides a GUI desktop experience for Kali Linux
        in Windows Subsystem for Linux 2 (WSL 2)

        Usage:
                kex <mode> <command> <parameters>

                Mode:
                --esm            : Launch KeX desktop in a dedicated window using Windows native RDP
                --sl             : Seemlessly integrate KeX into the Windows desktop
                --win            : Launch KeX desktop in a dedicated window

                Command:
                [none]           : start KeX server and launch KeX client
                --start          : start kex server
                --start-client   : start kex client
                --stop           : stop kex server
                --status         : show kex server status
                --kill           : stop kex server and kill all related processes
                --passwd         : set kex server password
                --wtstart        : start kex server and launch win-kex client
                                   in Windows Terminal session
                --start-sound    : start Windows sound server
                --stop-sound     : stop Windows sound server
                --help           : display help
                --version        : display version

                Parameters:
                -i               : Use container IP address instead of "localhost"
                -m               : Optimized for Multiscreen (Win mode only)
                -s               : Sound support


        Examples:
                kex -s           : Start KeX server in window mode and launch KeX client with sound support
                kex --sl -s      : Start KeX in seemless mode and launch KeX client with sound support
                kex --esm -i -s  : Start KeX in ESM mode with arm workaround and launch KeX client with sound support
                sudo kex         : Start KeX server as root in window mode and launch KeX client