#1  
Old 11th October 2012, 10:11
clip clip is offline
Junior Member
 
Join Date: Aug 2009
Posts: 17
Thanks: 3
Thanked 2 Times in 1 Post
Default ningx 500 error instead of 404

Hi,

I just installed a ningx server with isp config and noticed that my joomla website outputs a 500 error instead of an 404 error not found...

Is there a way to fix this? And where to start?

Thanks...
Reply With Quote
Sponsored Links
  #2  
Old 12th October 2012, 13:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
Default

Any errors in the web site's error log? What configuration do you use in the nginx Directives field on the Options tab of that web site in ISPConfig?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
clip (12th October 2012)
  #3  
Old 12th October 2012, 18:55
clip clip is offline
Junior Member
 
Join Date: Aug 2009
Posts: 17
Thanks: 3
Thanked 2 Times in 1 Post
Default

I moved the site from an apache2 vps server, also isp config. So i had to remove the .htacces file because that was not working on ningx. Is that the erro log before the /web folder?

Then on the isp config diretives field i have nothing, somehow that field was not working or updating the ningx host file... From isp config.

I changed the vhost myself to this, because i needed sef... sef is working now... But i do not use a symlink right now, picture added as attachment... Dont know if thats the right way.

I also wanted to redirect to without www so i set this in isp config, but its not redirecting to without www.

Code:
server {
        listen *:80;
		
        
        server_name mysite.com *.mysite.com;

		error_log /var/log/ispconfig/httpd/mysite.com/error.log;

        access_log /var/log/ispconfig/httpd/mysite.com/access.log combined;

        root   /var/www/mysite.com/web;

        index index.php;
        # Support Clean (aka Search Engine Friendly) URLs
        location / {
                try_files $uri $uri/ /index.php?q=$request_uri;
        }

		index index.php index.html index.htm default.html default.htm;

        # deny running scripts inside writable directories
        location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
                return 403;
                error_page 403 /403_error.html;
        }

        location ~ \.php$ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/var/lib/php5-fpm/web1.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;
        }

       # caching of files
       location ~* \.(ico|pdf|flv)$ {
                expires 1y;
       }

       location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt|otf|woff)$ {
                expires 14d;
       }
		
        ## Disable .htaccess and other hidden files
        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }
		
		
        location /stats {
            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client1/web1/.htpasswd_stats;
        }

        location ^~ /awstats-icon {
            alias /usr/share/awstats/icon;
        }
		

 }
Attached Images
 

Last edited by clip; 12th October 2012 at 18:57.
Reply With Quote
  #4  
Old 13th October 2012, 04:34
clip clip is offline
Junior Member
 
Join Date: Aug 2009
Posts: 17
Thanks: 3
Thanked 2 Times in 1 Post
Default

Hmmm think i am doing something right now...
I went to the isp config backend and set auto subdomain to www

After that i checked the sites enabled folder on my server and saw a new vhost symbolic link... But now starting whit 100 instead of 900

I went back to the isp config backend and added the needed code for sef and cache in the directives field...

Code:
 

# Support Clean (aka Search Engine Friendly) URLs
        location / {
                try_files $uri $uri/ /index.php?q=$request_uri;
}
location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
                expires 14d;
        }
After some minutes sef was working agian...

The error 500 is still there but noticed not everywhere... Only on the jomsocial part of the website. So maybe there the problem is...

For example if i type:

http://mysite.com/music/something i get >> 404
On this link there is no jomsocial installed

But if i type:

http://mysite.com/somethingwhatisnotthere i get >> 500 Controller

CommunitySomethingwhatisnotthereController not found!

On the mainpage i have jomsocial installed

And then again if i type:

http://mysite.com/news/something i get >> 404
On this link there is no jomsocial installed


So what to do now?
Reply With Quote
  #5  
Old 13th October 2012, 13:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
 
Default

For Joomla, you need this configuration in the nginx Directives field in ISPConfig:

Code:
       # deny running scripts inside writable directories
       location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
                return 403;
                error_page 403 /403_error.html;
       }

       location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;

       }

       # caching of files
       location ~* \.(ico|pdf|flv)$ {
                expires 1y;
       }

       location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt|otf|woff)$ {
                expires 14d;
       }
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
apt-get update Fails For UBUNTU Gutsy Gibbon giganet Server Operation 1 1st May 2009 16:24
Getting e-mail working hansoffate Installation/Configuration 29 13th August 2008 17:33
problem in: The Perfect Setup - Ubuntu 6.06 LTS Server PermaNoob HOWTO-Related Questions 6 15th January 2007 20:13
apt-get failure yap HOWTO-Related Questions 1 19th November 2006 23:33
ispconfig and mambo shajazzi Installation/Configuration 70 28th March 2006 20:29


All times are GMT +2. The time now is 03:54.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.