Skip to main content

/scripts/rebuildhttpdconf generation failed

Comments

8 comments

  • JacobPerkins
    Good morning, This is an odd one. I'd recommend keeping the DocumentRoot there, but still adding the proxypass directives via the include file. Could you let us know what changes you made that caused the rebuildhttpdconf to fail? Replication steps would be great. Thanks Miguel!
    0
  • Miguel G
    I tried to reproduce so you can see the steps. I did so removing the SSL VirtualHost and recreating it (by deleting/adding the certs). I also have added under /etc/apache/conf.d/userdata/ssl/2_4/$USERNAME/$SITE/ the following:
    ProxyPreserveHost On ProxyPass / http://127.0.0.1:80/ RequestHeader set X-Forwarded-Port "443" RequestHeader set X-Forwarded-Proto "https"
    Still the rebuildhttpdconf script worked, so then, as a final test I removed the entry documentroot in the file under /var/cpanel/userdata/$USERNAME/ and then the rebuildhttpdconf script failed again. What I"m trying to achieve is this: - I have Varnish in the 80 port caching Wordpress pages hosted by Cpanel, since Varnish doesn"t support SSL, I searched around and most people recommended for this setup using Nginx in proxy mode, passing the request to Varnish and being the frontend for the 443 port. What I don"t like of this solution is the lack of integration with WHM/Cpanel having to manually add certs, etc. None of the free Nginx plugins for Cpanel seem to have SSL support. Besides I"m testing Nginx in a separate machine and I"m having issues with mixed content. - Researching for this solution I came across someone that has done the same but using Apache itself here. What I like of this solution is that users could setup their certificates in WHM/Cpanel. I"m trying to make it work and hopefully get a solution that all users could make it work by themselves with some instructions. - Of course I"m trying to avoid to have duplicated content with http and https. I haven"t figured out that yet. Hope this helps more to understand my setup.
    0
  • Miguel G
    Ok, it seems it"s working the proxypass changing 127.0.0.1 to the IP address of the server (Varnish doesn"t seem to like localhost connections). Now I have to solve the duplicated content issue since you can both access the website through http and https. Rewrites in .htaccess doesn"t seem to work.
    0
  • cPanelMichael
    Hello, Rather than removing the documentroot entry, try changing it to a value such as "/dev/null" to see if that makes a difference. Thank you.
    0
  • Miguel G
    I have fixed it adding this to .htaccess
    RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    and this in wp-config.php (I"m using Wordpress):
    if ( (!empty( $_SERVER['HTTP_X_FORWARDED_HOST">)) || (!empty( $_SERVER['HTTP_X_FORWARDED_FOR">)) ) { // http://wordpress.org/support/topic/wordpress-behind-reverse-proxy-1 $_SERVER['HTTP_HOST"> = $_SERVER['HTTP_X_FORWARDED_HOST">; define('WP_HOME', 'https://www.mysite.com'); define('WP_SITEURL', 'https://www.mysite.com'); $_SERVER['HTTPS"> = 'on'; }
    Is there any way I can add automatically in every SSL VirtualHost the ProxyPass entry so I don"t have to do it manually? Thanks!
    0
  • cPanelMichael
    Is there any way I can add automatically in every SSL VirtualHost the ProxyPass entry so I don"t have to do it manually?

    Hello, Yes, you can review the SSL instructions for "Apply to all virtual hosts on the system" at the following document: Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation Thank you.
    0
  • Miguel G
    Many thanks! How can I remove the access and transfer logs for all SSL virtualhosts? The cache system I have in the middle is keeping track of the requests and I don"t want to have duplicate entries.
    0
  • cPanelMichael
    Many thanks! How can I remove the access and transfer logs for all SSL virtualhosts? The cache system I have in the middle is keeping track of the requests and I don"t want to have duplicate entries.

    Could you verify if this is addressed on the piping varnishncsa logs into stat logs thread? Thanks!
    0

Please sign in to leave a comment.