[eZ publish] How to set the VirtualHost

The OS is ubuntu, use lampp which located in /opt/lampp
1. Modify the file of /opt/lampp/etc/httpd.conf

 

 

NameVirtualHost ez.39.lan.gz:80
 
<VirtualHost ez.39.lan.gz:80>
    <Directory "/media/MyDocuments/xampp/htdocs/ez">
    Options FollowSymLinks
    AllowOverride all
    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
    RewriteRule content/treemenu/? /index_treemenu.php [L]
    Rewriterule ^/var/storage/.* - [L]
    Rewriterule ^/var/[^/]+/storage/.* - [L]
    RewriteRule ^/var/cache/texttoimage/.* - [L]
    RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
        RewriteRule ^/var/[^/]+/cache/public/.* - [L]
    Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
    Rewriterule ^/share/icons/.* - [L]
    Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
    Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
    RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
    RewriteRule ^/favicon\.ico - [L]
    RewriteRule ^/robots\.txt - [L]
    # Uncomment the following lines when using popup style debug.
    # RewriteRule ^/var/cache/debug\.html.* - [L]
    # RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]
    RewriteRule .* /index.php
    </IfModule>
    DocumentRoot "/media/MyDocuments/xampp/htdocs/ez"
    ServerName ez.39.lan.gz
    ServerAlias ez.39.lan.gz admin.ez.39.lan.gz
</VirtualHost>
<VirtualHost xampp:80>
    <Directory "/media/MyDocuments/xampp/htdocs/xampp/">
    </Directory>

    DocumentRoot "/media/MyDocuments/xampp/htdocs/xampp/"
    ServerName xampp
    ServerAlias xampp
</VirtualHost>

 

 

2. Modify the file which located in/media/MyDocuments/xampp/htdocs/ez/settings/override/site.ini.append.phpof the eZ publish, find out the "SiteAccessSettings" block

 

 

[SiteAccessSettings]
ForceVirtualHost=true
MatchOrder=true
HostMatchMapItems[]
HostMatchMapItems[]=ez.39.lan.gz;my_site
HostMatchMapItems[]=admin.ez.39.lan.gz;my_site_admin

 

 

3. Modify the hosts of the OS, /etc/hosts

 

 

127.0.0.1   ez.39.lan.gz
127.0.0.1   admin.ez.39.lan.gz
127.0.0.1   xampp

 

 

Have fun!
posted @ 2010-04-21 10:26 DavidHHuan 阅读(...) 评论(...) 编辑 收藏