• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with codeigniter on ubuntu

#1
[eluser]fatman[/eluser]
Hi,

I've got Codeigniter on Ubuntu 10. I have an htaccess file:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dort
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php
#controller, previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /dort/index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends
#the request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /dort/index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>

Up until now, we connected the remote server with IP and everything worked fine, now, a virtual host was defined for the server and suddenly nothing works except for the login page (index.php). I've changed $config['base_url'] in config.php but i keep getting 404.

Please help Sad

#2
[eluser]fatman[/eluser]
Hi,
Sorry for double posting but this is very urgent, if u need more data i'll be happy to give it.

Please help Sad

#3
[eluser]InsiteFX[/eluser]
Did you set the system and application folders in the index.php file?

Also check your .htaccess file.

InsiteFX

#4
[eluser]fatman[/eluser]
Thanks for replying,

I did not change the location of System and Application, and like i mentioned everything worked until we defined the virtual host.

My base site is sitting under a folder called 'dort', so we used to call it like this: http://<some_ip>/dort
now we mapped a virtual host to dort, so we call it like: http://demo.dort.com/

What should i change in the .htaccess file?
I tried removing the /dort from RewriteBase and other occurences in the file, but that didn't help.

I'm a newby when it comes to Ubuntu and .htaccess, so please explain to me in laim terms if u can Smile

#5
[eluser]n0xie[/eluser]
Quesion 1:
If you are a newbie why are you mocking about with Ubuntu? Shouldn't there be someone more qualified be doing this?

Question 2:
- is mod_rewrite enabled?
- does the vhost work (make an index.html in your public_html/ folder and try to access it)
- does your apache config allow htaccess override?
- are you running FASTCGI?
- did you try to remove the questionmark after index.php?
- what does your apache log say?
- did you try all the different uri_protocol's in your config.php?

#6
[eluser]fatman[/eluser]
Hi,

I'll try to answer all your questions:

Quesion 1:
If you are a newbie why are you mocking about with Ubuntu? Shouldn’t there be someone more qualified be doing this?
---&gt; I work in a startup and we had a guy configuring Ubuntu for us and now he is gone, so i need to do my best

Question 2:
- is mod_rewrite enabled? - yes
- does the vhost work (make an index.html in your public_html/ folder and try to access it) - I am able to access login page (index.php).

- does your apache config allow htaccess override? - yes
- are you running FASTCGI? - sorry but i don't know
- did you try to remove the questionmark after index.php? - no, will try
- what does your apache log say? - where can i find it?
- did you try all the different uri_protocol’s in your config.php? - no, will try

Thanks.

#7
[eluser]n0xie[/eluser]
[quote author="fatman" date="1298408827"]
- what does your apache log say? - where can i find it?
[/quote]
Most likely:

Code:
/var/log/apache2/other_vhosts_access.log

#8
[eluser]a_bains[/eluser]
Let me see if i can offer some help..

You didn't mention to us whether you are accessing the URLs with index.php or without. But this seemed to help me get it working without the index.php in the URLs.

I am running CodeIgniter on Ubuntu 10 as well.

Go into your Apache virtual host file and change the "AllowOverride" from none to FileInfo. Then restart Apache and give CodeIgniter a try.

Your apache virtual host config should look something like below:

Code:
<Directory />
        Options FollowSymLinks
        AllowOverride FileInfo
</Directory>
<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride FileInfo
        Order allow,deny
        allow from all
</Directory>

And my .htaccess file looks like this (its custom):

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|css|images|scripts|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

#9
[eluser]Toppy[/eluser]
[quote author="fatman" date="1298342953"]Hi,

I've got Codeigniter on Ubuntu 10. I have an htaccess file:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dort
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php
#controller, previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /dort/index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends
#the request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /dort/index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>

Up until now, we connected the remote server with IP and everything worked fine, now, a virtual host was defined for the server and suddenly nothing works except for the login page (index.php). I've changed $config['base_url'] in config.php but i keep getting 404.

Please help Sad[/quote]

You mentioned that before the change you were accessing via: http://<some_ip>/dort and now mapped a virtual host to the dort directory (so dort is now the host root directory). If that's the case you should start by editing your .htaccess and remove the /dort part from the rewrite rules. See what that does.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.