Creating subdomain in virtualhost in apache 2.0 on CentOS 6.4

天大地大妈咪最大 提交于 2019-12-06 06:17:57

I'm doing the following:

<VirtualHost *:80>
 DocumentRoot "/storage/www/domain.com"
 ServerName domain.com
 ServerAlias www.domain.com
 CustomLog /var/log/httpd/access_domain.com_log combined
 ErrorLog /var/log/httpd/error_domain.com_log
</VirtualHost>

To me it looks like this

<Directory /var/www/xxxxx/data/www/domain.com>
    Options -Includes +ExecCGI
    php_admin_value open_basedir "/var/www/xxxxxxxxx/data:."
    php_admin_flag engine on
</Directory>

<VirtualHost 155.155.255.152:80 >
    ServerName domain.com
    CustomLog /dev/null combined
    DocumentRoot /var/www/xxxxxxxxx/data/www/domain.com
    ErrorLog /dev/null
    ServerAdmin webmaster@domain.com
    ServerAlias www.domain.com
    SuexecUserGroup xxxxxxxxx xxxxxxxxx
    ScriptAlias /cgi-bin/ /var/www/xxxxxxxxx/data/www/domain.com/cgi-bin/
    AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
    AddType application/x-httpd-php-source .phps
    php_admin_value open_basedir "/var/www/xxxxxxxxx/data:."
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f webmaster@domain.com"
    php_admin_value upload_tmp_dir "/var/www/xxxxxxxxx/data/mod-tmp"
    php_admin_value session.save_path "/var/www/xxxxxxxxx/data/mod-tmp"
</VirtualHost>

<VirtualHost 155.155.255.152:443 >
    SSLCertificateFile /var/www/httpd-cert/xxxxxxxxx/domain.crt
    SSLCertificateKeyFile /var/www/httpd-cert/xxxxxxxxx/domain.key
    SSLEngine on
    ServerName domain.com
    CustomLog /dev/null combined
    DocumentRoot /var/www/xxxxxxxxx/data/www/domain.com
    ErrorLog /dev/null
    ServerAdmin webmaster@domain.com
    ServerAlias www.domain.com
    SuexecUserGroup xxxxxxxxx xxxxxxxxx
    ScriptAlias /cgi-bin/ /var/www/xxxxxxxxx/data/www/domain.com/cgi-bin/
    AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
    AddType application/x-httpd-php-source .phps
    php_admin_value open_basedir "/var/www/xxxxxxxxx/data:."
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f webmaster@domain.com"
    php_admin_value upload_tmp_dir "/var/www/xxxxxxxxx/data/mod-tmp"
    php_admin_value session.save_path "/var/www/xxxxxxxxx/data/mod-tmp"
</VirtualHost>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!