ホームページ  >  記事  >  運用・保守  >  CentOS に Apache をインストールする方法

CentOS に Apache をインストールする方法

王林
王林転載
2020-06-24 17:45:125657ブラウズ

Apache を centos にインストールする方法は、 1. [yum install httpd] コマンドを実行して httpd をインストールします; 2. 設定ファイルを開き、[AllowOverride None] を [AllowOverride All] に変更します; 3. 再起動しますサーバー。

CentOS に Apache をインストールする方法

(推奨チュートリアル: apache 初心者からマスターまで )

具体的な方法は次のとおりです。

1. httpd をインストールします


yum install httpd

httpd をインストールすると、次の依存関係パッケージが自動的にインストールされます。

CentOS に Apache をインストールする方法

y を選択して、ダウンロードしたインストールパッケージ。

2. Configuration

設定ファイルを開いて、中のAllowOverride NoneをすべてAllowOverride Allに変更します

vi httpd.conf

ちなみに、DirectoryIndexのindex.htmlの後にindex.htmのindexを追加します。 php index.shtml

:wq 保存して終了

3. サーバーを再起動します

service httpd restart
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动

4Test

ブラウザに対応する URL を入力し、以下のインターフェースが表示されます。設定が成功したことを意味します。

CentOS に Apache をインストールする方法

以上がCentOS に Apache をインストールする方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事はcsdn.netで複製されています。侵害がある場合は、admin@php.cn までご連絡ください。