2014.02.19 [水] サーバーを構築してa-blog cmsをインストールした ②
さてさて、前回ののつづきです。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アドレスにブラウザでアクセスしてみて下記のような表示が出れば成功です。
サーバーの起動と一緒に起動するように設定をして確認します。
# 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 [client] default-character-set=utf8 [mysql] default-character-set=utf8 [mysqldump] default-character-set=utf8
を追記しておきます。vsftpdやhttpdのように自動起動にしたいので、
# chkconfig mysqld on # chkconfig --list mysqld mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
MySQLを起動します。
# /etc/rc.d/init.d/mysqld start
とりあえず、今日はここまで。
- 関連記事
-
- 手軽に目次機能を導入できる「TOC」がダウンロードできなかったので。 (2017/11/11)
- ターミナルを学校のProxy環境で使う時の設定 (2017/05/05)
- SyntaxHighlighter4.0.1にアップデート (2017/04/30)
- ScrollMagicでアニメーション (2015/09/25)
- ScrollMagicを調べた。 (2015/08/29)
- WordPressでCrayon Syntax Highlighterプラグイン (2015/06/09)
- canvas要素でパーティクル vol.2 (2015/04/18)
- canvas要素でパーティクル vol.1 (2015/04/16)
- 特別授業「CSS3 Animation」 (2014/09/02)
- 忘れていた「Google Web Designer」を起動してみた。 (2014/03/22)