eZ Community » Forums » eZ Publish 5 Platform » Installing on WHM/cPanel server?
expandshrink

Installing on WHM/cPanel server?

Installing on WHM/cPanel server?

Thursday 28 February 2013 12:16:06 am - 5 replies

Hi,

I've successfully installed eZ5 on my virtualmin server but am struggling to work out how I would do it on a WHM/cPanel server.

In Virtualmin I can edit the virtual host settings directly in the virtual server setup.

In cPanel I don't have that option.

I've read about creating include files for the httpd.conf but am unsure if this is what I should be doing. As this will make the workflow of installing eZ5 a little more difficult.

Has anybody successfully installed on a WHM/cPanel environment that could give a brief explanation of the steps involved to setup the virtual host?

or

Should I be thinking about moving away from cPanel for my eZ5 installs?

Currently I just run a standalone install of the legacy kernel. I don't want to be doing this for long though as I'm keen to move my development workflow onto eZ5.

Wednesday 06 March 2013 7:50:13 pm

Hi Daniel,

Allthough not a complete answer, I thought I would provide my 2 cents since you haven't received a reply yet.

In our own development environment we've been fine using .htaccess for the 4.x stack, but the 5.x stack seems more dependant on a VirtualHost being created. The new documentation does mention a .htaccess option (https://confluence.ez.no/display/EZP/htaccess+example), but I'm not sure if this is an actually updated document as the rewrite rules seem to differ a bit from what is recommended in the virtual host option (https://confluence.ez.no/display/EZP/Virtual+host+setup).

Whether you want to include separate configuration files in your httpd.conf or put the virtual host blocks there directly is more a matter of organization than anything else (at least as long as you control the server). If you have the proper permissions you can just as well edit the httpd.conf files directly (allthough you'll need to do this through SSH and not through WHM).

NB. Remember to backup your httpd.conf fil (version it, if you can) and restart Apache after you've made your changes. Good luck!

Monday 11 March 2013 1:55:10 am

Hi Eirik,

Thanks for the reply. The problem with editing the httpd.conf on a WHM/CPanel server is that this file is created dynamically. So any changes you make directly to it will be overwritten when there's a new CPanel update or a new account is created. As is my understanding.

The doco at http://docs.cpanel.net/twiki/bin/view/EasyApache3/InsideVHost#Custom Templates for New Account implies that you need to create template files and then setup scripts to keep them active after updating etc. This just seems like a potential nightmare when it comes to managing this.

I am thinking I'm going to move away from WHM/CPanel when I start rolling out production sites on EZP5 for the time being I'm just using stand alone installs of the legacy stack.

Thanks again for your reply!

Monday 11 March 2013 2:52:35 am

@Daniel in case you figure out the cPanel templates which can be used to create a working eZ5 vhost config, just let us know

Monday 11 March 2013 8:40:27 am

Hi Daniel,

You are right - WHM we recreate the httpd.conf file dynamically. However, if you include your own files in the separate virtual host blocks, those should not be touched.

Wednesday 16 October 2013 1:13:53 pm

It has been quite a while I'm sorry between drinks on this post but I've finally been at this problem again and I think I have worked it out.

I have successfully installed EZP5 onto one of my cPanel accounts. I did it using an include file in easyapache. If you look at the include files part of the documentation which can be found here. You can create an include file for each account as you require.

I thought about making a new template for these but I have recently had to start installing things other than EZP on the server. Using the include file method you can set it for each specific virtual host. This does mean that you need to use the include for every domain but it does work and at this point seems to be the most manageable way to get this done for me at present.

I have included what I put into my include.conf file for anyone who might be having issues with EZP5 and cPanel.

As I complete more testing and get a couple of sites running using this method I will put up a much more detailed post about what I do and the workflow I create to handle this.

All in all it now means that I can start looking at using legacy mode and slowly migrating my workflow to full stack EZP 5. Which I'm really excited about!

My include.conf file:

 <Directory /home/easterin/public_html//web>
    Options FollowSymLinks
    AllowOverride None
    # depending on your global Apache settings, you may need to uncomment and adapt
    #Allow from all
</Directory>

<IfModule mod_php5.c>
    php_admin_flag safe_mode Off
    php_admin_value register_globals 0
    php_value magic_quotes_gpc 0
    php_value magic_quotes_runtime 0
    php_value allow_call_time_pass_reference 0
</IfModule>

DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    # Uncomment in FastCGI mode or when using PHP-FPM, to get basic auth working.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    # v1 rest API is on Legacy    RewriteRule ^/api/[^/]+/v1/ /index_rest.php [L]
    # If using cluster, uncomment the following two lines:
    #RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* /index_cluster.php [L]
    #RewriteRule ^/var/([^/]+/)?cache/(texttoimage|public)/.* /index_cluster.php [L]
    RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* - [L]
    RewriteRule ^/var/([^/]+/)?cache/(texttoimage|public)/.* - [L]
    RewriteRule ^/design/[^/]+/(stylesheets|images|javascript|fonts)/.* - [L]
    RewriteRule ^/share/icons/.* - [L]
    RewriteRule ^/extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/.* - [L]
    RewriteRule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
    RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
    RewriteRule ^/var/storage/packages/.* - [L]
    
    # Makes it possible to place your favicon at the root of your
    # eZ Publish instance. It will then be served directly.
    RewriteRule ^/favicon\.ico - [L]
    # Uncomment the line below if you want you favicon be served
    # from the standard design. You can customize the path to
    # favicon.ico by changing /design/standard/images/favicon\.ico
    #RewriteRule ^/favicon\.ico /design/standard/images/favicon.ico [L]
    RewriteRule ^/design/standard/images/favicon\.ico - [L]
    # Give direct access to robots.txt for use by crawlers (Google,
    # Bing, Spammers..)
    RewriteRule ^/robots\.txt - [L]
    # Platform for Privacy Preferences Project ( P3P ) related files
    # for Internet Explorer
   RewriteRule ^/w3c/p3p\.xml - [L]
    # Uncomment the following lines when using popup style debug in legacy
    #RewriteRule ^/var/([^/]+/)?cache/debug\.html.* - [L]
    
    # Following rule is needed to correctly display assets from eZ Publish5 / Symfony bundles
    RewriteRule ^/bundles/ - [L]
    # Additional Assetic rules for eZ Publish 5.1 / 2013.4 and higher.
    ## Don't forget to run php ezpublish/console assetic:dump --env=prod
    ## and make sure to comment these out in dev environment.
    RewriteRule ^/css/.*\.css - [L]    RewriteRule ^/js/.*\.js - [L]
    RewriteRule .* /index.php
</IfModule>

DocumentRoot /home/easterin/public_html/web/

Modified on Wednesday 16 October 2013 1:20:03 pm by Daniel Clements

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from