Free Web Server Webmin

Welcome to the World of Webmasters
Free Web server made with free OS and software. Free Web server requirements.

1. Obtain your own domain. A Google search will help you find a domain registry near you. Don’t forget to check the global IP and configure DNS. “webmin system hostname” = “domain name” = “computername”. If you break down “domain name” and explain it, it becomes = “user name.domain”. This combination is called a domain name. It’s difficult, but if you consider that “users” are borrowed from “domain” organizations around the world, you should be able to understand it somehow.

Domain type
The rightmost domain name separated by “.” . TLD is called the top-level domain (TLD).

Broadly speaking, there are two types of TLDs: gTLDs (generic TLDs) for specific uses and fields, and ccTLDs (country code TLDs) for countries and regions.

New gTLDs refer to domains newly created after 2012, and are characterized by the fact that many of them have specific meanings.

・ gTLD (top level domain by field)

Domain/Usage/Features
“.com”: Domains for commercial services and businesses
“.net”: Domain for network-related services
“.biz”: Domains for businesses and corporations
“.info”: Domain for disseminating information and word of mouth
“.org”: Domain for organizations and nonprofits

・ New gTLD (new domain)
Among gTLDs, domains newly created after 2012 are called new gTLDs. Since this domain is a latecomer, it may be possible to register character strings that are difficult to obtain with .com, .net, etc.

Domain/Usage/Features
“.site”: Domain suitable for all websites
“.blog”: domain meaning blog
“.cloud”: Domain meaning cloud
“.app”: Domain for applications and games

・ ccTLD (Country Code Top Level Domain)
Domains are assigned to countries or regions, and may require a person or entity to be a resident of a particular region to register. Some ccTLDs, like gTLDs, have no registration requirements and can be obtained by anyone.

Domain/Usage/Features
“.jp”: Domain meaning Japan
“.us”: domain meaning America
“.id”: domain meaning Indonesia
“.tv”: domain meaning Tuvalu
“.co”: Domain meaning Colombia
…..etc.

Domain registries have different annual renewal fees. If you believe that only the popular domain “.com” exists in the world, even if the registration fee is low, there will be a high renewal fee every year from the second year onwards. If you are considering long-term domain operation, it is more advantageous to set up a free home server than to use a paid rental server.

2. Fixed Global IP Address. Provider confirmation.

3. Computer. Any motherboard can be used for the server computer, but for maintenance purposes, I recommend a full tower case with many 5-inch bays, and a 3.5-inch hard disk with high cost performance.

Fragile parts of a computer
・ HDD
・ motherboard
・ power supply
・ graphic board

4. The only OS that Webmin can run on is Free OS LINUX. Red Hat Enterprise Linux, Alma, Rocky, Oracle, CentOS Stream, Fedora or Debian, Ubuntu, Kali. Paid OS Windows users please leave.In the DOS/V 1997 era, the Free Web server led to Linux-only. I’ve been using home-built computers since 1997, so I don’t fit into the pattern of a manufacturer’s computer. Fast story: Windows is garbage.

“webmin system hostname” = “domain name” = “computername”
If this continues, you will not be able to access the domain from the local server computer, so you will need to rewrite the host file. Also, by rewriting the host file on other computers in the network, you will be able to access the domain. Local IP address “127.0.0.1” Computer IP address “192.168.11.xxx” Global IP address = Domain “222.233.11.xxx”etc. Bad Pattern. Local IP Address xxx and Global IP=Domain.

5. I want to use my local computer as a server and start WordPress with my own domain.

Anyone interested in building a Free Web server. Now, I’ll teach you some know-how. Please proceed.

What is Webmin?
Webmin is a web-based system administration tool for Unix-like servers, and services with about 1,000,000 yearly installations worldwide. Using it, it is possible to configure operating system internals, such as users, disk quotas, services or configuration files, as well as modify, and control open-source apps, such as BIND DNS Server, Apache HTTP Server, PHP, MySQL, and many more.

Get your own domain from your home computer, use Webmin, and publish WordPress and a Apache web server. Before installing Webmin, first install “Apache” and “PHP” with “https” and “SSL” enabled to avoid any trouble.

