I am using Lubuntu 14.10 32bit to run a LAMP system using Apache2.2. I have been unsuccessful at creating a virtualhost for cakephp 2.5.6. I'm not sure if this is causing the problem or not but I have successfully installed zoneminder. I do not have any other virtual hosts on my system except zoneminder. Also Apache's home page loads successfully. Here is what I have done so far.

I changed the owner of /etc/apache2 and /var/www from root to alan to make editing with putty easier.

I copied cakephp 2.5.6 in /var/www/cakephp

I created the file /etc/apache2/site-available/cakephp.conf that contains the following:

<VirtualHost *:80>
DocumentRoot /var/www/cakephp
ServerName cakephp
ServerAlias cakephp

I ran sudo a2ensite cakephp with no errors and /etc/apache2/site-enabled/cakephp.conf was created

I changed /etc/hosts by adding cakephp at the end of the file:   localhost   alan-Dimension-2400

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters   cakephp

I run the following with no errors:

sudo service apache2 restart

My server's ip address is and when I am on another computer and try to go to the following address I get I get a 404 Not Found error.

One more thing... I must have accidentally changed the following file /etc/host.conf

# The "order" line is only used by old versions of the C library.
order hosts,bind
multi on

That was the entire file

Why can I not add the vitualhost cakephp? If there is any other information that you need please ask. Thank you for any and all help!


Here are the some of the zoneminder files:


Alias /zm /usr/share/zoneminder

<Directory /usr/share/zoneminder>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php




Alias /zm /usr/share/zoneminder

<Directory /usr/share/zoneminder>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php

I hope this helps

  • That’s not how virtual hosts work. Unless using IP-based virtual hosts, they’re name-based. So unless you browse to http://cakephp/, your virtual host will not be used. – Daniel B Nov 30 '14 at 17:37
  • Is there a way that I can make work? Also why does work? – user908759 Nov 30 '14 at 19:22
  • I don't know. To answer that I'd need to know where the zm folder is physically and how the default vhost is configured. – Daniel B Nov 30 '14 at 22:38
  • See the above edit. I hope this helps – user908759 Nov 30 '14 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.