Server installation in linux

Quickstart: Install SQL Server and create a database on Ubuntu

Applies to: SQL Server (all supported versions) — Linux

In this quickstart, you install SQL Server 2017 on Ubuntu 16.04/18.04. You then connect with sqlcmd to create your first database and run queries.

This tutorial requires user input and an internet connection. If you are interested in the unattended or offline installation procedures, see Installation guidance for SQL Server on Linux. For a list of supported platforms, see our Release notes.

In this quickstart, you install SQL Server 2019 on Ubuntu 16.04, 18.04, or 20.04. You then connect with sqlcmd to create your first database and run queries.

Ubuntu 20.04 is supported starting with SQL Server 2019 CU10.

This tutorial requires user input and an internet connection. If you are interested in the unattended or offline installation procedures, see Installation guidance for SQL Server on Linux. For a list of supported platforms, see our Release notes.

Prerequisites

You must have an Ubuntu 16.04 or 18.04 machine with at least 2 GB of memory.

To install Ubuntu 18.04 on your own machine, go to http://releases.ubuntu.com/bionic/. You can also create Ubuntu virtual machines in Azure. See Create and Manage Linux VMs with the Azure CLI.

At this time, the Windows Subsystem for Linux for Windows 10 is not supported as an installation target for production workloads.

Ubuntu 18.04 is supported starting with SQL Server 2017 CU20. If you want to use the instructions on this article with Ubuntu 18.04, make sure you use the correct repository path, 18.04 instead of 16.04 .

If you are running SQL Server on a lower version, the configuration is possible with modifications.

You must have an Ubuntu 16.04, 18.04, or 20.04 machine with at least 2 GB of memory.

To install Ubuntu 20.04 on your own machine, go to https://releases.ubuntu.com/20.04/. You can also create Ubuntu virtual machines in Azure. See Create and Manage Linux VMs with the Azure CLI.

At this time, the Windows Subsystem for Linux for Windows 10 is not supported as an installation target for production workloads.

Install SQL Server

The following commands for SQL Server 2017 points to the Ubuntu 18.04 repository. If you are using Ubuntu 16.04, change the path below to /ubuntu/16.04/ instead of /ubuntu/18.04/ .

To configure SQL Server on Ubuntu, run the following commands in a terminal to install the mssql-server package.

Import the public repository GPG keys:

Register the Microsoft SQL Server Ubuntu repository:

For Ubuntu 16.04:

For Ubuntu 18.04:

If you want to install SQL Server 2019 , you must instead register the SQL Server 2019 repository. Use the following command for SQL Server 2019 installations:

For Ubuntu 16.04:

For Ubuntu 18.04:

Run the following commands to install SQL Server:

After the package installation finishes, run mssql-conf setup and follow the prompts to set the SA password and choose your edition.

The following SQL Server 2017 editions are freely licensed: Evaluation, Developer, and Express.

Make sure to specify a strong password for the SA account (Minimum length 8 characters, including uppercase and lowercase letters, base 10 digits and/or non-alphanumeric symbols).

Once the configuration is done, verify that the service is running:

If you plan to connect remotely, you might also need to open the SQL Server TCP port (default 1433) on your firewall.

At this point, SQL Server is running on your Ubuntu machine and is ready to use!

Install SQL Server

The following commands for SQL Server 2019 points to the Ubuntu 20.04 repository. If you are using Ubuntu 18.04 or 16.04, change the path below to /ubuntu/18.04/ or /ubuntu/16.04/ instead of /ubuntu/20.04/ .

To configure SQL Server on Ubuntu, run the following commands in a terminal to install the mssql-server package.

Import the public repository GPG keys:

Register the Microsoft SQL Server Ubuntu repository for SQL Server 2019:

For Ubuntu 16.04:

For Ubuntu 18.04:

For Ubuntu 20.04:

Run the following commands to install SQL Server:

After the package installation finishes, run mssql-conf setup and follow the prompts to set the SA password and choose your edition.

