2

I recently ran an update on my vps which updated my apache from 2.2 to 2.4.6 on Ubuntu 13.10.

After the update i am only getting the "it works" default apache landing pages.

I was fairly sure this was due to the new virtual host file requirements so i tried adding the .conf extension to my virtual hosts files and also adding:

<Directory "/home/username/public/testapp.com/public/">
    Options Indexes FollowSymLinks Includes
    AllowOverride All
    Require all granted
</Directory>

to the files and re enabling them using a2ensite and reloading apache2. After not getting anywhere with these attempts i removed all of my enabled sites and started fresh.. putting a basic site in/home/username/public/url.co/and creating a new virtual host file:

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin admin@url.co
  ServerName  url.co
  ServerAlias www.url.co

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /home/username/public/url.co/public/

  # Log file locations
  LogLevel warn
  ErrorLog  /home/username/public/url.co/log/error.log
  CustomLog /home/username/public/url.co/log/access.log combined

    <Directory /home/username/public/url.co/public/>
        Options Indexes FollowSymLinks Includes
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

This is still giving me the "it works" page. Am I missing something obviously wrong with this file (it is named correctly url.co.conf ) or is there something else that could be causing this issue?

old_no_7uk
  • 369
  • 5
  • 16

2 Answers2

1

I have the same issue! and I solved it by adding : DirectoryIndex index.html index.php in my conf file

1

Follow below steps

  1. Do: sudo nano /etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>

  ServerName  website.localhost
  ServerAlias www.website.localhost

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot "/Users/Username/Sites/website"

  # Log file locations
  LogLevel warn

  ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
  CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common

    <Directory /Users/Username/Sites/website>
        Options Includes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
         Require all granted
    </Directory>
</VirtualHost>
  1. Allow the vhosts configuration from the Apache configuration file httpd.conf:

    sudo nano /etc/apache2/httpd.conf

    Search for ‘vhosts’ and uncomment the include line:

    Include /private/etc/apache2/extra/httpd-vhosts.conf

This will allow usage of HTTP, enter code in the d-vhosts.conf file, open this file to add in the vhost.

  1. Do: sudo nano /etc/hosts and add the following;

    127.0.0.1 website.localhost

  2. Do: sudo apachectl restart

You can replace ErrorLog and CustomeLog or check the error enter code here in /private/var/log/apache2/.

Achraf Almouloudi
  • 756
  • 10
  • 27