This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Working with httpd.conf

Installation and environment issues, mainly on 1.x but there's some 2.x here too.

Working with httpd.conf

by jimbo » Tue Nov 29, 2005 10:50 pm

Hello,
I am trying to set up the tutorial project to test Symfony out. I have used Propel and other of the packages before and so everything has been smooth sailing so far. However I am having trouble setting up Apache the way the documentation explains. Yes, I do have mod_rewrite but my problem is that my current setup is differnt from how Symfony wants it.

As of now, my httpd.conf file just has te following under Section 3 (Virtual Hosts):

VirtualDocumentRoot /var/www/%0/docs

Now, I have tried just adding this:

#<VirtualHost *:80>
# ServerAdmin [url=mailto:webmaster@dummy-host.example.com]webmaster@dummy-host.example.com[/url]
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

(with it modified to my server of course.)

This does not work though. I am not an expert in setting up Apache so if there is an obvious workaround to this problem please let me know. I want to keep my current setup and just make exceptions for my symfony projects. Any ideas?

Thanks,

Jimbo
jimbo
Junior Member
 
Posts: 17
Joined: Tue Nov 29, 2005 10:24 pm

Re: Working with httpd.conf

by Ian » Wed Nov 30, 2005 5:04 am

Your DocumentRoot is wrong.

it should be /path/to/domain.com/project/web/

where project is the name of your symfony project.
Ian

Join us on IRC for LIVE support!
Report bugs here.
Ian
Faithful Member
 
Posts: 386
Joined: Tue Oct 25, 2005 6:53 pm
Location: Boulder, CO (USA)

Re: Working with httpd.conf

by jimbo » Sat Dec 03, 2005 12:23 am

Sorry,
I copied and pasted the wrong section...

Basically, I just used the following:
<VirtualHost *:80>
ServerName myapp.example.com
DocumentRoot "/home/steve/myproject/web"
DirectoryIndex index.php
Alias /sf /$data_dir/symfony/web/sf

<Directory "/home/steve/myproject/web">
AllowOverride All
</Directory>
</VirtualHost>

Right out of the tutorial with the information modified to match my directory structure of course. It did not work however. I think it is because I have the other line (VirtualDocumentRoot /var/www/%0/docs) already in that section in my httpd. Can the two settings co-exist or do I need to totally redo how my apache is setup?

Thanks
jimbo
Junior Member
 
Posts: 17
Joined: Tue Nov 29, 2005 10:24 pm

Re: Working with httpd.conf

by Ian » Mon Dec 05, 2005 10:11 am

The DocumentRoot should work like you have it. I'm not an expert with it either though.

Do you get any messages in your /var/log/messages or /var/log/httpd/error_log ?
Ian

Join us on IRC for LIVE support!
Report bugs here.
Ian
Faithful Member
 
Posts: 386
Joined: Tue Oct 25, 2005 6:53 pm
Location: Boulder, CO (USA)

Re: Working with httpd.conf

by Atlantean » Tue Dec 06, 2005 1:33 am

Code: Select all
 Alias /sf /$data_dir/symfony/web/sf


Should this not be the path to the PEAR /data directory? I may be wrong, but I don't think $data_dir will work.

Here's how I set the 'myproject' tutorial up on my PC:

Code: Select all
<VirtualHost 127.0.0.1>

   ServerName www.myproject.dev
   DocumentRoot C:/web/projects/myproject/web
   DirectoryIndex index.php

   Alias /sf C:/web/php/PEAR/data/symfony/web/sf

   <Directory "C:/web/projects/myproject/web">
      AllowOverride All
   </Directory>
   
   <IfModule mod_rewrite.c>
      RewriteEngine On
   </IfModule>

</VirtualHost>


You will need to add 127.0.0.1 www.myproject.dev to your hosts file. It's also worth pointing out that using .dev will only work locally (more info).

Hopefully this might push you in the right direction.

Edit:

Another thing worth testing... my Fedora Core box has a utility installed with apache which allows you to check the httpd.conf file for errors:

Code: Select all
[/etc/httpd]# ./bin/apachectl configtest
Syntax OK


Why not give that a try and see if it notices anything?
Atlantean
Junior Member
 
Posts: 8
Joined: Sat Nov 19, 2005 7:55 pm