Make sure to specify a strong password for the SA account (Minimum length 8 characters, including uppercase and lowercase letters, base 10 digits and/or non-alphanumeric symbols).

Once the configuration is done, verify that the service is running:

If you plan to connect remotely, you might also need to open the SQL Server TCP port (default 1433) on your firewall.

At this point, SQL Server 2019 is running on your Ubuntu machine and is ready to use!

Install the SQL Server command-line tools

To create a database, you need to connect with a tool that can run Transact-SQL statements on the SQL Server. The following steps install the SQL Server command-line tools: sqlcmd and bcp.

Use the following steps to install the mssql-tools on Ubuntu.

By default, curl isn’t installed on Ubuntu. To install curl, run this code:

Import the public repository GPG keys.

Register the Microsoft Ubuntu repository.

For Ubuntu 16.04:

For Ubuntu 18.04:

For Ubuntu 20.04:

Update the sources list and run the installation command with the unixODBC developer package. For more information, see Install the Microsoft ODBC driver for SQL Server (Linux).

To update to the latest version of mssql-tools run the following commands:

Optional: Add /opt/mssql-tools/bin/ to your PATH environment variable in a bash shell.

To make sqlcmd/bcp accessible from the bash shell for login sessions, modify your PATH in the

/.bash_profile file with the following command:

To make sqlcmd/bcp accessible from the bash shell for interactive/non-login sessions, modify the PATH in the

Читайте также:  Hp 3390 сканирование по сети windows 10

/.bashrc file with the following command:

Connect locally

The following steps use sqlcmd to locally connect to your new SQL Server instance.

Run sqlcmd with parameters for your SQL Server name (-S), the user name (-U), and the password (-P). In this tutorial, you are connecting locally, so the server name is localhost . The user name is SA and the password is the one you provided for the SA account during setup.

You can omit the password on the command line to be prompted to enter it.

If you later decide to connect remotely, specify the machine name or IP address for the -S parameter, and make sure port 1433 is open on your firewall.

If successful, you should get to a sqlcmd command prompt: 1> .

If you get a connection failure, first attempt to diagnose the problem from the error message. Then review the connection troubleshooting recommendations.

Create and query data

The following sections walk you through using sqlcmd to create a new database, add data, and run a simple query.

Create a new database

The following steps create a new database named TestDB .

From the sqlcmd command prompt, paste the following Transact-SQL command to create a test database:

On the next line, write a query to return the name of all of the databases on your server:

The previous two commands were not executed immediately. You must type GO on a new line to execute the previous commands:

To learn more about writing Transact-SQL statements and queries, see Tutorial: Writing Transact-SQL Statements.

Insert data

Next create a new table, Inventory , and insert two new rows.

From the sqlcmd command prompt, switch context to the new TestDB database:

Create new table named Inventory :

Insert data into the new table:

Type GO to execute the previous commands:

Select data

Now, run a query to return data from the Inventory table.

From the sqlcmd command prompt, enter a query that returns rows from the Inventory table where the quantity is greater than 152:

Execute the command:

Exit the sqlcmd command prompt

To end your sqlcmd session, type QUIT :

Performance best practices

After installing SQL Server on Linux, review the best practices for configuring Linux and SQL Server to improve performance for production scenarios. For more information, see Performance best practices and configuration guidelines for SQL Server on Linux.

Cross-platform data tools

In addition to sqlcmd, you can use the following cross-platform tools to manage SQL Server:

Tool Description
Azure Data Studio A cross-platform GUI database management utility.
Visual Studio Code A cross-platform GUI code editor that run Transact-SQL statements with the mssql extension.
PowerShell Core A cross-platform automation and configuration tool based on cmdlets.
mssql-cli A cross-platform command-line interface for running Transact-SQL commands.

Connecting from Windows

SQL Server tools on Windows connect to SQL Server instances on Linux in the same way they would connect to any remote SQL Server instance.

