Heroku open and get 502 error with Codeigniter - php

Just checked my logs and I'm getting this error:
2015-12-21T17:41:06.304648+00:00 app[web.1]: [Mon Dec 21 17:41:06.303907 2015] [autoindex:error] [pid 100:tid 139688442590976] [client 10.147.38.224:15662] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive.
What is going on?

This is likely an issue with you not setting up your Heroku environ properly...have you read through all the documentation? Do you have a Procfile setup in your app root?
Use a Procfile, a text file in the root directory of your application, to explicitly declare what command should be executed to start your app.
https://devcenter.heroku.com/articles/getting-started-with-php#define-a-procfile

Related

500 Server Error after moving media wiki directory

I had a media wiki installation on the main directory /public_html/ of my domain and had short URLs enabled to http://example.org/wiki/Page_title so I had an .htaccess file with the following rules
# Enable the rewrite engine
RewriteEngine On
# Short url for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]
# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/index.php [L]
I want to install other applications in the main directory of that domain so I am trying to move this media wiki installation from the root /public_html/ directory to the /public_html/w/ while keeping the same short url format. So all I did was copy the content from the main directory to the /public_html/w/ directory and modify the .htaccess rules to
## http://www.mediawiki.org/wiki/Manual:Short_URL/Apache
# Enable the rewrite engine
RewriteEngine On
# Short url for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
And also modify the LocalSettings.php file in the new directory from
$wgScriptPath = "";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
to
$wgScriptPath = "/w";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
In theory, since it's using the same db and all the same settings all I needed to change was the htaccess and localsettings.php directories and it should work fine but after I tried it I got a 500 server error and the site was not working at all and after I checked apache/php error logs I found a lot of the same stuff
[Sun Feb 28 13:59:14.477785 2016] [:error] [pid 12164] [client SERVER IP] script '/home/admin/web/MY DOMAIN/public_html/index.php' not found or unable to stat
[Sun Feb 28 13:59:21.854117 2016] [:error] [pid 12165] [client SERVER IP] script '/home/admin/web/MY DOMAIN/public_html/index.php' not found or unable to stat
[Sun Feb 28 13:59:32.073190 2016] [:error] [pid 12374] [client SERVER IP] script '/home/admin/web/MY DOMAIN/public_html/index.php' not found or unable to stat
[Sun Feb 28 13:59:33.574025 2016] [:error] [pid 12166] [client SERVER IP] script '/home/admin/web/MY DOMAIN/public_html/index.php' not found or unable to stat
[Sun Feb 28 13:59:35.873162 2016] [:error] [pid 12167] [client SERVER IP] PHP Warning: require_once(/home/admin/web/MY DOMAIN/public_html/w/extensions/MsUpload/msupload.php): failed to open stream: No such file or directory in /home/admin/web/MY DOMAIN/public_html/w/LocalSettings.php on line 301
[Sun Feb 28 13:59:35.873207 2016] [:error] [pid 12167] [client SERVER IP] PHP Fatal error: require_once(): Failed opening required '/home/admin/web/MY DOMAIN/public_html/w/extensions/MsUpload/msupload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/admin/web/MY DOMAIN/public_html/w/LocalSettings.php on line 301
Notice the first errors are still referring to the previous root /public_html/ directory while the extensions errors are already referring to the /public_html/w/ directory
I have no clue where I went wrong here so I would appreciate some help. So far I had to revert the changes and restore a backup I had for the old directory but I still want to move the wiki directory.
If you are still keeping /home/admin/web/MY DOMAIN/public_html/ as the root directory (as identified from the webserver) but, moving Mediawiki down a level, you might need to change the following:
RewriteBase /w/
There is no need to move media wiki from the currently operational location. As you are installing additional applications and media wiki already uses short URL's which makes accessing articles work using the form example.org/wiki/Article_Title what you can do is install the new applications in sub folders right along side the mediawiki installation without any issues at all, as the .htaccess rules will provide exceptions for files and folders which exist on the server.
Example folder structure
public_html /
app1/
index.php
...
app2/
index.php
...
app3/
index.php
...
... (all media wiki files and folders)
I'm not familiar with MediaWiki, but given this comment:
Notice the first errors are still referring to the previous root /public_html/ directory while the extensions errors are already referring to the /public_html/w/ directory
I found the following comment on mediawiki.org:
If you redefine this [$wgScriptPath] in your LocalSettings.php then all dependent variables will need redefining too!
I'd investigate what else is set during installation time using this value, as that may be the cause of your issue.

Apache Server error 500 when DocumentRoot is a symlink

