7.3 Install on Linux and Initial Configurations

    Table of contents
    You are currently comparing two old versions - only when you are comparing against the latest version can you revert. Return to version archive.

    Combined revision comparison

    Comparing version 16:25, 20 Jan 2024 by puripuri2100 with version 15:08, 14 Feb 2024 by puripuri2100.

    ...

    • Red Hat Enterprise Linux Fedora UbuntuCentOS

    ...

    To register vpnserver to Linux as a daemon process, create a startup script, as shown below, with the name /opt/vpnserver.shetc/init.d/vpnserver. (The following startup script is a description example, and you may have to rewrite part of the script for it to work properly on your system.)

    ...

    You can use a text editor or the cat command to write the above script to /etc/opt/vpnserver.shinit.d/vpnserver as a text file. To use the cat command to create the script, press Ctrl + D after the line break in the final line, as shown below.

    ...

    After creating the /etc/opt/vpnserver.shinit.d/vpnserver startup script, change the permissions for this script so that the script cannot be rewritten by a user without permissions.

    [root@machine vpnserver]# chmod 755 /opt/vpnserver.sh

    Next, create a systemd config file, as shown below, with the name /etc/systemd/system/vpnserver.serviceetc/init.d. (The following startup script is a description example, and you may have to rewrite part of the script for it to work properly on your system.)

    [Unit]
    Description = vpnserver daemon
    
    [Service]
    ExecStart = /opt/vpnserver.sh start
    ExecStop = /opt/vpnserver.sh stop
    ExecReload = /opt/vpnserver.sh restart
    Restart = always
    Type = forking
    
    [Install]
    WantedBy = multi-user.target/vpnserver

    Lastly, use the systemctlchkconfig command to allow the above startup script to start automatically in the background when the Linux kernel starts.

    [root@machine vpnserver]# systemctl enable/sbin/chkconfig --add vpnserver 

    ...

     
    [root@machine vpnserver]# systemctl start vpnserver/etc/init.d/vpnserver start  

    ...

    [root@machine vpnserver]# systemctl stop vpnserver/etc/init.d/vpnserver stop 

    ...

    Version from 16:25, 20 Jan 2024

    This revision modified by puripuri2100 (Ban)

    ...

    • Red Hat Enterprise Linux
    • Fedora
    • CentOS

    ...

    To register vpnserver to Linux as a daemon process, create a startup script, as shown below, with the name /etc/init.d/vpnserver. (The following startup script is a description example, and you may have to rewrite part of the script for it to work properly on your system.)

    ...

    You can use a text editor or the cat command to write the above script to /etc/init.d/vpnserver as a text file. To use the cat command to create the script, press Ctrl + D after the line break in the final line, as shown below.

    ...

    After creating the /etc/init.d/vpnserver startup script, change the permissions for this script so that the script cannot be rewritten by a user without permissions.

    [root@machine vpnserver]# chmod 755 /etc/init.d/vpnserver

    Lastly, use the chkconfig command to allow the above startup script to start automatically in the background when the Linux kernel starts.

    [root@machine vpnserver]# /sbin/chkconfig --add vpnserver 

    ...

    [root@machine vpnserver]# /etc/init.d/vpnserver start 

    ...

    [root@machine vpnserver]# /etc/init.d/vpnserver stop 

    ...

    Version as of 15:08, 14 Feb 2024

    This revision modified by puripuri2100 (Ban)

    ...

    • Ubuntu

    ...

    To register vpnserver to Linux as a daemon process, create a startup script, as shown below, with the name /opt/vpnserver.sh. (The following startup script is a description example, and you may have to rewrite part of the script for it to work properly on your system.)

    ...

    You can use a text editor or the cat command to write the above script to /opt/vpnserver.sh as a text file. To use the cat command to create the script, press Ctrl + D after the line break in the final line, as shown below.

    ...

    After creating the /opt/vpnserver.sh startup script, change the permissions for this script so that the script cannot be rewritten by a user without permissions.

    [root@machine vpnserver]# chmod 755 /opt/vpnserver.sh

    Next, create a systemd config file, as shown below, with the name /etc/systemd/system/vpnserver.service. (The following startup script is a description example, and you may have to rewrite part of the script for it to work properly on your system.)

    [Unit]
    Description = vpnserver daemon
    
    [Service]
    ExecStart = /opt/vpnserver.sh start
    ExecStop = /opt/vpnserver.sh stop
    ExecReload = /opt/vpnserver.sh restart
    Restart = always
    Type = forking
    
    [Install]
    WantedBy = multi-user.target

    Lastly, use the systemctl command to allow the above startup script to start automatically in the background when the Linux kernel starts.

    [root@machine vpnserver]# systemctl enable vpnserver 

    ...

    [root@machine vpnserver]# systemctl start vpnserver 

    ...

    [root@machine vpnserver]# systemctl stop vpnserver 

    ...