码迷,mamicode.com
首页 > Web开发 > 详细

apache罗列

时间:2014-11-01 06:29:35      阅读:364      评论:0      收藏:0      [点我收藏+]

标签:default

  1. restorecon -Rv /srv/  恢复http权限(如果默认不是http的,可以用semanage fcontext)

  2. /etc/httpd/conf.d/00vhost.conf

    <VirtualHost *:80>

    DocumentRoot /srv/default/www

    CustomLog "logs/default-vhost.log" combined

    </VirtualHost>

    <Directory /srv/default/www>

    Require all granted

    </Directory>

  3. /etc/httpd/conf.d/01vhost.conf

    <VirtualHost *:80>

    ServerName www0.example.com

    DocumentRoot /srv/www0.example.com/www

    ServerAlias www0

    CustomLog "logs/www0.example.com.log" combined

    </VirtualHost>

    <Directory /srv/www0.example.com/www>

    Require all granted

    </Directory>

  4. 自动跳转的ssl

    <VirtualHost *:443>

    ServerName demo.example.com

    SSLEngine on

    SSLCertificateFile /etc/pki/tls/certs/demo.example.com.crt

    SSLCertificateKeyFile /etc/pki/tls/private/demo.example.com.key

    SSLCertificateChainFile /etc/pki/tls/certs/example-ca.crt

    DocumentRoot /srv/www0/www

    </VirtualHost>

    <Directory /srv/www0/www>

    Require all granted

    </Directory>

    <VirtualHost *:80>

    ServerName www0.example.com

    RewriteEngine on

    RewriteRule ^(/.*)$ https://%{HTTP_POST}$1 [redirect=301]

    </VirtualHost>

  5. ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

    apache user and group

    selinux:httpd_sys_script_exec_t

  6. serving php:

    mod_php

    <FilesMatch \.php$>

    SetHandler application/x-httpd-php

    </FilesMatch>

    DirectoryIndex index.php

  7. serving phython:

    WSGIScriptAlias /myapp/ /srv/myapp/www/myapp.py

  8. connect db

    如果数据库用remote host,selinux里httpd_can_network_connect_db需要设置为1

  9. 如果不是一个常用的数据库端口,

    httpd_can_network_connect = 1

本文出自 “血爪哇” 博客,请务必保留此出处http://sunrain990.blog.51cto.com/3700585/1570505

apache罗列

标签:default

原文地址:http://sunrain990.blog.51cto.com/3700585/1570505

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!