I have setup my fedora system, the default was that / size is 50gb while remaining drives where put on /home.
since I don't want to waste my precious 50gb for my web project I setup my apache web server as follow
since the default of apache is /var/www/html
i remove html dir and replace it with a symbolic link that points to my /home/user/www/html
note /home, /home/user, /home/user/www, /home/user/www/html have x permission for apache
my conf is like this
DocumentRoot "/var/www/html"
<Directory "/var/www">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
I already restart my httpd service and it was fine. The problem is when I try to access my index.php I get a server error. when it's index.html I get a 403.
my selinux is currently enabled and no plans on disabling it. I would Like to learn how to use it rather. so it this an selinux problem?
As I run ls -Zla on /home/user/www/html, this is the result
-rw-r--r--. 1 root root unconfined_u:object_r:user_home_t:s0 27 Dec 21 22:37 index.php
It seems that SELinux is preventing this
when accessing an html
[Mon Dec 21 23:35:33.749916 2015] [core:error] [pid 20579] (13)Permission denied: [client 127.0.0.1:45632] AH00132: file permissions deny server access: /var/www/html/index.html
when a php
[Mon Dec 21 23:39:36.801672 2015] [:error] [pid 20585] [client 127.0.0.1:45816] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
[Mon Dec 21 23:39:36.801730 2015] [:error] [pid 20585] [client 127.0.0.1:45816] PHP Fatal error: Unknown: Failed opening required '/var/www/html/index.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0
~
to someone that may get this problem. change the selinux type of the folder using this command.
sudo chcon -R -t httpd_sys_content_t /home/user/www
more info

Why I obtain this 403 Forbidden error when I try to access to this WordPress website? Why it can't read the .htaccess file?

I have some problem trying to open this WordPress website: http://www.angeliniappalti.it/
As you can see trying to open it I obtain this 403 error message, this one:
Forbidden
You don't have permission to access /wp-admin on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2 Server at www.angeliniappalti.it Port 80
Reading online I see that it is a well know issue but I can't find a solution for my problem.
So looking into the Apache Errors Log I can see the following error message:
[Mon Feb 09 01:27:18 2015] [crit] [client 157.55.39.155] (13)Permission denied: /home/ang12457/domains/angeliniappalti.it/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Mon Feb 09 01:27:18 2015] [crit] [client 157.55.39.155] (13)Permission denied: /home/ang12457/domains/angeliniappalti.it/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
So it seems that it can't read the .htaccess file but it's permission is setted to 777 so in theory this file should be readable.
This is the content of my .htacess file:
AuthGroupFile /dev/null
AuthUserFile /home/ang12457/domains/angeliniappalti.it/.htpasswd/public_html/.htpasswd
AuthName "area riservata"
The .htaccess file is contained into the public_html directory (that contains also the WordPress directory) and it have 700 as permission.
What could be the problem? What I am missing? How can I try to solve this issue?
Tnx
Solved by myself, I simply have changed the permission of the public_html directory from 700 to 750 and it works :-)

Does not work routing on prod environment

Does not work routing on prod environment, but on dev all pages load.
Apache log:
[Fri May 17 23:50:05 2013] [error] [client 127.0.0.1] File does not
exist: /mnt/d/web/project/web/front
Browser:
Not Found The requested URL /front was not found on this server.
I changed in virtualHost:
from "AllowOverride none to "AllowOverride All". Now, it work.

PHP page doesn't load. Instead it gives me a 404 error

The title describes the question.
I have PHP installed, Apache, MySQL and also phpMyAdmin in the htdocs folder of Apache. I installed them separately and do not use a compilation package. I did try to create a php file with phpinfo
<?php
phpinfo();
?>
Saved the file as phpinfo.php
When going to
http://localhost
I see the phpinfo.php file listed. When I click the phpinfo.php file
I get a 404 error. There are no other files listed in the root http folder except one (phpinfo.php)
PHP was installed and php short tags are enabled
short_open_tag = On
I am not sure if it's a capital On or on
Note: I used http://www.jesterwebster.com/setting-up-a-test-bench-web-server-with-apache-php-mysql-and-more-on-windows/26 as a guide for my Apache and PHP install
I opened the error log and I found something disturbing. Not sure how to fix it
[Fri Aug 03 13:07:34 2012] [error] [client 127.0.0.1] File does not exist: C:/website/example/online/Program Files, referer: http://localhost/
[Fri Aug 03 13:09:33 2012] [error] [client 127.0.0.1] File does not exist: C:/website/example/online/Program Files, referer: http://localhost/
Per your error logs, your DocumentRoot "C:/websites/example/online" is websiteS, your error log is looking for website without the s.
Have you confirmed from apache configuration file that PHP is enabled and is configured correctly to work with apache? And has the apache server been restarted after configuration? Also Try adding an html file in the htdocs directory to confirm if the directory is correct.
Edit: Also you mentioned that error log is looking for your file in this directory
C:/website/example/online/Program Files
But you mentioned that you placed phpinfo.php in htdocs folder for apache. There might be an issue related to difference between those two paths

Categories