If you have a Windows machine that can connect to your Linux machine, try the same steps in this topic from a Windows command-prompt running sqlcmd. Just verify that you use the target Linux machine name or IP address rather than localhost, and make sure that TCP port 1433 is open. If you have any problems connecting from Windows, see connection troubleshooting recommendations.

For other tools that run on Windows but connect to SQL Server on Linux, see:

Other deployment scenarios

For other installation scenarios, see the following resources:

  • Upgrade: Learn how to upgrade an existing installation of SQL Server on Linux
  • Uninstall: Uninstall SQL Server on Linux
  • Unattended install: Learn how to script the installation without prompts
  • Offline install: Learn how to manually download the packages for offline installation

For answers to frequently asked questions, see the SQL Server on Linux FAQ.

Источник

Установка сервера — Linux

Установка сервера ERA в ОС Linux выполняется с помощью команды в терминале. Убедитесь, что соблюдены все необходимые условия. Вы можете подготовить сценарий установки, а затем выполнить его, используя sudo .

Пример сценария установки
(Новые строки разделяются при помощи разделителя «\», что позволяет скопировать всю команду в терминал.)

sudo ./Server-Linux-x86_64.sh \
—skip-license \
—db-driver=MySQL \
—db-hostname=127.0.0.1 \
—db-port=3306 \
—db-admin-username=root \
—db-admin-password=Admin123 \
—server-root-password=Admin123 \
—db-user-username=root \
—db-user-password=Admin123 \
—cert-hostname=»10.1.179.46;Ubuntu64-bb;Ubuntu64-bb.BB.LOCAL»

Агент ERA и служба eraserver будут установлены в это расположение:

Можно изменять следующие атрибуты:

Код языка (LCID) установленного сервера (по умолчанию en_US ). Доступные параметры см. в разделе поддерживаемые языки.

Примечание. Вы можете установить язык для каждого сеанса веб-консоли ERA.

Во время установки от пользователя не потребуется подтверждение лицензионного соглашения.

Пропустить создание сертификатов (используйте этот параметр вместе с параметром —server-cert-path)

Лицензионный ключ ESET. Этот ключ можно установить позже.

Глобальный уникальный идентификатор продукта. Если ИД не установлен, он будет создан.

Порт сервера ESET Remote Administrator (ERA) (по умолчанию — 2222 ).

Порт консоли ESET Remote Administrator (по умолчанию — 2223 ).

Пароль для входа в веб-консоль с именем пользователя Administrator должен содержать как минимум 8 символов

Тип базы данных, которая будет использована (возможные значения: MySQL Server , Microsoft SQL Server )

Драйвер ODBC, используемый для подключения к базе данных (например, MySQL ODBC 5.3 ANSI Driver ).

Имя компьютера или IP-адрес сервера базы данных

Порт сервера базы данных (по умолчанию — 3306 ).

Имя базы данных сервера ERA (по умолчанию — era_db ).

Имя пользователя администратора базы данных (используется во время установки для создания и изменения базы данных)

Пароль администратора базы данных.

Имя пользователя сервера ERA базы данных (используется сервером ERA для подключения к базе данных). Длина не должна превышать 16 символов.

Пароль пользователя сервера ERA базы данных.

Содержит все возможные имена и/или IP-адреса компьютера, на котором будет установлен сервер ERA. Это имя должно совпадать с именем сервера, указанным в сертификате агента, который пытается подключиться к серверу.

Путь к сертификату узла сервера (используйте этот параметр, если вы выбрали —skip-cert ).

Пароль сертификата узла сервера

Пароль сертификата узла агента

Пароль центра сертификации.

путь к файлу центра сертификации сервера

Общее имя центра сертификации (используйте кавычки «»)

Источник

Installation on LinuxпѓЃ

In case you prefer installing from the source tarball, you can setup Nextcloud from scratch using a classic LAMP stack (Linux, Apache, MySQL/MariaDB, PHP). This document provides a complete walk-through for installing Nextcloud on Ubuntu 18.04 LTS Server with Apache and MariaDB, using the Nextcloud .tar archive. This method is recommended to install Nextcloud.

