0

I have apache2 that installed in ubuntu 14.04 . My plan is to put my codeigniter application's folder that called "tresnamuda". I know the default virtual host in ubuntu is /var/www/. So, I put the "tresnamuda" into /var/www/tresnamuda.

But, it gives me blank page. When I right clik on internet browser, the contains of index.php is loaded like this :

<?php

/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting...........

I dont know where is the error, coz in /var/www/tresnamuda/.htaccess contains code like this :

RewriteEngine on
RewriteBase /tresnamuda/
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

In apache conf on /etc/apache2/sites-available/tresnamuda.com.conf, I write like this :

<VirtualHost *:80>
   ServerAdmin itjkt@tresnamuda.co.id
   ServerName 192.168.5.222
   ServerAlias http://192.168.5.222
   DocumentRoot /var/www/html/tresnamuda
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

In /etc/apache2/apache2.conf, I write like this :

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All   
    Require all granted
</Directory>

I have try a lot of times. I use sudo a2ensite tresnamuda.com.conf , i t still blank page when I access on internet broswer like this : http://192.168.5.222.

Please, any advice it so appreciated.

Fadly Dzil
  • 2,154
  • 3
  • 34
  • 85

1 Answers1

0

It sounds like PHP isn't installed, or that at least PHP isn't configured with Apache. Do PHP files in the root folder run correctly?

If not, you'll need to install PHP

sudo apt-get install php5

Then, once that's done, restart Apache

sudo service apache2 restart

If PHP is installed, I've found a resource on digital ocean which might help. The relevant part, i think, would be:

It may also be useful to add php to the directory index, to serve the relevant php index files:

sudo nano /etc/apache2/mods-enabled/dir.conf 

Add index.php to the beginning of index files. The page should now look like this:

<IfModule mod_dir.c>
           DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm 
</IfModule>
gabe3886
  • 4,235
  • 3
  • 27
  • 31
  • I've updated my answer with further things to try. It's an odd issue as I've never had this trouble setting up PHP and Apache on Ubuntu – gabe3886 May 27 '15 at 08:22
  • OMG, I still get this error " AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : /var/www/tresnamuda/" – Fadly Dzil May 27 '15 at 08:46
  • have a look at http://stackoverflow.com/questions/11901993/options-followsymlinks-or-symlinksifownermatch-is-off to see if it helps this latest issue – gabe3886 May 27 '15 at 09:25