SuiteCTMは、PHPで記述されたオープンソースの顧客関係管理ソリューションです。これは、あらゆるオペレーティングシステムで実行される、フル機能で拡張性の高いCRMアプリケーションです。これは、SugarCRMがコミュニティエディションの開発を中止することを決定したときに人気を博しました。これは、ビジネス戦略、アクション、および決定を作成するために使用されます。これは、SugarCRM、Salesforce、Microsoftなどの他の商用CRMの代替CRMソリューションです。
この投稿では、Apacheを使用してSuiteCRMをインストールし、Debian11にSSLを暗号化する方法を紹介します。
- Debian11を実行しているサーバー。
- サーバーIPで指定された有効なドメイン名。
- ルートパスワードはサーバーで構成されています。
Apache、MariaDB、およびPHPをインストールします
SuiteCRMはPHPベースのアプリケーションであり、MariaDBをデータベースバックエンドとして使用します。そのため、Apacheサーバー、MariaDBデータベースサーバー、PHP、およびその他の必要なPHP拡張機能をサーバーにインストールする必要があります。次のコマンドを使用して、それらすべてをインストールできます。
apt-get install apache2 mariadb-server mariadb-client php php-common php-zip php-mysql php-gd php-curl php-imap php-mbstring php-xml php-json libapache2-mod-php unzip libpcre3 -y
すべてのパッケージがインストールされたら、php.iniファイルを編集し、いくつかのデフォルト設定を変更します。
nano /etc/php/7.4/apache2/php.ini
次の設定を変更します:
memory_limit = 256M post_max_size = 64M upload_max_filesize = 64M
ファイルを保存して閉じてから、Apacheサービスを再起動して変更を適用します。
systemctl restart apache2
SuiteCRM用のMariaDBデータベースを作成する
まず、MariaDBのインストールを保護し、rootパスワードを設定する必要があります。次のスクリプトを実行することでそれを行うことができます:
mysql_secure_installation
以下に示すように、すべての質問に答えてください。
Enter current password for root: PressSet root password? [Y/n] y Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
終了したら、次のコマンドを使用してMariaDBシェルにログインします。
mysql -u root -p
MariaDBに接続したら、次のコマンドを使用してSuiteCRMのデータベースとユーザーを作成します。
MariadDB [(none)]> CREATE DATABASE suitecrm;
MariaDB [(none)]> CREATE USER 'suitecrm'@'localhost' IDENTIFIED BY 'password';
次に、次のコマンドを使用して、SuiteCRMデータベースにすべての権限を付与します。
MariaDB [(none)]> GRANT ALL PRIVILEGES ON suitecrm.* TO 'suitecrm'@'localhost';
次に、特権をフラッシュし、次のコマンドを使用してMariaDBシェルを終了します。
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
MariaDBデータベースとユーザーを作成したら、次のステップに進むことができます。
SuiteCRMをインストール
まず、wgetコマンドを使用して最新バージョンのSuiteCRMをダウンロードします。
wget https://suitecrm.com/files/147/SuiteCRM-7.12/578/SuiteCRM-7.12.1.zip
次に、次のコマンドを使用して、ダウンロードしたファイルを解凍します。
unzip SuiteCRM-7.12.1.zip
次に、抽出したディレクトリをApacheのデフォルトのルートディレクトリに移動します。
mv SuiteCRM-7.12.1 /var/www/html/suitecrm
次に、SuiteCRMディレクトリの所有権と権限を変更します。
chown -R www-data:www-data /var/www/html/suitecrm
chmod -R 755 /var/www/html/suitecrm
終了したら、次のステップに進むことができます。
SuiteCRM用にApacheを構成する
次に、インターネット上でSuiteCRMをホストするようにApacheを構成する必要があります。これを行うには、次のコマンドを使用してApache仮想ホスト構成ファイルを作成します。
nano /etc/apache2/sites-available/suitecrm.conf
次の行を追加します:
<VirtualHost *:80> DocumentRoot /var/www/html/suitecrm ServerName suitecrm.example.com <Directory /var/www/html/suitecrm> Options FollowSymLinks AllowOverride All </Directory> ErrorLog /var/log/apache2/suitecrm-error.log CustomLog /var/log/apache2/suitecrm-access.log common </VirtualHost>
ファイルを保存して閉じてから、次のコマンドを使用してSuiteCRM仮想ホスト構成ファイルをアクティブ化します。
a2ensite suitecrm.conf
次に、Apacheサービスをリロードして、構成の変更を適用します。
systemctl reload apache2
Apacheサービスのステータスを確認するには、次のコマンドを実行します。
systemctl status apache2
次の出力が得られます:
? apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2021-11-19 16:36:48 UTC; 4s ago Docs: https://httpd.apache.org/docs/2.4/ Process: 16290 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 16296 (apache2) Tasks: 6 (limit: 4679) Memory: 15.5M CPU: 99ms CGroup: /system.slice/apache2.service ??16296 /usr/sbin/apache2 -k start ??16297 /usr/sbin/apache2 -k start ??16298 /usr/sbin/apache2 -k start ??16299 /usr/sbin/apache2 -k start ??16300 /usr/sbin/apache2 -k start ??16301 /usr/sbin/apache2 -k start Nov 19 16:36:48 debian11 systemd[1]: Starting The Apache HTTP Server...
Apache Webサーバーを構成した後、SuiteCRMWebインターフェースへのアクセスに進むことができます。
AccessSuiteCRMWebインターフェイス
次に、Webブラウザーを開き、URL http://suitecrm.example.comを入力します。 SuiteCRMWebUIにアクセスします。次の画面が表示されます。
使用許諾契約に同意し、次へをクリックします ボタン。次のページが表示されます:
すべてのチェックでOKが返されることを確認してから、次へをクリックします。 ボタンをクリックして続行します。 SuiteCRM構成ページが表示されます:
データベース情報、管理者ユーザーの詳細、SMTPサーバーの仕様、ブランドの詳細、サイトのセキュリティ設定を入力し、次へをクリックします ボタン。次のページが表示されます:
次へをクリックします ボタン。 SuiteCRMログインページが表示されます:
管理者のユーザー名とパスワードを入力し、ログインをクリックします ボタン。次の画面にSuiteCRMダッシュボードが表示されます。
Apacheを設定した後、Let'sEncryptSSL証明書を使用してWebサイトを保護することをお勧めします。そのためには、システムにCertbotクライアントをインストールする必要があります。 Certbotは、EFF、Mozillaなどによって起動されたオープン認証局からLet's Encryptから証明書をフェッチし、それをWebサーバーに展開する使いやすいクライアントです。 Certbot Let's Encryptクライアントを使用すると、ドメインのSSL証明書を簡単にダウンロード、インストール、更新できます。
次のコマンドでCertbotをインストールできます:
apt-get install certbot python3-certbot-apache -y
Certbotクライアントが正常にインストールされたら、次のコマンドを実行して、WebサイトにLet'sEncryptSSLをインストールします。
certbot --apache -d suitecrm.example.com
以下に示すように、有効なメールアドレスを提供し、利用規約に同意するよう求められます。
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): [email protected] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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: Y Obtaining a new certificate Performing the following challenges: http-01 challenge for suitecrm.example.com Enabled Apache rewrite module Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/apache2/sites-available/suitecrm-le-ssl.conf Enabled Apache socache_shmcb module Enabled Apache ssl module Deploying Certificate to VirtualHost /etc/apache2/sites-available/suitecrm-le-ssl.conf Enabling available site: /etc/apache2/sites-available/suitecrm-le-ssl.conf
次に、次の出力に示すように、HTTPトラフィックをHTTPSにリダイレクトするか、すべてのトラフィックを安全なHTTPSアクセスにリダイレクトするようにNginxを構成するかを選択します。
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: No redirect - Make no further changes to the webserver configuration. 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
2と入力し、Enterキーを押してプロセスを開始します。インストールが完了すると、次の出力が表示されます。
Enabled Apache rewrite module Redirecting vhost in /etc/apache2/sites-enabled/suitecrm.conf to ssl vhost in /etc/apache2/sites-available/suitecrm-le-ssl.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://suitecrm.example.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=suitecrm.example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/suitecrm.example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/suitecrm.example.com/privkey.pem Your cert will expire on 2022-02-21. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
おめでとう!これで、Apacheを使用したSuiteCRMが正常にインストールされ、Debian11にSSLを暗号化しましょう。SuiteCRMでその他の機能を調べることができます。ご不明な点がございましたら、お気軽にお問い合わせください。