| # yum install httpd |
| AddDefaultCharset off |
| # /etc/init.d/httpd start |
| # chkconfig httpd on |
認証されたLDAPグループmanagerが,WebDAVにより/var/www/html/abcディレクトリに書き込めるようにします。
| # chmod 775 /var/www/html/abc # chown apache:manager /var/www/html/abc |
|
| # /etc/init.d/httpd restart |
| # /etc/rc.d/init.d/httpd configtest ←/etc/httpd/conf/httpd.confの文法チェック Syntax OK ←このように表示されたら大丈夫 |








ns.shitomi.jp及びmail.shitomi.jpのDocumentRootに/var/www/html/error,www.shitomi.jp,www.shitomi.net及びwww.shitomi.comのDocumentRootに/var/www/html/wwwをそれぞれ指定します。
| # chmod 775 /var/www/html/www # chown apache:Administrators /var/www/html/www |
|
| # /etc/init.d/httpd restart |
|
アカウントabcにおいて,Webページを/home/abc/public_htmlで作成可能にするとともに,CGIを/home/abc/public_html/cgi-binで実行可能にする。
| $ mkdir -p /home/abc/public_html/cgi-bin |
| # chmod 755 /home/abc |
| # chcon -R system_u:object_r:httpd_user_content_t /home/*/public_html |
|
| ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" ScriptAlias /~abc/cgi-bin/ "/home/abc/public_html/cgi-bin/" |
|
| #AddHandler cgi-script .cgi |
| # chmod 4511 /usr/sbin/suexec |
| can_exec(httpd_t, httpd_user_content_t) r_dir_file(httpd_t, httpd_user_content_t) |
| # cd /etc/selinux/targeted/src/policy # make clean # make reload |
| # /etc/init.d/httpd restart |
443番ポート(SSL)でApacheが利用できるようにします。
| # yum install mod_ssl |
| <VirtualHost _default_:443> # General setup for the virtual host, inherited from global configuration #DocumentRoot "/var/www/html" #ServerName www.example.com:443 DocumentRoot "/var/www/html/db" ServerName db.shitomi.jp:443 |
| # /etc/init.d/httpd restart |
| # cd /tmp # openssl req -new -out csr.pem |
| Using configuration from /usr/share/ssl/openssl.cnf Generating a 1024 bit RSA private key .......................++++++ ............++++++ writing new private key to 'privkey.pem' Enter PEM pass phrase:[パスワードを入力] Verifying password - Enter PEM pass phrase:[パスワードを再入力] ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [GB]:JP State or Province Name (full name) [Berkshire]:Miyagi Locality Name (eg, city) [Newbury]:Sendai Organization Name (eg, company) [My Company Ltd]:Individual Organizational Unit Name (eg, section) []:[リターンキーを押す] Common Name (eg, your name or your server's hostname) []:db.shitomi.jp Email Address []:[リターンキーを押す] Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:[リターンキーを押す] An optional company name []:[リターンキーを押す] |
| # openssl rsa -in /tmp/privkey.pem -out /etc/pki/tls/private/localhost.key |
| # openssl x509 -inform pem -outform der -in /etc/pki/CA/cacert.pem -out /tmp/ca.cer |
| # cd /etc/pki/tls/misc # openssl ca -out /etc/pki/tls/certs/localhost.crt -infiles /tmp/csr.pem |
| # /etc/init.d/httpd restart |
| # /etc/init.d/httpd restart |