Plesk WWW前缀

时间:2013-08-14 15:15:57

标签: apache url-rewriting subdomain plesk domain-aliasing

我的域名WWW前缀有问题。每当我转到域http://mydomain.com时,我都会得到正确的索引页面。但是,使用www前缀,我得到了plesk默认索引页面。

我有一个名为* .mydomain.com的子域,它指向它的父httpdocs目录,这是一个url重写到我们的销售人员的个人资料页面所需的(见下文)。对于mydomain.com,还有一个完全不同的域的别名(正如您将在last_httpd.include中看到的那样)

我似乎无法缩小范围。在.htaccess中注释掉url重写似乎不起作用,也没有删除* .mydomain.com子域。

我已经提供了我所能提供的东西,或许可以对事情的设置提供一些见解。在此先感谢您的帮助。

The www record in DNS is set as an A(host) record.

以下是主域的.htaccess文件的内容。编辑域名的原因显而易见......

#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
</ifmodule>
#End Gzip

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomain.com
RewriteCond %{HTTP_HOST} ^(.+).mydomain.com
RewriteRule ^(.*)$ http://mydomain.com/agents/agent.php?agent=%1 [P,L]

我在/var/vhosts/www/mydomain.com/conf /

中的主域的last_http.include文件
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
#
#IF YOU REQUIRE TO APPLY CUSTOM MODIFICATIONS, PERFORM THEM IN THE  FOLLOWING FILES:

#/var/www/vhosts/mydomain.com/conf/vhost.conf
#/var/www/vhosts/mydomain.com/conf/vhost_ssl.conf
<IfModule mod_ssl.c>

<VirtualHost 10.10.10.10:443 >
    ServerName "mydomain.com"
        ServerAlias  "www.mydomain.com"
                        ServerAlias  "ipv4.mydomain.com"
                UseCanonicalName Off
    ServerAlias  "mydomainalias.com"
    ServerAlias  "www.mydomainalias.com"
        ServerAlias  "ipv4.mydomainalias.com"


<IfModule mod_suexec.c>
    SuexecUserGroup "mydomain" "psacln"
</IfModule>

    ServerAdmin  "admin@mydomain.com"

    DocumentRoot "/var/www/vhosts/mydomain.com/httpdocs"
    CustomLog /var/www/vhosts/mydomain.com/statistics/logs/access_ssl_log plesklog
    ErrorLog  "/var/www/vhosts/mydomain.com/statistics/logs/error_log"



<IfModule mod_userdir.c>
    UserDir "/var/www/vhosts/mydomain.com/web_users"
</IfModule>

    ScriptAlias  "/cgi-bin/" "/var/www/vhosts/mydomain.com/cgi-bin/"



    Alias  "/plesk-stat" "/var/www/vhosts/mydomain.com/statistics"
    <Location  /plesk-stat/>
        Options +Indexes
    </Location>
    <Location  /plesk-stat/logs/>
        Require valid-user
    </Location>
    Alias  /webstat /var/www/vhosts/mydomain.com/statistics/webstat
    Alias  /webstat-ssl /var/www/vhosts/mydomain.com/statistics/webstat-ssl
    Alias  /ftpstat /var/www/vhosts/mydomain.com/statistics/ftpstat
    Alias  /anon_ftpstat /var/www/vhosts/mydomain.com/statistics/anon_ftpstat
    Alias  /awstats-icon /var/www/html/awstats/icon


    SSLEngine on
    SSLVerifyClient none
    SSLCertificateFile /usr/local/psa/var/certificates/certQ69DPXb

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini

<IfModule mod_fcgid.c>
    FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini
    FcgidMaxRequestLen 16777216
</IfModule>

    <Directory /var/www/vhosts/mydomain.com/httpdocs>

<IfModule mod_perl.c>
    <Files ~ (\.pl$)>
        SetHandler perl-script
        PerlHandler ModPerl::Registry
        Options ExecCGI
        allow from all
        PerlSendHeader On
    </Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on

# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives

</IfModule>

<IfModule mod_php5.c>
php_admin_flag engine on

# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives

</IfModule>
<IfModule mod_python.c>
    <Files ~ (\.py$)>
        SetHandler python-program
        PythonHandler mod_python.cgihandler
    </Files>
