Quantcast
Channel: CSSタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8764

ApacheでWebサーバー備忘録

$
0
0
ApacheでWebサーバー備忘録 Apacheとは 無料のWebサーバーソフトウェア。現在、最も世界でShareをとっているWebサーバーソフトウェア。 1995年から歴史が長く、安定性やmodule機能の豊富さ、ソフトウェアとの互換性の良さに定評がある。 他にもMicrosoftのIISやnginxがweb サーバーとしてよく採用されている。 Apache Install 以下のWebsiteで.Zipファイルをダウンロードする。 C:などで展開して、Apache/conf/httpd.confを開いて、#ServerName*をコメントアウトを外して、ServerName*とする。 ServerName www.example.com:80 あとはC:Apache24binで以下のコマンドを実行するとApache Webサービスが開始される。 C:Apache24\bin>httpd -k start Apache起動PCなら、http://localhost/ で、その他のPCなら http://192.168.**.***/ で、閲覧できる。 ブラウザ表示で"It works!"が出れば正常にアクセスできている。 Web page公開は適当にフォルダを作成し、C:Apache/conf/httpd.confを開いて以下の該当箇所のパスを修正する。 DocumentRoot "C:\xampp\webroot" <Directory "C:\xampp\webroot"> 公開フォルダの直下にhtmlファイルを置いて、先ほどと同様にhttp://localhost/ か http://192.168.**.***/ で開くと、web pageが表示される。※Apacheは再起動 C:\Apache24\bin>httpd -k restartする。 フォルダ構造 webroot/ ├─ index.html ├─ css/ ├─ style.css ├─ img/ ├─ sample.jpg index.html <!doctype html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>HTML Sample</title> <link rel="stylesheet" href="css/style.css"> <!-- <script type="text/javascript" src="sample.js"></script> --> </head> <body> <section class="wrapper"> <div class="container"> <div class="content"> <h2 class="heading">#######################</h2> <div class="list"> <div class="list-item">######################################</div> </div> </div> </div> </section> </body> </html> style.css /* container */ .wrapper{ width:100%; background-image:url(../img/sample.jpg); background-repeat:no-repeat; background-size:cover; background-position: center center; } .wrapper .container{ max-width:1000px; margin:0px auto; padding:80px 0px; } /* content */ .wrapper .content .heading{ margin:0px 0px 40px 0px; color:#ffffff; font-size: 24px; font-weight: normal; text-align: center; } @media (min-width: 992px) { .wrapper .content .list { display: flex; align-items: center; justify-content: center; } } .wrapper .content .list-item { padding:30px; line-height:1.8rem; color:#ffffff; text-align:center; } @media (min-width: 992px) { .wrapper .content .list-item { width:50%; } } 表示されるweb page Apache module install Apacheには豊富なmoduleがあり、以下一覧のあるLinkです。非常に多くのmodleが標準で備わっています。 静的なモジュール(Install時に既に入っているもの) デフォルトでは以下のモジュールが入っている。 C:\Apache24\bin>httpd -l Compiled in modules: core.c - 常に使用可能な Apache HTTP サーバのコア機能 mod_win32.c - 起動時や再起動時に実行コードとモジュールをサーバにロードする mpm_winnt.c - Windows NT 向けに最適化されたマルチプロセッシングモジュール http_core.c - 常に使用可能な Apache HTTP サーバのコア機能 mod_so.c - 起動時や再起動時に実行コードとモジュールをサーバにロードする 動的なモジュール(Install後に追加する必要があるもの) C:\Apache24\bin>httpd -M Loaded Modules: actions_module (shared) alias_module (shared) allowmethods_module (shared) asis_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_groupfile_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) cgi_module (shared) dir_module (shared) env_module (shared) include_module (shared) isapi_module (shared) log_config_module (shared) mime_module (shared) negotiation_module (shared) setenvif_module (shared) まとめ Apacheのinstallと簡単なweb siteを表示した。非常に簡単にWeb siteを立てられ、初心者でWeb siteに興味のある方は簡単にやってみるといいと思った。

Viewing all articles
Browse latest Browse all 8764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>