Admins of SELinux-enabled distributions such as CentOS, Fedora, and Red Hat Enterprise Linux may need to set new rules to enable installing Nextcloud. See SELinux configuration tips for a suggested configuration.

If you prefer a more automated installation of Nextcloud and there are no packages for your Linux distribution, you have the option to install the community Snap Package. This includes a full production-ready stack, will maintain your HTTPS certificates for you, and will automatically update as needed to stay secure. You can also use the Nextcloud VM scripts to install directly on a clean Ubuntu Server. It will setup everything for you and include scripts for automated installation of apps like; Collabora, OnlyOffice, Talk and so on. Please note that those two options are not officially supported by Nextcloud GmbH.

This installation guide is giving a general overview of required dependencies and their configuration. For a distribution specific setup guide have a look at the Example installation on Ubuntu 20.04 LTS and Example installation on CentOS 8 .

Prerequisites for manual installationпѓЃ

The Nextcloud .tar archive contains all of the required PHP modules. This section lists all required and optional PHP modules. Consult the PHP manual for more information on modules. Your Linux distribution should have packages for all required modules. You can check the presence of a module by typing php -m | grep -i . If you get a result, the module is present.

PHP module ctype

PHP module curl

PHP module filter (only on Mageia and FreeBSD)

PHP module hash (only on FreeBSD)

PHP module iconv

PHP module JSON

PHP module libxml (Linux package libxml2 must be >=2.7.0)

PHP module mbstring

PHP module openssl

PHP module posix

PHP module session

PHP module SimpleXML

PHP module XMLReader

PHP module XMLWriter

PHP module zlib

Database connectors (pick the one for your database:)

PHP module pdo_sqlite (>= 3, usually not recommended for performance reasons)

PHP module pdo_mysql (MySQL/MariaDB)

PHP module pdo_pgsql (PostgreSQL)

PHP module fileinfo (highly recommended, enhances file analysis performance)

PHP module bz2 (recommended, required for extraction of apps)

PHP module intl (increases language translation performance and fixes sorting of non-ASCII characters)

Required for specific apps:

PHP module ldap (for LDAP integration)

PHP module smbclient (SMB/CIFS integration, see SMB/CIFS )

PHP module ftp (for FTP storage / external user authentication)

PHP module imap (for external user authentication)

PHP module bcmath (for passwordless login)

PHP module gmp (for passwordless login)

Recommended for specific apps (optional):

PHP module gmp (for SFTP storage)

PHP module exif (for image rotation in pictures app)

For enhanced server performance (optional) select one of the following memcaches:

PHP module apcu (>= 4.0.6)

PHP module memcached

PHP module redis (>= 2.2.6, required for Transactional File Locking)

See Memory caching to learn how to select and configure a memcache.

For preview generation (optional):

PHP module imagick

avconv or ffmpeg

OpenOffice or LibreOffice

For command line processing (optional):

PHP module pcntl (enables command interruption by pressing ctrl-c )

For command line updater (optional):

PHP module phar (upgrades Nextcloud by running sudo -u www-data php /var/www/nextcloud/updater/updater.phar )

You don’t need the WebDAV module for your Web server (i.e. Apache’s mod_webdav ), as Nextcloud has a built-in WebDAV server of its own, SabreDAV. If mod_webdav is enabled you must disable it for Nextcloud. (See Apache Web server configuration for an example configuration.)

Apache Web server configurationпѓЃ

Configuring Apache requires the creation of a single configuration file. On Debian, Ubuntu, and their derivatives, this file will be /etc/apache2/sites-available/nextcloud.conf . On Fedora, CentOS, RHEL, and similar systems, the configuration file will be /etc/httpd/conf.d/nextcloud.conf .

You can choose to install Nextcloud in a directory on an existing webserver, for example https://www.example.com/nextcloud/ , or in a virtual host if you want Nextcloud to be accessible from its own subdomain such as https://cloud.example.com/ .

