Userdir設定ファイルの編集 |
[root@ns1 conf.d]# vi /etc/httpd/conf.d/userdir.conf |
<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 disabled #17行目コメント化 |
# |
# To enable requests to /~user/ to serve the user's public_html |
# directory, remove the "UserDir disabled" line above, and uncomment |
# the following line instead: |
# |
UserDir public_html #24行目コメント解除 |
</IfModule> |
# Control access to UserDir directories. The following is an example |
# for a site where these directories are restricted to read-only. |
# |
<Directory "/home/*/public_html"> |
AllowOverride FileInfo AuthConfig Limit Indexes |
↓ .htaccessの許可をする場合は 32行目変更 |
AllowOverride All |
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec |
↓ CGI,SSIの許可をする場合は 33行目変更 |
Options IncludesNoExec ExecCGI FollowSymLinks |
Require method GET POST OPTIONS |
</Directory> |
サービス再起動 |
[root@ns1 conf.d]# systemctl restart httpd |
既存のユーザーにhtml用ディレクトリ作成とテストCGIファイル作成 |
[root@ns1 ~]# cd /home/hopu/ |
[root@ns1 hopu]# mkdir public_html |
[root@ns1 hopu]# chmod 711 /home/hopu/ |
[root@ns1 hopu]# chmod 755 /home/hopu/public_html/ |
[root@ns1 hopu]# chown hopu.hopu public_html/ |
[root@ns1 hopu]# cd public_html/ |
[root@ns1 public_html]# vi index.cgi |
[root@ns1 public_html]# chmod 755 index.cgi |
[root@ns1 public_html]# chown hopu.hopu index.cgi |
[root@ns1 public_html]# vi index.cgi |
#!/usr/local/bin/perl |
print "Content-Type: text/plain\n\ntest\n"; |
http://●●●/ ~ユーザー名 でアクセスを確認します(チルダ、「へ」のキーをShiftを押しながら入力します)
通常のhtmlファイルの表示テスト
CGIの表示テスト
テーマ:UNIX/Linux - ジャンル:コンピュータ
★CentOS7 まとめ
★Ubuntu14 まとめ
★Ubuntu12用無線アダプタ紹介
★Ubuntu12 まとめ
★Server 2008R2 まとめ
★SCCM2012R2 まとめ
★Windows10 アップグレード
★Windows7 まとめ
★Windows7 SSD まとめ
★Windows8 まとめ
★EaseUS Todo Backup Server
★Linux Destbision まとめ
★Linuxコマンド関連Index
★Zorin8.1まとめ
★Fedora17まとめ
★Fedora15まとめ
☆VB Script まとめ
★USB3.0で快適バックアップ
★リンク集・メール
・はじめての自宅サーバ構築 - Fedora/CentOS -
SCCM Backup 遠隔操作 VirtualBox FeliCaポート/パソリ ESXi
<%plugin_third_description>
<%plugin_third_content><%plugin_third_description2>