Debian 10

Post Reply
admin
Site Admin
Posts: 473
Joined: 06 Feb 2007, 13:36

Debian 10

Post by admin »

New linux Debian 10 server setup with SSH server and Webserver (Gnome):

Image

With the following:

+ Webmin
+ mariaDB
+ open-vm-tools
+ Procmail Mail Filter

Same build & setup as DGZM machine, but VMware sees a difference:

Code: Select all

The configured guest OS (Other 4.x or later Linux (64-bit)) for this virtual machine does not match the guest that is currently running (Debian GNU/Linux 10 (64-bit)). You should specify the correct guest OS to allow for guest-specific optimizations
DGZM does not show this message, only difference is VMware tools (VMware tools 10.3.23 vs. open-vm-tools 10.3.10)


Adjusted Apache server, run only https.
https://techexpert.tips/apache/enable-https-apache/

Apache - Enable HTTPS
Install the Apache server and the required packages.

Code: Select all

apt-get update
apt-get install apache2 openssl
Enable Apache module named: Mod_ssl.
Enable Apache module named: Mod_rewrite.

Code: Select all

a2enmod ssl
a2enmod rewrite
If not found by root, use "su -" or -again- "sudo " before commands.

Edit the Apache configuration file.

Code: Select all

vi /etc/apache2/apache2.conf
or use nano...

Add the following lines at the end of this file.

Code: Select all

<Directory /var/www/html>
AllowOverride All
</Directory>
Create a private key and the website certificate using the OpenSSL command.

Code: Select all

mkdir /etc/apache2/certificate
cd /etc/apache2/certificate
openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out apache-certificate.crt -keyout apache.key
Enter the requested information.

Code: Select all

Generating a RSA private key
............++++
.......................................................++++
writing new private key to 'apache.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:BR
State or Province Name (full name) [Some-State]:Rio de Janeiro
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:TechExpert
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:201.201.201.201
Email Address []:
On the option named COMMON_NAME, you need to enter the IP address or hostname.
In our example, we used the IP address 201.201.201.201.
Edit the Apache configuration file for the default website.

Code: Select all

vi /etc/apache2/sites-enabled/000-default.conf
Here is the file, before our configuration.

Code: Select all

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Here is the file, after our configuration.

Code: Select all

<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLEngine on
        SSLCertificateFile /etc/apache2/certificate/apache-certificate.crt
        SSLCertificateKeyFile /etc/apache2/certificate/apache.key
</VirtualHost>
Optionally, you may want to redirect HTTP users to the HTTPS version of your website.
In this case, use the following configuration.

Code: Select all

<VirtualHost *:80>
        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
</virtualhost>
<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLEngine on
        SSLCertificateFile /etc/apache2/certificate/apache-certificate.crt
        SSLCertificateKeyFile /etc/apache2/certificate/apache.key
</VirtualHost>
Restart the Apache service.

Code: Select all

service apache2 restart
Open your browser and access the HTTPS version of your website.
In our example, the following URL was entered in the Browser:

Code: Select all

https://201.201.201.201
The Apache server will display the HTTPS version of your website.
Finished the configuration of HTTPS on the Apache server.

DG.
Post Reply