To use the directory-based installation, put the following in your nextcloud.conf replacing the Directory and Alias filepaths with the filepaths appropriate for your system:

To use the virtual host installation, put the following in your nextcloud.conf replacing ServerName, as well as the DocumentRoot and Directory filepaths with values appropriate for your system:

On Debian, Ubuntu, and their derivatives, you should run the following command to enable the configuration:

Additional Apache configurationsпѓЃ

For Nextcloud to work correctly, we need the module mod_rewrite . Enable it by running:

Additional recommended modules are mod_headers , mod_env , mod_dir and mod_mime :

If you’re running mod_fcgi instead of the standard mod_php also enable:

You must disable any server-configured authentication for Nextcloud, as it uses Basic authentication internally for DAV services. If you have turned on authentication on a parent folder (via e.g. an AuthType Basic directive), you can turn off the authentication specifically for the Nextcloud entry. Following the above example configuration file, add the following line in the section:

When using SSL, take special note of the ServerName. You should specify one in the server configuration, as well as in the CommonName field of the certificate. If you want your Nextcloud to be reachable via the internet, then set both of these to the domain you want to reach your Nextcloud server.

Now restart Apache:

If you’re running Nextcloud in a subdirectory and want to use CalDAV or CardDAV clients make sure you have configured the correct Service discovery URLs.

Pretty URLsпѓЃ

Pretty URLs remove the index.php -part in all Nextcloud URLs, for example in sharing links like https://example.org/nextcloud/index.php/s/Sv1b7krAUqmF8QQ , making URLs shorter and thus prettier.

mod_env and mod_rewrite must be installed on your webserver and the .htaccess must be writable by the HTTP user. Then you can set in the config.php two variables:

if your setup is available on https://example.org/nextcloud or:

if it isn’t installed in a subfolder. Finally run this occ-command to update your .htaccess file:

After each update, these changes are automatically applied to the .htaccess -file.

Enabling SSLпѓЃ

You can use Nextcloud over plain HTTP, but we strongly encourage you to use SSL/TLS to encrypt all of your server traffic, and to protect user’s logins and data in transit.

Apache installed under Ubuntu comes already set-up with a simple self-signed certificate. All you have to do is to enable the ssl module and the default site. Open a terminal and run:

Self-signed certificates have their drawbacks — especially when you plan to make your Nextcloud server publicly accessible. You might want to consider getting a certificate signed by a commercial signing authority. Check with your domain name registrar or hosting service for good deals on commercial certificates.

Installation wizardпѓЃ

After restarting Apache you must complete your installation by running either the graphical Installation Wizard, or on the command line with the occ command. To enable this, change the ownership on your Nextcloud directories to your HTTP user:

Admins of SELinux-enabled distributions may need to write new SELinux rules to complete their Nextcloud installation; see SELinux configuration tips .

To use the graphical Installation Wizard see Installation wizard .

SELinux configuration tipsпѓЃ

See SELinux configuration for a suggested configuration for SELinux-enabled distributions such as Fedora and CentOS.

php.ini configuration notesпѓЃ

Keep in mind that changes to php.ini may have to be configured on more than one ini file. This can be the case, for example, for the date.timezone setting.

php.ini — used by the Web server:

php.ini — used by the php-cli and so by Nextcloud CRON jobs:

Path names have to be set in respect of the installed PHP (>= 7.3 or 7.4) as applicable.

php-fpm configuration notesпѓЃ

System environment variables

When you are using php-fpm , system environment variables like PATH, TMP or others are not automatically populated in the same way as when using php-cli . A PHP call like getenv(‘PATH’); can therefore return an empty result. So you may need to manually configure environment variables in the appropropriate php-fpm ini/config file.

Here are some example root paths for these ini/config files:

In both examples, the ini/config file is called www.conf , and depending on the distro version or customizations you have made, it may be in a subdirectory such as pool.d .

