1
votes

after I try to use my own vhost.confic instead of using the generated one from Plesk, I just copy the last_httpd.include file and made some modifications - change the document root. But the /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain redmine.newslab.cz get some error

2013-11-28T10:52:28+01:00 ERR (3): Apache config (13856323480.31924600) generation failed: Syntax error on line 1 of /var/www/vhosts/redmine.newslab.cz/conf/vhost.conf:
<VirtualHost> cannot occur within <VirtualHost> section

Syntax error on line 1 of /var/www/vhosts/redmine.newslab.cz/conf/vhost.conf:
<VirtualHost> cannot occur within <VirtualHost> section

vhost.conf file

<VirtualHost *:80 >
    ServerName "redmine.newslab.cz"
        ServerAlias  "www.redmine.newslab.cz"
        ServerAlias  "ipv4.redmine.newslab.cz"
        UseCanonicalName Off


<IfModule mod_suexec.c>
    SuexecUserGroup "redmine.newslab" "psacln"
</IfModule>

    ServerAdmin  "[email protected]"

    DocumentRoot "/var/www/vhosts/redmine.newslab.cz/httpdocs/redmine/public"
    CustomLog /var/www/vhosts/redmine.newslab.cz/statistics/logs/access_log plesklog
    ErrorLog  "/var/www/vhosts/redmine.newslab.cz/statistics/logs/error_log"


<IfModule mod_userdir.c>
    UserDir "/var/www/vhosts/redmine.newslab.cz/web_users"
</IfModule>

    ScriptAlias  "/cgi-bin/" "/var/www/vhosts/redmine.newslab.cz/cgi-bin/"


    Redirect permanent /plesk-stat https://redmine.newslab.cz/plesk-stat
    Redirect permanent /webstat https://redmine.newslab.cz/webstat
    Redirect permanent /webstat-ssl https://redmine.newslab.cz/webstat-ssl
    Redirect permanent /ftpstat https://redmine.newslab.cz/ftpstat
    Redirect permanent /anon_ftpstat https://redmine.newslab.cz/anon_ftpstat
    Redirect permanent /awstats-icon https://redmine.newslab.cz/awstats-icon


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

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/redmine.newslab.cz/etc/php.ini

<IfModule mod_fcgid.c>
    FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/redmine.newslab.cz/etc/php.ini
    FcgidMaxRequestLen 16777216
</IfModule>

    <Directory /var/www/vhosts/redmine.newslab.cz/httpdocs/redmine/public>

<IfModule mod_perl.c>
    <Files ~ (\.pl$)>
        SetHandler perl-script
        PerlHandler ModPerl::Registry
        Options ExecCGI
        allow from all
        PerlSendHeader On
    </Files>
</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>
<IfModule mod_fcgid.c>
    <Files ~ (\.php)>
        SetHandler fcgid-script
        FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .php
        Options +ExecCGI
        allow from all
    </Files>
</IfModule>

        Options -Includes +ExecCGI

    </Directory>

<Directory "/var/www/vhosts/redmine.newslab.cz/statistics">
    AuthType Basic
    AuthName "Domain statistics"
    AuthUserFile "/var/www/vhosts/redmine.newslab.cz/pd/d..httpdocs@plesk-stat"
    require  valid-user
</Directory>
Alias /error_docs /var/www/vhosts/redmine.newslab.cz/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

</VirtualHost>

Do have anybody idea what is wrong. Thx

1

1 Answers

4
votes

It is simple. Your vhost.conf is included inside the one generated by Plesk, it doesn't replace the Plesk config. That means you need to strip your vhost.conf from VirtualHost directive and other duplicated content. Keep there only directives which you need and which Plesk doesn't add itself.