ウェブDeBLOG|トライデントコンピュータ専門学校 Webデザイン学科

トライデントコンピュータ専門学校 Webデザイン学科の公式ブログです。
学生インタビューや作品紹介、授業風景、プロジェクト発表会・イベント参加の様子から、
Web制作会社の情報や実践的な技術解説まで発信しています。
2026年、校舎は名古屋駅西口へ移転し、エスカ地下街から徒歩3分になりました。

サーバーを構築してa-blog cmsをインストールした ②

Centos-Logo.jpg

さてさて、前回ののつづきです。Webサイトを公開するためにはWebサーバーを構築しないといけませんので、Webサーバーパッケージhttpdを設定していきます。
その前に、iptablesでファイアー ウォールの構築をするのですが、ちょっと難しいので下記サイトを参考にしてください。
【参考】さくらのVPS を使いはじめる 3 – iptables を設定する

では、まずはhttpdがインストールされているか確認します。

# rpm -q httpd
httpd-2.2.3-83.el5.centos

入ってますね。
Appachの各種設定するために、httpd.confを編集していきましょう。

# vi /etc/httpd/conf/httpd.conf

Enterを押して、

#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
.....

だ〜と表示されますので、細かい文字の中からServerAdmin root@localhostを探して、サーバー管理者のメールアドレスに変更します。

# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin root@localhost

続けて#ServerName www.example.com:80という項目を探して、#を外しwww.example.com:80の部分をWebサイトのURLに使用するホスト名に書き換えます。今回はIPアドレスになります。さらに続けて、

Options FollowSymLinks ExecCGI IncludesNoExec

を

Options -Includes FollowSymLinks

に変更します。これでescキーを押して編集モードから抜け、

:wq

Enterを押して保存します。
httpdを再起動します。

# /etc/rc.d/init.d/httpd restart
Stopping httpd:     [  OK  ]
Starting httpd:      [  OK  ]

ServerNameで設定したIPアドレスにブラウザでアクセスしてみて下記のような表示が出れば成功です。

apach2test.jpg

サーバーの起動と一緒に起動するように設定をして確認します。

# chkconfig httpd on
# chkconfig --list httpd
httpd   0:off  1:off  2:on  3:on  4:on  5:on  6:off

となっていればOK。

まだまだ先は長いです。続けてMySQLの設定をしていきます。

rpm -qa mysql-server
mysql-server-5.0.95-5.el5_9

MySQLの文字コードを変更します。

vi /etc/my.cnf
# character-set
default-character-set=utf8
skip-character-set-client-handshake
# chkconfig mysqld on
# chkconfig --list mysqld
mysqld  0:off  1:off  2:on  3:on  4:on  5:on  6:off

を追記しておきます。vsftpdやhttpdのように自動起動にしたいので、

# /etc/rc.d/init.d/mysqld start

MySQLを起動します。

# /etc/rc.d/init.d/mysqld start

とりあえず、今日はここまで。

この記事に関連するQ&A

Webサイトを制作して公開する授業はありますか?

あります。1年後期の「進級制作」から、Webサイトを作品として制作します。授業では、デザインを画面上に実装するだけでなく、インターネット上で動かす経験も積みます。JS演習やWebアプリではFirebase HostingやGitHub Pages、PHPの授業ではレンタルサーバーを使います。

PHPについても学びますか?

2年前期の選択科目「Web開発基礎B」で学びます。基本文法からデータベースとの連携へ進み、最後はログイン、投稿、削除、返信、いいねの機能を備えたSNS風のコメント欄を作ります。完成したものはレンタルサーバーにアップロードして動かします。

Webデザイン学科

この記事を書いた人

Webデザイン学科

2009年から東海地域をはじめ、全国にWebデザイナー・エンジニアなどWebサイト制作者を輩出。基礎からプロになるために必要な技術・知識を学習しています。

トライデントコンピュータ専門学校募集イベントへのリンク
トライデントコンピュータ専門学校 Webデザイン学科 紹介バナー

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

“サーバーを構築してa-blog cmsをインストールした ②” への1件のフィードバック

  1. プロが選ぶ本物の道具店のアバター

    プロが選ぶ本物の店

    ファイヤーエスケープは国家検定品、高所より安全に降下できる。ゴルフ 卓球練習。厨房用品10000点。ネオ腰痛ベルトは腰の痛みを解消できます

あわせて読みたい