Apacheのインストール

Apacheとは

Apache HTTP Server は、The Apache Software Foundation(Apacheソフトウェア財団) によって管理されている、
Webサーバソフトウェアです。


Apacheのインストール状況確認

コマンド

aptitude show apache2


root@debian:/home/user1# aptitude show apache2

Package: apache2
State: not installed
Version: 2.2.22-13
Priority: optional
Section: httpd
Maintainer: Debian Apache Maintainers <[email protected]>
Architecture: i386
Uncompressed Size: 29.7 k
Depends: apache2-mpm-worker (= 2.2.22-13)
apache2-mpm-prefork (= 2.2.22-13)
apache2-mpm-event (= 2.2.22-13) apache2-mpm-itk (= 2.2.22-13),
apache2.2-common (= 2.2.22-13)
Provided by: apache2-mpm-event, apache2-mpm-itk, apache2-mpm-prefork,
Description: Apache HTTP Server metapackage
The Apache Software Foundation's goal is to build a secure, efficient and
extensible HTTP server as standards-compliant open source software. The result
long been the number one web server on the Internet.

It features support for HTTPS, virtual hosting, CGI, SSI, IPv6, easy scripting
and database integration, request/response filtering, many flexible
authentication schemes, and more.
Homepage: http://httpd.apache.org/


Apacheのインストール

インストール前に、念のためにダウンロードサイト情報を更新しておきます。

aptitude更新コマンド

aptitude update


Apacheインストールコマンド

aptitude install apache2

root@debian:/home/user1#} aptitude install apache2
Do you want to continue? [Y/n/?]} Y(もしくはそのままEnter)


インストール後、正常にインストールされたかどうかを
aptitude show apache2 で確認。

root@debian:/home/user1# aptitude show apache2
{Package: apache2
State: installed



Apacheアンインストールコマンド

aptitude purge apache2

root@debian:/home/user1# aptitude purge apache2
Do you want to continue? [Y/n/?]


Apache起動コマンド

/etc/init.d/apache2 start

root@debian:/home/user1# /etc/init.d/apache2 start
Starting web server: apache2.

※既に起動されている場合、起動済みのメッセージが表示される。
Starting web server: apache2httpd (pid 10288) already running.


Apache停止コマンド

/etc/init.d/apache2 stop

root@debian:/home/user1# /etc/init.d/apache2 stop
Stopping web server: apache2 ... waiting .


Apache動作確認コマンド

telnet 127.0.0.1 80

root@debian:/home/user1# telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

TCPポート80で接続完了。

GET

root@debian:/home/user1# telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body></html>
Connection closed by foreign host.

HTMLデータ取得。















最終更新:2013年05月16日 09:18