0

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
</VirtualHost> 

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

I changed /etc/hosts by adding 127.0.0.1 cakephp at the end of the file:

127.0.0.1   localhost
127.0.0.1   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

127.0.0.1   cakephp

I run the following with no errors:

sudo service apache2 restart

My server's ip address is 192.168.1.12 and when I am on another computer and try to go to the following address I get http://192.168.1.12/cakephp 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!

.................EDIT.................

Here are the some of the zoneminder files:

/etc/zm/apache.conf

Alias /zm /usr/share/zoneminder

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

/etc/zm/zm.conf

ZM_PATH_DATA=/usr/share/zoneminder
ZM_PATH_BIN=/usr/bin
ZM_PATH_LIB=/usr/lib
ZM_PATH_CONF=/etc/zm
ZM_PATH_WEB=/usr/share/zoneminder
ZM_PATH_CGI=/usr/lib/cgi-bin
ZM_WEB_USER=www-data
ZM_WEB_GROUP=www-data
ZM_DB_TYPE=mysql
ZM_DB_HOST=localhost
ZM_DB_NAME=zm
ZM_DB_USER=zmuser
ZM_DB_PASS=zmpass
ZM_SERVER_HOST=

/etc/apache2/conf.d/zoneminder.conf

Alias /zm /usr/share/zoneminder

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

I hope this helps

migrated from serverfault.com Nov 30 '14 at 17:35

This question came from our site for system and network administrators.

  • 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 http://192.168.1.12/cakephp work? Also why does http://192.168.1.12/zm 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.