Apacheインストール(MacPort)
MacPortでApacheをインストールするのは非常に簡単です。
ターミナル操作ではありますが、1行でインストールは完了します。
ここではMacPortを利用したApacheのインストールの手順をご紹介します。
Apacheインストール(MacPort)
MacPortでApacheのインストールは1行のターミナル操作で完了します。
ですが、まずApacheのどのバージョンをインストールするのかを、
事前に決定しておく必要があります。
MacPortを利用してインストールができるApacheバージョンから、
インストールするバージョンの決定を行います。
ここでは以下のバージョンのインストールを行います。
apache2 2.2.32 (source)
The extremely popular second version of the Apache http server
Licenses: Apache-2
Maintained by: ryandesign openmaintainer
Categories: www
Platforms: darwin freebsd openbsd
Dependencies: lbzip2 openssl apr apr-util expat pcre perl5 zlib
Variants: eventmpm openldap preforkmpm universal workermpm
(引用)“apache search results”|The MacPorts Project — Available Ports
青色で示した部分がコンポーネントの名称です。
この名前を指定することで「Apache 2.2.32」がインストールされます。
インストールを行う際には以下コマンドを利用します。
sudo port install (コンポーネント名)
実際には以下のように指定します。
sudo port install apache2
実行するとすぐにインストールが開始されます。
しばらく待つとインストールが完了しターミナルが入力待ちになります。
インストール後に、インストール済みコンポーネントを確認します。
「apache2」が表示されておりインストールが正しくされていることが分かります。
※以下は同時にMySQLもインストールしています。
Apache(MacPort)のデフォルトディレクトリ
Apacheの使用ディレクトリを参考まで記載します。
なお、それぞれの環境によって異なっていると思いますのでhttpd.confを参照ください。
| Apache | MacPort |
|---|---|
| httpd | /opt/local/apache2/bin/httpd |
| httpd.conf | conf/httpd.conf(/opt/local/apache2/conf/httpd.conf) |
| ServerRoot | /opt/local/apache2 |
| LoadModule | modules/(/opt/local/apache2/modules/) |
| DocumentRoot | /opt/local/apache2/htdocs |
| ErrorLog | logs/error_log(/opt/local/apache2/logs/error_log) |
Step 2: Install Apache
$ sudo port install apache2A sample configuration file is provided in
/opt/local/apache2/conf/original/httpd.conf. Don’t edit this file; leave it as is so you can refer to the defaults later. The first time you install apache2, the sample configuration file will be copied to/opt/local/apache2/conf/httpd.conffor you. You can edit this file as desired. When you later upgrade apache2 to a newer version, MacPorts will upgrade the sample configuration file but will not modify yourhttpd.conf, so be sure to manually compare yourhttpd.confwith the new sample configuration file and bring over any relevant changes. You should also keep backup copies of yourhttpd.confin a safe place.
参考
The action
installis used to install a port. Once you determined the name of a port you want (possibly using port search), you can install it using this command. See Section 3.2.1, “Invoking Variants” on how to choose variants when installing a new port. For example,
$ sudo port install apache2 -preforkmpm +workermpminstalls the
apache2port without thepreforkmpm, but with theworkermpmvariant.If the installation of a port fails, you can enable verbose or debug output by giving the
-vor-dflag to port:
$ sudo port -v install apache2
The MacPorts Project — Download & Installation
Apacheのインストール on (Mac) OS X | Articles@www.e-mist.com
当サイト内のコンテンツおよび画像を含むすべてにおいて、管理人アルゴリズンが著作権を保持しております。
当サイトでご紹介しております写真等につきましては著作権の放棄はしませんが、
ライセンスフリーでご利用いただいて構いません。
コンテンツを有益であると感じていただけましたら非常に光栄です。
ありがとうございます。
サイト内コンテンツを引用される際には、出典元として当サイト(個別記事)へのリンクをお願いいたします。
申し訳ございませんが、無断転載、複製をお断りさせて頂いております。
公開日:
最終更新日:2017/02/10



