VirtualHost Config

Author Message

Tristan Koen

Friday 24 October 2003 5:39:37 am

Hi

I am trying to get rid of the index.php part of the URLs on my website (ie I would like the urls to look like http://www.mysite.com/content/view/full/2 instead of http://www.mysite.com/index.php/content/view/full/2). AFAIK, all I need to do is ensure that the virtualhosting stuff on apache is configured correctly.

It looks fine to me, but this part still isn't working. I am hoping that someone on this forum can direct me to the source of my problem.

The relevant parts of my httpd.conf look like:

NameVirtualHost 192.168.0.1
<VirtualHost 192.168.0.1>
ServerAlias www.mysite.com
<!-- Other config directives -->
</VirtualHost>

I have another virtualhost directive for the admin site.

My site.ini.append.php looks like:
[SiteAccessSettings]
MatchOrder=host
HostMatchType=map
HostMatchMapItems[]=mysite.com;rcc
HostMatchMapItems[]=www.mysite.com;rcc
HostMatchMapItems[]=admin.mysite.com;admin

If anyone can give me some pointers here, I would really appreciate it.

Thanks

Ole Morten Halvorsen

Friday 24 October 2003 5:49:37 am

Hi,

In httpd.conf, try to set
DirectoryIndex index.php

Remeber to restart apache.

See if that works.

-Ole

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

James Packham

Friday 24 October 2003 5:58:45 am

This might be of interest to you, a sample of my own http.conf. It's a slightly modified version of what you've got in yours that lets you have multiple virtual hosts on the same server - handy if you want to use phpmyadmin and ezpublish together, for example:

#-----------------------------------------------------------------
NameVirtualHost *:80

# View your site locally by entering localhost into the location
# bar of your browser
<Virtualhost *:80>
<Directory /var/www/html/ezpublish-my-sites/>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>

RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php

ServerAdmin root@localhost
DocumentRoot /var/www/html/ezpublish-my-sites/
ServerName localhost
</Virtualhost>

# View phpmyadmin locally by entering phpmyadmin into
# the location bar of your browser
<Virtualhost *:80>
<Directory /var/www/html/phpMyAdmin-2.5.4/>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>

RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php

ServerAdmin root@localhost
DocumentRoot /var/www/html/phpMyAdmin-2.5.4/
ServerName phpmyadmin
</Virtualhost>

# View your site from the web by entering it's internet url
# into the location bar of your browser
<Virtualhost *:80>
<Directory /var/www/html/ezpublish-my-sites/>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>

RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php

ServerAdmin root@localhost
DocumentRoot /var/www/html/ezpublish-my-sites/
ServerName www.myezpublish.no-ip.com
</Virtualhost>
#-----------------------------------------------------------------

You probably need to change your match order to uri instead of host, or put "uri, " before host. Either that or I've read your question wrong and have just wasted both of our time ;)

~James~

Tristan Koen

Friday 24 October 2003 7:18:10 am

Thanks for the replies.

Ole: I have DirectoryIndex index.php together with a few other directives (rewrite rules, etc) in my .htaccess file. Should this make a difference.

James: What you have there is very similar to what I have except that I have to specify an IP address (the same box is used for hosting multiple sites) and that some of my directives are located in my .htaccess file for the site.

Regards,

Tristan

Jerry Jalava

Friday 24 October 2003 7:33:36 am

Hi,

I have a small prob with vhosts also...
I need to get one folder inside eZ's folder to act as its own url...
Example:
My ez is running in url: www.mysite.com (www.mysite.com/page1 etc.)
So everything after .com/ goes through index.php.
And I need one folder to go like www.mysite.com/folder
It cannot do it now, 'cause it goes through index.php.

How can I make an overwrite to htacces or httpd.conf so this specific folder wouldn't go through index.php and would act normally?

Regards,
Jerry

Tony Wood

Friday 24 October 2003 9:26:54 am

Jerry,

Try this http://ez.no/developer/ez_publish_3/documentation/configuration/configuration/tips_tricks/exclude_uris_from_rewrite

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Jerry Jalava

Friday 24 October 2003 10:03:46 am

Hi Tony,

Thanks for the link, but my eZ is still giving me "module not found error". :(

I have restarted apache many times already...

Hope there's still some solution.

Regards,
Jerry

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 03:29:53
Script start
Timing: Jan 31 2025 03:29:53
Module start 'layout'
Timing: Jan 31 2025 03:29:53
Module start 'content'
Timing: Jan 31 2025 03:29:53
Module end 'content'
Timing: Jan 31 2025 03:29:53
Script end

Main resources:

Total runtime0.0245 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.1328151.2109
Module start 'layout' 0.00550.0037 739.3438220.6875
Module start 'content' 0.00920.0139 960.03131,005.8047
Module end 'content' 0.02320.0013 1,965.835941.9922
Script end 0.0245  2,007.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002711.1780140.0002
Check MTime0.00114.4479140.0001
Mysql Total
Database connection0.00083.401510.0008
Mysqli_queries0.003213.113130.0011
Looping result0.00000.040810.0000
Template Total0.00093.810.0009
Template load0.00083.104010.0008
Template processing0.00020.708910.0002
Override
Cache load0.00062.284210.0006
General
dbfile0.002711.215980.0003
String conversion0.00000.028240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs