CentOS 7にApacheをインストールする方法
CentOS 7サーバーにApache 2.4をインストールする方法を説明します。安定したウェブサーバーを構築するための前提条件と手順を解説します。
Giteaは、Gitを搭載した代替オープンソースの自己ホスト型バージョン管理システムです。GiteaはGolangで記述されており、あらゆるプラットフォームでホストされる軽量のソリューションです。
sudo
特権を持つrootユーザーまたは非rootユーザー。最初にシステムを更新します。
sudo yum update
Gitをインストールします。
sudo yum -y install git
Giteaは以下のデータベースサーバーをサポートしています。
このチュートリアルでは、MariaDBサーバーを使用します。
sudo yum -y install mariadb-server
完了したら、MariaDBが有効で実行されていることを確認します。
systemctl enable mariadb.service
systemctl start mariadb.service
その後、以下のコマンドを実行して、rootパスワードを作成し、リモートrootアクセスを禁止することにより、MariaDBサーバーを保護します。
sudo mysql_secure_installation
プロンプトが表示されたら、ガイドに従って以下の質問に答えます。
Enter current password for root (enter for none): Just press the Enter
Set root password? [Y/n]: Y
New password: Enter password
Re-enter new password: Repeat password
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を再起動します。
sudo systemctl restart mariadb.service
MariaDBコンソールにログインします。
sudo mysql -u root -p
次に、上記で作成したパスワードを入力してログインします。MariaDBウェルカムメッセージが表示されます。
というデータベースを作成しますgitea
。
CREATE DATABASE gitea;
giteauser
新しいパスワードで呼び出されるデータベースユーザーを作成します。
CREATE USER 'giteauser'@'localhost' IDENTIFIED BY 'new_password_here';
new_password_here
強力で複雑なパスワードに置き換えてください。
次に、ユーザーにデータベースへのフルアクセスを許可します。
GRANT ALL ON gitea.* TO 'giteauser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;
最後に、変更を保存して終了します。
FLUSH PRIVILEGES;
EXIT;
Giteaを実行するユーザーを作成します。
sudo adduser --system --shell /bin/bash --comment 'Git Version Control' --user-group --home-dir /home/git -m git
必要なディレクトリ構造を作成します。
sudo mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
sudo chown git:git /var/lib/gitea/{data,indexers,log}
sudo chmod 750 /var/lib/gitea/{data,indexers,log}
sudo mkdir /etc/gitea
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea
Giteaバイナリは、次のコマンドを実行してダウンロードできます。以下のリンクを、このダウンロードページからの最新バージョンのリンクに置き換えてください。
sudo wget -O gitea https://dl.gitea.io/gitea/1.6.1/gitea-1.6.1-linux-amd64
sudo chmod +x gitea
バイナリをグローバルな場所にコピーします。
sudo cp gitea /usr/local/bin/gitea
Linuxサービスファイルを作成します。
sudo touch /etc/systemd/system/gitea.service
任意のテキストエディターを使用して、この新しく作成したファイルを開き、次のように入力します。
[Unit]
Description=Gitea (Git with a cup of tea)
After=network.target
After=mariadb.service
[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
# If you want to bind Gitea to a port below 1024 uncomment
# the two values below
###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
起動時にGiteaを有効にして起動します。
sudo systemctl daemon-reload
sudo systemctl enable gitea
sudo systemctl start gitea
Giteaが実行されていることを確認します。
sudo systemctl status gitea
firewalldでGiteaのデフォルトポートへのトラフィックを有効にします。
sudo firewall-cmd --add-port 3000/tcp --permanent
sudo firewall-cmd --reload
最後に、Webブラウザーを開いて次のように指定します。
http://YOUR_SERVER_IP:3000/install
画面の指示に従ってGiteaのセットアップを完了します。
CentOS 7サーバーにApache 2.4をインストールする方法を説明します。安定したウェブサーバーを構築するための前提条件と手順を解説します。
CentOS 7にSeafileサーバーをインストールする方法。Seafile(コミュニティバージョン)は、ownCloudに似た無料のオープンソースファイル同期および共有ソリューションです。
CentOS 7にGraylogサーバーをインストールし、ログ管理を行う方法を学びます。
CentOS 7サーバーにApache 2.4をインストールする方法を説明します。安定したウェブサーバーを構築するための前提条件と手順を解説します。
FreeBSD 11.1におけるBlacklistdのインストール方法について詳しく解説します。この方法を通じて、強力なセキュリティ対策を実装できます。
サーバーマネージャーを使用して、Windows Serverの管理が向上します。セキュリティリスクを軽減し、効率的な管理を実現します。
CentOS 7にSeafileサーバーをインストールする方法。Seafile(コミュニティバージョン)は、ownCloudに似た無料のオープンソースファイル同期および共有ソリューションです。
Snortは無料のネットワーク侵入検知システムです。最新の方法で、SnortをDebianにインストールし、設定する手順を紹介します。ネットワークのセキュリティを強化しましょう。
CentOS 7にGraylogサーバーをインストールし、ログ管理を行う方法を学びます。
WindowsサーバーでWebサイトを実行している場合、電子メールも受信できるようにするためにhMailServerを使用する方法を解説します。
FiveMサーバーをUbuntu 19.04にインストールするための詳細なガイド。必要条件からインストール、起動、トラブルシューティングまで、すべてのステップを含みます。
Debian 10にWebDAVをデプロイする方法を学び、WsgiDAVとSSL証明書で安全な接続を実現しましょう。
ヘルスケアにおけるAIは、過去数十年から大きな飛躍を遂げました。したがって、ヘルスケアにおけるAIの未来は、日々成長を続けています。