Forum Moderators: phranque
I'm following this guide [help.ubuntu.com]; the mentioned Network Configuration Applet has a bug which forces me to directly edit /etc/hosts which begins like so:
127.0.0.1localhost
127.0.0.1 crosspoint.localhost
127.0.1.1Jesdisciple-laptop
That part works, but only makes the subdomain a synonym of localhost. The part that doesn't work is /etc/apache2/sites-enabled/crosspoint:
<VirtualHost *>
DocumentRoot /home/coder/www/projects/crosspoint/
ServerName crosspoint.localhost
<Directory /home/chris/crosspoint/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride All Limit
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Any help would be most appreciated.
[edited by: encyclo at 1:42 am (utc) on June 4, 2009]
[edit reason] fixed link [/edit]
If I understand the problem correctly, you need to run a PHP file before serving the requested page? If so, have you looked at php_value auto_prepend_file?:
php_value auto_prepend_file "/path/to/file.php"
That directive would help with remembering to include the code, but it's not what I was asking; I still have to depend on the $ROOT variable to know where to find all my files. The current arrangement is just the alternative to a virtual host, adopted as a work-around.
<edit>Oh, here's something important. When I restart Apache, I get this error:
NameVirtualHost *:80 has no VirtualHosts
<edit>I found a bunch of questions about that on Google, but I have a different situation. Some said the 000-default file apparently has a NameVirtualHost directive but no VirtualHosts tag could be found. Actually, ports.conf has the directive and 000-default has the tag.
Commenting the NameVirtualHost line as described here [v2kblog.blogspot.com] got rid of the warning but didn't fix anything.</edit>
Thanks!
[edited by: Jesdisciple at 4:39 am (utc) on June 4, 2009]
*jumps and shouts* I cleared my cache (suggested on another forum) and the problem disappeared.
[edited by: Jesdisciple at 6:07 am (utc) on June 4, 2009]