Installing the https Apache web server
$ sudo apt install apache2

Next, enable Apache’s SSL module and the default SSL site, and restart Apache.

Enabling the SSL module and virtual hosts
$ sudo a2enmod ssl
$ sudo a2ensite default-ssl
$ sudo service apache2 restart

Check the port
$ ss -lnt
$ sudo ufw status

Managing Apache processes
To stop the web server, type:
$ sudo systemctl stop apache2

To start the web server when it is stopped, type:
$ sudo systemctl start apache2

To stop the service and start it again, type:
$ sudo systemctl restart apache2

If you just change a configuration, Apache can reload without disconnecting. To do this, use the following command:
$ sudo systemctl reload apache2

By default, Apache is set to start automatically when the server starts. If you do not want this, you can disable this behavior by typing:
$ sudo systemctl disable apache2

To re-enable the service to start at boot, type:
$ sudo systemctl enable apache2

Installing multiple PHP versions on Ubuntu 22.04 LTS desktop
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
$ sudo apt-get install php8.3 php8.3-fpm
$ sudo apt-get install php8.3-mysql php8.3-mbstring php8.3-xml php8.3-gd php8.3-curl
$ sudo apt-get install php8.2 php8.2-fpm
$ sudo apt-get install php8.2-mysql php8.2-mbstring php8.2-xml php8.2-gd php8.2-curl
$ sudo apt-get install php8.1 php8.1-fpm
$ sudo apt-get install php8.1-mysql php8.1-mbstring php8.1-xml php8.1-gd php8.1-curl
$ sudo apt-get install php8.0 php8.0-fpm
$ sudo apt-get install php8.0-mysql php8.0-mbstring php8.0-xml php8.0-gd php8.0-curl
$ sudo apt-get install php7.4 php7.4-fpm
$ sudo apt-get install php7.4-mysql php7.4-mbstring php7.4-xml php7.4-gd php7.4-curl
$ sudo apt-get install php7.3 php7.3-fpm
$ sudo apt-get install php7.3-mysql php7.3-mbstring php7.3-xml php7.3-gd php7.3-curl
$ sudo apt-get install php7.2 php7.2-fpm
$ sudo apt-get install php7.2-mysql php7.2-mbstring php7.2-xml php7.2-gd php7.2-curl
$ sudo apt-get install php7.1 php7.1-fpm
$ sudo apt-get install php7.1-mysql php7.1-mbstring php7.1-xml php7.1-gd php7.1-curl
$ sudo apt-get install php5.6 php5.6-fpm
$ sudo apt-get install php5.6-mysql php5.6-mbstring php5.6-xml php5.6-gd php5.6-curl

Check active PHP version
$ php -v

Switch the default PHP version for the CLI
If you have multiple versions of PHP installed on Ubuntu 22.04, you can choose to make one of the versions your default PHP version.

To list the available versions, run the following command:
$ sudo update-alternatives --config php

To change the default version, enter the number that matches the appropriate version you want to set as default and press ENTER.

For example, to create the PHP 7.4 default version, type 3 and press ENTER.

You can change the version immediately by running the command below.
$ sudo update-alternatives --set php /usr/bin/php7.4

Then check the active PHP version.
$ php -v

If you no longer need a PHP version, you can remove it from your system. This frees up disk space and system security.

To uninstall the PHP version, run the following command:
$ sudo apt-get remove php5.6

Also, uninstall all modules for that version and run the following command:
$ sudo apt-get remove php5.6-*

Ubuntu 22.04.4 LTS desktop by install. Downloading and webmin Installing

POINT

“webmin system hostname” = “domain name” = “computername”
If this continues, you will not be able to access the domain from the local server computer, so you will need to rewrite the host file. Also, by rewriting the host file on other computers in the network, you will be able to access the domain. Local IP address “127.0.0.1” Computer IP address “192.168.11.xxx” Global IP address = Domain “222.233.11.xxx”etc.

1. Localhostfile=Webmin Web Server
user@computername:~$ sudo nano /etc/hosts
[sudo] user pass:

127.0.0.1 localhost
127.0.1.1 domain name
192.168.11.xxx Computer IP address
222.233.11.xxx domain name ns.domain name ns2.domain name

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
2642964:2948395:89e1:d700:364828:4748693:4528285:463822 domain name ns.domain name ns2.domain name

Setup
The simplest and best way to get Webmin is to use automatic setup-repos.sh script to configure repositories on your RHEL or Debian derivative systems. It can be done in two easy steps:

user@computername:~$ sudo su
[sudo] User password:
root@computername:/home/user#

root@computername:/home/user# curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sh setup-repos.sh

This script will automatically setup our repository and install our GPG keys on your system, and provide webmin package for installation and easy upgrades in the future. The supported and tested systems are Red Hat Enterprise Linux, Alma, Rocky, Oracle, CentOS Stream, Fedora or Debian, Ubuntu, Kali.

Install
If Webmin repository was setup using our setup-repos.sh as described above then Webmin can be installed as easy as:

RHEL and derivatives
root@computername:/home/user# dnf install webmin

Debian, Ubuntu and derivatives
root@computername:/home/user# apt-get install webmin --install-recommends

Check with Webmin network settings

2. Access by domain from other computers in the network
user@computername:~$ sudo nano /etc/hosts
[sudo] user pass:

127.0.0.1 localhost
192.168.11.xxx Computer IP address
222.233.11.xxx domain name

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

The domain can now be accessed from other computers in the network.

Access
After successful Webmin installation, you can access its interface by entering 「https://Your-Server-IP:10000」 in your browser. Check that your firewall configuration allows access through port 10000.

Firewall install gufw

$ sudo apt install gufw
$ sudo ufw app list
Output
Available applications:
Apache Full
DNS
webmin

$ sudo ufw status
$ sudo ufw allow 10000
$ sudo ufw allow dns
$ sudo ufw allow 'Apache Full'

BUFFALO by How to open router ports
Website published. Fix the IP on the computer side.
router「http://192.168.11.1」
Apache: 80, 443
DNS: 53

Obtain your own domain. A Google search will help you find a domain registry near you. Don’t forget to check the global IP and configure DNS.

“webmin system hostname” = “domain name” = “computername”
Webmin login
「https://domain name:10000」

Install “Mariadb” and “BIND” from the Webmin management screen. Configure “Apache”, “Mariadb”, “PHP”and “BIND”.

Configure “Mariadb”.
Create a “database name” and “user” of your choice.

Configure “PHP”.
choice「php8.3-cli」update 2024

Application programs that only work with older PHP versions should be downgraded to PHP.

How to create a forward lookup zone file and a reverse lookup zone file for the BIND DNS server.
Configure “BIND”.

1. Register domain to master address.

On the master zone creation screen
Check “Forward lookup (name to address)” in “Zone type”.

Specify “example.com” in “Domain Name/Network” (obtained domain)

Specify “ns.example.com” as “master server” with “ns.” representing the name server added. (The master server is the primary name server.)

Enter the administrator’s e-mail address in “E-mail address”. (Example: info.example.com.) Normally, email addresses include @ after the username, but please note that the format of the zone file is “.” (dot). Also, for reasons that will be explained later, a “.” (dot) is also included after example.com.

Click the “Create” button without changing any other settings

Specify address records in the forward zone file
Click “Address” on the master zone editing screen. Display the address record screen.

Enter the name server “ns.example.com.” created above in “Record Name”.

“Global IP” in “Address”
Click the “Create” button

What you should be careful of here is the “.” (dot) after the domain.

This is a unique format for zone files, and if you do not add a dot (.) at the end, the domain name of the zone will be added. In other words, if you enter “ns.example.com”, it will mean “ns.example.com.example.com”.

Conversely, if you use this format and enter only “ns”, you will get the same result as entering “ns.example.com.” Please choose according to your preference whether you want to include all of them or omit them. In order to make it easier to understand, we will fill in the information without omitting it on this site.

Forward lookup zone file description example

2. Register reverse lookup address from Global IP.
As with the forward lookup, click “Create a new master zone” and this time check “Reverse lookup (address as name)”.

Don’t forget the “.” (dot) after the host name when doing a reverse lookup.

“Global IP” in “Domain Name/Network”

“ns.example.com.” for “Master Server” (don’t forget the . at the end)

“info.example.com.” in “Email Address”

Since the web server will be published, Local Address “192.168.0.1” Replace with “Global IP”
*Normally, when performing a reverse lookup, you would write the IP address upside down as “1.0.168.192.in-addr.arpa”, etc., but on the Webmin settings screen, please enter “192.168.0.1” normally.

Example of a reverse zone file

WordPress install
This procedure is a simplified version for those who are familiar with installation. Further detailed instructions are below.

Download and unzip the WordPress package.
Create a database for WordPress on the server and a MySQL (or MariaDB) user with full access and editing rights to the database.

(Optional) Rename the file wp-config-sample.php to wp-config.php and add the database information by editing the wp-config.php file.

Tip: Step 3 is optional as the wp-config.php file is automatically generated when you install WordPress. You can skip this step if you are not familiar with renaming files.

Place WordPress files anywhere on your server.
If you want to put WordPress at the domain root (such as http://example.com/), upload the contents of the unzipped wordpress directory (all files except the wordpress directory itself) to the server’s root directory.

If you want to place it in a subdirectory for WordPress on your website (such as http://example.com/blog/), create a blog directory on your server and upload the contents of the unzipped WordPress package to the directory.

Note: If your FTP client has the ability to convert file names to lowercase, make sure it is disabled.
Access the URL where WordPress is installed in your browser and run the installation script.

If you put WordPress files in the root directory: http://example.com/wp-admin/install.php

If you put your WordPress files in a subdirectory called blog: http://example.com/blog/wp-admin/install.php

If WordPress is installed in the root directory: http://example.com

If placed in a subdirectory called blog: http://example.com/blog/

that’s all! WordPress should now be installed.

Ubuntu for apache2 server’s root directory path
/var/www/html

Place your WordPress files anywhere on your server.
If you want WordPress to be at your domain root (such as http://example.com/), upload the contents of the unzipped wordpress directory (all files except the wordpress directory itself). Download “htaccess” and rename it to “.htaccess”. Select “.htaccess” and upload it to the server. “https” and “SSL” settings are now complete.

SSL
(.htaccess)

If you want to place it in a subdirectory for WordPress on your website (such as http://example.com/blog/), create a blog directory on your server and upload the contents of the unzipped WordPress package to the directory.

Note: If your FTP client has the ability to convert file names to lowercase, make sure it is disabled.
$ sudo cp -a /download/wordpress/. /var/www/html

wp-config.php settings
Open in browser and copy and paste the source code「https://api.wordpress.org/secret-key/1.1/salt/」

Configure “Mariadb”.
Create a “database name” and “user” of your choice.

If you put WordPress files in the root directory: http://example.com/wp-admin/install.php

If you put your WordPress files in a subdirectory called blog: http://example.com/blog/wp-admin/install.php

「https://server_domain_or_IP」

WordPress installation screen not displayed

WordPress installation error. mysql-server may be required.
$ sudo apt install mysql-server

WordPress installation successful
URL “https://domain” SSL from the management screen

Apache Permission
$ sudo chown -R www-data:user /var/www/html
$ sudo find /var/www/html -type f -exec chmod 664 {} \;
$ sudo find /var/www/html -type d -exec chmod 775 {} \;

If an error occurs with a plugin or theme, please change the permissions.

Apache tuning

Let’s Encrypt Installing an SSL certificate

1. install certbot
$ sudo apt install certbot python3-certbot-apache

2. Certbot provides a variety of ways to obtain SSL certificates through plugins. The Apache plugin will take care of reconfiguring Apache and reloading the configuration whenever necessary. To use this plugin, type the following:
$ sudo certbot --apache

Output
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter ‘c’ to
cancel): you@your_domain

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
(A)gree/(C)ancel: A

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let’s Encrypt project and the non-profit
organization that develops Certbot? We’d like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
(Y)es/(N)o: N

Which names would you like to activate HTTPS for?
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
1: your_domain
2: www.your_domain
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter ‘c’ to cancel):

3. certbot.timer
$ sudo systemctl status certbot.timer

Output
● certbot.timer – Run certbot twice daily
Loaded: loaded (/lib/systemd/system/certbot.timer; enabled; vendor preset: enabled)
Active: active (waiting) since Tue 2020-04-28 17:57:48 UTC; 17h ago
Trigger: Wed 2020-04-29 23:50:31 UTC; 12h left
Triggers: ● certbot.service

Apr 28 17:57:48 fine-turtle systemd: Started Run certbot twice daily.

4. Webmin login「https://domain name:10000」Let’s Encrypt Installing an SSL certificate
From the Webmin Configuration page, select SSL Encryption from the list of icons, and then click on the Let’s Encrypt tab. You’ll see a screen like the following figure:

On this page, you’ll tell Webmin how to obtain and renew your certificate. Let’s Encrypt certificates expire after 3 months, but you can instruct Webmin to automatically attempt to renew the Let’s Encrypt certificate every month. Let’s Encrypt looks for a verification file on the server, so we’ll configure Webmin to place the verification file inside the folder /var/www/html, which is the folder that the Apache web server you configured in the prerequisites uses. Follow these steps to set up your certificate:

1. Fill in Hostnames for certificate with your FQDN.

2. For Website root directory for validation file, select the Other Directory button and enter your website’s document root. Assuming you followed the prerequisite Apache tutorial this will be /var/www/html.

3. For Months between automatic renewal section, deselect the Only renew manually option by typing 1 into the input box, and select the radio button to the left of the input box.

Click the Request Certificate button. After a few seconds, you will see a confirmation screen.

To use the new certificate, click the Return to Webmin configuration button on the confirmation screen. From that page, scroll down and click the Restart Webmin button. Wait around 30 seconds, and then reload the page and log in again. Your browser should now indicate that the certificate is valid.

Final Check
“webmin system hostname” = “domain name” = “computername”


If this continues, you will not be able to access the domain from the local server computer, so you will need to rewrite the host file. Also, by rewriting the host file on other computers in the network, you will be able to access the domain. Local IP address “127.0.0.1” Computer IP address “192.168.11.xxx” Global IP address = Domain “222.233.11.xxx”etc.

1. Localhostfile=Webmin Web Server
user@computername:~$ sudo nano /etc/hosts
[sudo] user pass:

127.0.0.1 localhost
127.0.1.1 domain name
192.168.11.xxx Computer IP address
222.233.11.xxx domain name ns.domain name ns2.domain name

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
2642964:2948395:89e1:d700:364828:4748693:4528285:463822 domain name ns.domain name ns2.domain name

2. Access by domain from other computers in the network
user@computername:~$ sudo nano /etc/hosts
[sudo] user pass:

127.0.0.1 localhost
192.168.11.xxx Computer IP address
222.233.11.xxx domain name

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

3. Domain Check
$ sudo nslookup
[sudo] user password:
> domain name
Server: 127.0.0.53
Address: 127.0.0.53#53
Name: domain name
Address: 127.0.1.1
Name: domain name
Address: 192.168.11.xxx
Name: domain name
Address: 222.233.11.xxx
Name: domain name
Address: 2642964:2948395:89e1:d700:364828:4748693:4528285:463822
> 222.233.11.xxx
xxx.11.233.222.in-addr.arpa name = domain name.
xxx.11.233.222.in-addr.arpa name = ns.domain name.
xxx.11.233.222.in-addr.arpa name = ns2.domain name.

4. WEB Site Check
Turn off your smartphone’s WIFI. If you can access “domain name” “https://domain name” via “mobile line”, it will be successful.

Once you have successfully started up your home web server, the final step is to update the application, upgrade, and clean up unnecessary data to complete the web server.

$ sudo apt update
$ sudo apt upgrade
$ sudo apt autoremove

thank you for your hard work!!