</IfModule>
<IfModule mod_fcgid.c>
    <Files ~ (\.fcgi)>
        SetHandler fcgid-script
        Options +FollowSymLinks +ExecCGI
    </Files>
</IfModule>

        SSLRequireSSL

        Options -Includes +ExecCGI

    </Directory>



<Directory "/var/www/vhosts/mydomain.com/statistics">
    AuthType Basic
    AuthName "Domain statistics"
    AuthUserFile "/var/www/vhosts/mydomain.com/pd/d..httpdocs@plesk-stat"
    require  valid-user
</Directory>
Alias /error_docs /var/www/vhosts/mydomain.com/error_docs
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 414 /error_docs/request_uri_too_long.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
ErrorDocument 503 /error_docs/maintenance.html

    Include "/usr/local/psa/admin/conf/file_sharing.conf*"



</VirtualHost>

</IfModule>

<VirtualHost 10.10.10.10:80 >
    ServerName "mydomain.com"
        ServerAlias  "www.mydomain.com"
                        ServerAlias  "ipv4.mydomain.com"
                UseCanonicalName Off
    ServerAlias  "mydomainalias.com"
    ServerAlias  "www.mydomainalias.com"
        ServerAlias  "ipv4.mydomainalias.com"


<IfModule mod_suexec.c>
    SuexecUserGroup "mydomain" "psacln"
</IfModule>

    ServerAdmin  "admin@mydomain.com"

    DocumentRoot "/var/www/vhosts/mydomain.com/httpdocs"
    CustomLog /var/www/vhosts/mydomain.com/statistics/logs/access_log plesklog
    ErrorLog  "/var/www/vhosts/mydomain.com/statistics/logs/error_log"



<IfModule mod_userdir.c>
    UserDir "/var/www/vhosts/mydomain.com/web_users"
</IfModule>

    ScriptAlias  "/cgi-bin/" "/var/www/vhosts/mydomain.com/cgi-bin/"



    Redirect permanent /plesk-stat https://mydomain.com/plesk-stat
    Redirect permanent /webstat https://mydomain.com/webstat
    Redirect permanent /webstat-ssl https://mydomain.com/webstat-ssl
    Redirect permanent /ftpstat https://mydomain.com/ftpstat
    Redirect permanent /anon_ftpstat https://mydomain.com/anon_ftpstat
    Redirect permanent /awstats-icon https://mydomain.com/awstats-icon


    <IfModule mod_ssl.c>
        SSLEngine off
    </IfModule>

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini

<IfModule mod_fcgid.c>
    FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini
    FcgidMaxRequestLen 16777216
</IfModule>

    <Directory /var/www/vhosts/mydomain.com/httpdocs>

<IfModule mod_perl.c>
    <Files ~ (\.pl$)>
        SetHandler perl-script
        PerlHandler ModPerl::Registry
        Options ExecCGI
        allow from all
        PerlSendHeader On
    </Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on

# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives

</IfModule>

<IfModule mod_php5.c>
php_admin_flag engine on

# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives

</IfModule>
<IfModule mod_python.c>
    <Files ~ (\.py$)>
        SetHandler python-program
        PythonHandler mod_python.cgihandler
    </Files>
</IfModule>
<IfModule mod_fcgid.c>
    <Files ~ (\.fcgi)>
        SetHandler fcgid-script
        Options +FollowSymLinks +ExecCGI
    </Files>
</IfModule>


        Options -Includes +ExecCGI

    </Directory>



<Directory "/var/www/vhosts/mydomain.com/statistics">
    AuthType Basic
    AuthName "Domain statistics"
    AuthUserFile "/var/www/vhosts/mydomain.com/pd/d..httpdocs@plesk-stat"
    require  valid-user
</Directory>
Alias /error_docs /var/www/vhosts/mydomain.com/error_docs
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 414 /error_docs/request_uri_too_long.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
ErrorDocument 503 /error_docs/maintenance.html

    Include "/usr/local/psa/admin/conf/file_sharing.conf*"



</VirtualHost>

1 个答案:

答案 0 :(得分:0)

  1. 服务器的http代码响应是什么?您可以在Firebug上查看&#34; Net&#34;标签

  2. 检查www.mydomain.com是否解析为与mydomain.com相同的IP(nslookup www.mydomain.com)

  3. 检查是否应用了apache的配置:apachectl -S / apache2ctl -S | grep www.mydomain.com