スポンサードリンク
Linuxユーザー別のhomeフォルダにて、ホームページを公開出来る方法の説明です。
Apacheのデフォルト設定の場合
公開出来るフォルダ(ディレクトリ)は、Apacheのhttpd.confに設定されるディレクトリのみです。
例:DocumentRoot"/var/www/html"
上記の場所にhtmlファイルを置く事で、ホームページを公開する事が出来ます。
指定アドレスは以下の通り
【 http://localhost/ 】
※localhostにはLinuxに割り当てたローカルIPが入ります。
ApacheにはLinuxユーザー別でも公開出来るようになっており
【 /home/ユーザー別フォルダ名 】で公開する事が出来ます。
例えば:ratanaと言うユーザーのアドレスは以下の通りになります。
【 http://localhost/~ratana/ 】
ユーザー【 ratana 】のhtmlを置く場所は、Linuxの/home/ratana/public_htmlと言うフォルダ(ディレクトリ)に置くと外部アクセス(公開)が可能になります。
フォルダの属性に付いては
ratana[777]
|--public_html[777]
※(ftpアクセスの上、public_htmlフォルダ作成にて属性変更すればOKです。
※2、新規ユーザーを作成される場合特にフォルダの変更は必要ありません。
例:ratana
※3、FTPアクセスユーザーの追加方法は(vsftp利用の場合)【 vsftpd.chroot.list 】&【 vsftp.user_list 】にそれぞれ追加編集して下さい編集方法はこちらを参照して下さい。

httpd.conf編集方法 httpd.cofの編集方法はこちらを参照して下さい。
httpd.confをエディタで開き以下の記述を探してください。
geditで開いて「Ctrl」キー「F」キーで【 Directory /home/*/public_html 】を検索するとすぐに見つかると思います。
以下の項目の"#"シャープを外し、有効にします。
※この記述は【 /home/任意のユーザー名/public_html 】のルートへのアクセスを有効にする記述です。
#<Directory /home/*/public_html> # AllowOverride FileInfo AuthConfig
Limit # Options MultiViews Indexes SymLinksIfOwnerMatch
IncludesNoExec # <Limit GET POST OPTIONS> # Order
allow,deny # Allow from all # </Limit> #
<LimitExcept GET POST OPTIONS> # Order deny,allow #
Deny from all # </LimitExcept>
#</Directory> |

以下のようにコメントアウトしてください。
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory> |
次に以下の記述【 UserDir disable 】と【 #UserDir public_html 】をそれぞれ変更します。
<IfModule mod_userdir.c> # # UserDir is disabled by default
since it can confirm the presence # of a username on the system
(depending on home directory # permissions). #
UserDir disable
# # To enable requests to /~user/ to serve the user's
public_html # directory, remove the "UserDir disable" line above, and
uncomment # the following line instead: #
#UserDir public_html
|

【 UserDir disable 】ユーザーディレクトリ無効化→【 #UserDir disable 】"#"を付加してこの記述を無効とし、【 #UserDir
public_html 】ユーザーディレクトリを有効にします→【 UserDir public_html 】"#"を外し、ディレクトリを有効とします。
<IfModule mod_userdir.c> # # UserDir is disabled by default
since it can confirm the presence # of a username on the system
(depending on home directory # permissions). #
#UserDir disable
# # To enable requests to /~user/ to serve the user's
public_html # directory, remove the "UserDir disable" line above, and
uncomment # the following line instead: #
UserDir public_html
|
以上のようにthhpd.confの設定が完了出来ましたら保存して、Apacheの再起動を行ってください。Apacheの再起動方法はこちらを参照してみてください。
FTPアクセス後
新規フォルダ【 public_html 】を作成し、属性[777]に変更しpublic_htmlフォルダ以下にhtmlファイルをアップすればhtmlにアクセスすることが可能です。
※Linux上で操作される場合は、【 /home/任意のユーザー 】以下にpublic_htmlフォルダを作成し、htmlファイルを置けば外部から閲覧する事が出来ます。
※2、以下のソフトはffftpを使用。

以上簡単ですがユーザー別ホームページ公開方法の説明は終わりです。
このページはフレーム形式です。メニューを表示するにはここをクリック
スポンサードリンク
|
|