レンタルサーバー、サーバー構築の情報サイト|08-14.バーチャルドメイン設定

サーバーを運用する際に自前にした場合、業者委託、レンタルした場合の必要な知識、実務に関しての情報を掲載しております
トップに戻ります

00-本サイトについて
 00-01.サイト運用者

 00-02.当サイトの運用環境



08-14.バーチャルドメイン設定

postfixのバーチャルドメイン設定です。

設定

[root@fedora ~]# vi /etc/postfix/virtual Postfixバーチャルドメイン設定ファイル編集
以下を最終行へ追加

virtual.com anything
@virtual.com @fedorasrv.com

[root@fedora ~]# postmap /etc/postfix/virtual Postfixバーチャルドメイン設定反映

[root@fedora ~]# vi /etc/postfix/main.cf Postfix設定ファイル編集
virtual_maps = hash:/etc/postfix/virtual 最終行へ追加

[root@fedora ~]# /etc/rc.d/init.d/postfix restart Postfix再起動
postfix を停止中: [ OK ]
postfix を起動中:

08-15.データベースサーバー構築(MySQL)
通常はインストールする必要は無いと思います。
管理権限で新規にレンタルサーバーでインストールする事ができる場合もあるかもしれません。

・インストール

yum -y install mysql-server

設定

[root@fedora ~]# vi /etc/my.cnf MySQL設定ファイル編集
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

・起動

[root@fedora ~]# /etc/rc.d/init.d/mysqld start MySQL起動
MySQL データベースを初期化中: Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h fedora.fedorasrv.com password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[ OK ]
MySQL を起動中: [ OK ]

[root@fedora ~]# chkconfig mysqld on MySQL自動起動設定

・設定

[root@fedora ~]# mysql -u root MySQLサーバーへrootユーザでログイン
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 5.0.21

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set password for root@localhost=password('rootパスワード'); 
接続元ホストがlocalhostのrootユーザにパスワード設定
Query OK, 0 rows affected (0.00 sec)

mysql> set password for root@'fedora.fedorasrv.com'=password('rootパスワード'); 
接続元ホストが自ホストのrootユーザにパスワード設定

Query OK, 0 rows affected (0.00 sec)

mysql> select user,host,password from mysql.user; 登録済ユーザ、パスワード確認
+------+----------------------+------------------+
| user | host | password |
+------+----------------------+------------------+
| root | localhost | **************** | 接続元ホストがlocalhostのrootユーザにパスワードが設定された
| root | fedora.fedorasrv.com | **************** | 接続元ホストが自ホストのrootユーザにパスワードが設定された
| | localhost | |
| | fedora.fedorasrv.com | |
+------+----------------------+------------------+
4 rows in set (0.00 sec)

mysql> exit MySQLサーバーからログアウト
Bye

[root@fedora ~]# mysql -u root
接続元ホストがlocalhostのrootユーザでパスワードなしでMySQLサーバーへログインできないことを確認
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

[root@fedora ~]# mysql -u root -h fedora.fedorasrv.com
接続元ホストが自ホストのrootユーザでパスワードなしでMySQLサーバーへログインできないことを確認
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

[root@fedora ~]# mysql -u root -prootパスワード
接続元ホストがlocalhostのrootユーザでパスワードありでMySQLサーバーへログインできることを確認
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 5.0.21

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> exit MySQLサーバーからログアウト
Bye

[root@fedora ~]# mysql -u root -h fedora.fedorasrv.com -prootパスワード
接続元ホストが自ホストのrootユーザでパスワードありでMySQLサーバーへログインできることを確認
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 5.0.21

戻る

−− 弊社メインサイト −−
ホームページ製作、システム開発はMSweb - 大阪
ホームページ製作・作成、システム開発、サーバー構築・保守にはMSwebをご利用下さい

携帯サイト


−− 弊社姉妹サイト −−
ホームページ製作 発注企業に理解して欲しい内容
ホームページ発注企業、製作会社向けの内容です。

−− 弊社姉妹サイト −−
WEBシステム開発|PHPとPostgreSQLの開発例
入門者用のPHPとPostgreSQLを使ったWEBシステムの開発演習です。

−− 弊社姉妹サイト −−
ホームページ製作 大阪 | 製作手順の紹介−MSweb
ホームページ製作の手順をご紹介しています、デザイン、HTML、スタイルシートなどについて記載しています。

オープンソース・サンプル
MSweb OpenPNE 大阪
オープンソースのSNSです。ご興味があり使用されたい方は、 ID「msweb@msweb.biz」、パスワード「gua8hkj3」で管理ページにログインできます。
管理ページ

オープンソース・サンプル
MSweb ブログ
オープンソースのブログです。ご興味があり使用されたい方は、 ID「admin」、パスワード「bd0e86」で管理ページにログインできます。
管理ページ

オープンソース・サンプル
XOOPS
代表的なCMSのXOOPSです。ご興味があり使用されたい方は、 ユーザ名「msweb」、パスワード「as4g3mz」で管理者でログインできます。

オープンソース・サンプル
EC|CUBE(メイン・ページ)
EC|CUBE(管理ページ)
オープンソースの通販システムです。ご興味があり使用されたい方は、 ID「msweb」、パスワード「fd4upd2」で管理ページにログインできます。

オープンソース・サンプル
Joomla(メイン・ページ)
Joomla(管理ページ)
オープンソースのCMSです。ご興味があり使用されたい方は、 ID「admin」、パスワード「A2gT6B7F」で管理ページにログインできます。

オープンソース・サンプル
SquirrelMail
オープンソースのWEBメールのシステムです、OP25Bの影響を受けません。

オープンソース・サンプル
Mailman
Mailman(管理ページ)
オープンソースの電子メールでの討論やメルマガの配送リストを管理するためのシステムです。 サンプルのため投稿はできません。

Copyright (c) 2007 MSweb All Rights Reserved 腕時計 販売サイト my-watch.biz