Publish Web Server in Ubuntu Linux

Estimated reading: 2 minutes 65 views

1. Install Web Server and Start Services on Ubuntu (Skip if not needed)

If you do not yet have or have not activated a web server, please follow these instructions to install and run a web server.

sudo apt update
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql

sudo systemctl enable apache2
sudo systemctl start apache2

sudo systemctl enable mysql
sudo systemctl start mysql

Access Your Website Locally: http://localhost

*Make sure you are able to access your web server locally

2. Modify Port Selection

  • Select the TCP/UDP Port menu.
  • In the TCP/UDP Port  list, click Action then click View.

  • Select the Port Selection tab, then click the pencil icon to adjust the port.
  • Set the local port to match the local port on the PC/server device. In this case, the web server uses port 80 by default. Then click Save.

3. Connecting VPN Account

We recommend using WireGuard on Ubuntu to connect to your VPN account:

  • Install WireGuard using this link.
  • WireGuard Installation Guide for Linux
  • Select Linux Wireguard tab then click copy icon to copy wireguard config.
  • WireGuard configuration example
  • Create a WireGuard config file:
  • sudo nano /etc/wireguard/wg0.conf

    Paste your copied configuration inside this file, then press Ctrl + O to save and Ctrl + X to exit.

    WireGuard configuration example
    • Start the VPN connection and enable auto start:
    sudo wg-quick up wg0 && sudo systemctl enable wg-quick@wg0

4. Access Web Server using Public IP and Port

  • Find Port Access in Overview Tab (example Port Access is cetus.s-net.id:7984) click copy icon to Port Access
  • Open browser then paste Port Access to open web.

Leave a Comment

Share this Doc

Publish Web Server in Ubuntu Linux

Or copy link

CONTENTS