Usually, you will find some or all of the environment variables already in the file, but commented out like this:

Uncomment the appropriate existing entries. Then run printenv PATH to confirm your paths, for example:

If any of your system environment variables are not present in the file then you must add them.

Alternatively it is possible to use the environment variables of your system by modifying:

and uncommenting the line:

When you are using shared hosting or a control panel to manage your Nextcloud VM or server, the configuration files are almost certain to be located somewhere else, for security and flexibility reasons, so check your documentation for the correct locations.

Please keep in mind that it is possible to create different settings for php-cli and php-fpm , and for different domains and Web sites. The best way to check your settings is with PHP version and information .

Maximum upload size

If you want to increase the maximum upload size, you will also have to modify your php-fpm configuration and increase the upload_max_filesize and post_max_size values. You will need to restart php-fpm and your HTTP server in order for these changes to be applied.

.htaccess notes for Apache

Nextcloud comes with its own nextcloud/.htaccess file. Because php-fpm can’t read PHP settings in .htaccess these settings and permissions must be set in the nextcloud/.user.ini file.

Other Web serversпѓЃ

Installing on Windows (virtual machine)пѓЃ

If you are using Windows, the easiest way to get Nextcloud up and running is using a virtual machine (VM). There are two options:

Enterprise/SME appliance

Nextcloud GmbH maintains a free appliance built on the Univention Corporate Server (UCS) with easy graphical setup and web-based administration. It includes user management via LDAP, can replace an existing Active Directory setup and has optional ONLYOFFICE and Collabora Online integration, with many more applications available for easy and quick install.

It can be installed on hardware or run in a virtual machine using VirtualBox, VMWare (ESX) and KVM images.

Download the the Appliance here:

Home User/SME appliance

The Nextcloud VM is maintained by T&M Hansson IT and several different versions are offered. Collabora, OnlyOffice, Full Text Search and other apps can easily be installed with the included scripts which you can choose to run during the first setup, or download them later and run it afterwards. You can find all the currently available automated app installations on GitHub.

The VM comes in different sizes and versions.

You can find all the available versions here.

For complete instructions and downloads see:

You can install the VM on several different operating systems as long as you can mount OVA, VMDK, or VHD/VHDX VM in your hypervisor. If you are using KVM then you need to install the VM from the scripts on GitHub. You can follow the instructions in the README.

Installing via Snap packagesпѓЃ

A snap is a zip file containing an application together with its dependencies, and a description of how it should safely be run on your system, especially the different ways it should talk to other software. Most importantly snaps are designed to be secure, sandboxed, containerized applications isolated from the underlying system and from other applications.

To install the Nextcloud Snap Package, run the following command in a terminal:

The snapd technology is the core that powers snaps, and it offers a new way to package, distribute, update and run OS components and applications on a Linux system. See more about snaps on snapcraft.io.

Installation via web installer on a VPS or web spaceпѓЃ

When you don’t have access to the command line, for example at a web hosting or VMPS, an easy option is to use our web installer. This script can be found on our server installation page here.

The script checks the dependencies, downloads Nextcloud from the official server, unpacks it with the right permissions and the right user account. Finally, you will be redirected to the Nextcloud installer. Here a quick how-to:

Get the file from the installation page

Upload setup-nextcloud.php to your web space

Point your web browser to setup-nextcloud.php on your webspace

Follow the instructions and configure Nextcloud

Login to your newly created Nextcloud instance!

that the installer uses the same Nextcloud version as available for the built in updater in Nextcloud. After a major release it can take up to a month before it becomes available through the web installer and the updater. This is done to spread the deployment of new major releases out over time.

Installation on TrueNASпѓЃ

Installation via install scriptпѓЃ

One of the easiest ways of installing is to use the Nextcloud VM scripts. It’s basically just two steps:

Run the script with:

A guided setup will follow and the only thing you have to do it to follow the on screen instructions, when given to you.

Источник

Читайте также:  Cmd управление службы windows
Оцените статью