Does not work routing on prod environment - php

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.

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.

Heroku open and get 502 error with Codeigniter

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

500 Internal Server Error when accessing domain/foldername

I am getting the 500 Internal Server Error on my website.
Full message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster#subxchange.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.4.10 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 Server at subxchange.com Port 443
Image: http://i.gyazo.com/31e237bca4593dc71b0923ba9c044ae1.png
I am getting the message when trying to access my admin panel such as domain.com/admin-panel
I can however access the frontend just fine such as domain.com.
I have checked the permissions and folders are set to 755 while files are set to 644.
This is the error log:
[Sat Jun 20 14:57:59.954476 2015] [:error] [pid 7920] [client 213.114.166.90:35286] SoftException in Application.cpp:357: UID of script "/home/subxchange/public_html/admin-panel/index.php" is smaller than min_uid
[Sat Jun 20 14:56:09.703965 2015] [:error] [pid 7564] [client 213.114.166.90:35213] SoftException in Application.cpp:357: UID of script "/home/subxchange/public_html/admin-panel/index.php" is smaller than min_uid
[Sat Jun 20 14:56:09.398852 2015] [:error] [pid 7910] [client 213.114.166.90:35198] SoftException in Application.cpp:357: UID of script "/home/subxchange/public_html/admin-panel/index.php" is smaller than min_uid
....
Does someone have any idea how to solve this?
It's a permissions issue, you need to set correct user and group ownership in addition to rwx:
chown -R www-data:www-data /home/subxchange/public_html
And make sure correct properties for public_html are set:
chmod 755 -R /home/subxchange/public_html

"Premature end of script headers" with mod_fcgid and PHP

I'm trying to install Wordpress on Windows 7. I'm using Wordpress 3.9.2, Apache 2.2.25 (httpd-2.2.25-win32-x86-openssl-0.9.8y.msi), PHP 5.5.16 (php-5.5.16-Win32-VC11-x86.zip), and mod_fcgid 2.3.6 (mod_fcgid-2.3.6-win32-x86.zip).
Here are the Apache settings I'm trying to use:
LoadModule fcgid_module modules/mod_fcgid.so
FcgidInitialEnv PHPRC "C:/php"
AddHandler fcgid-script .php
FcgidWrapper "C:/php/php-cgi.exe" .php
When I try to visit any page, I get a 500 Internal Server Error, with error.log entries such as these:
[Thu Aug 21 13:45:45 2014] [warn] [client 127.0.0.1] (OS 109)The pipe has been ended. : mod_fcgid: get overlap result error, referer: http://localhost:8080/wordpress/readme.html
[Thu Aug 21 13:45:45 2014] [error] [client 127.0.0.1] Premature end of script headers: install.php, referer: http://localhost:8080/wordpress/readme.html
[Thu Aug 21 14:05:05 2014] [warn] [client 127.0.0.1] (OS 109)The pipe has been ended. : mod_fcgid: get overlap result error
[Thu Aug 21 14:05:05 2014] [error] [client 127.0.0.1] Premature end of script headers: test.php
I notice that the PHP files in the Wordpress distribution appear to use LF line endings instead of CRLF. However, test.php is a tiny file I created in Notepad, which therefore must be using CRLF endings instead of LF. Therefore, the line endings don't seem to be the problem.
Well, it works now, and I don't know how I fixed it.
Here's what I remember happening. test.php was giving me the above 500 error. I tried running php.exe in the Windows command line, and I also uncommented the error_log line in php.ini. (Both of these actions revealed the apparently unrelated warning "PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_mysqli.dll' - The specified module could not be found.") Then I tried visiting test.php again, and it worked.

Apache 2.2.14 + php_apc.dll crash

I can't get APC to work on Windows because Apache keeps crashing as soon as I run a php file. Is this issue know and is there a workaround?
Versions:
Apache 2.2.14
PHP 3.1
APC 3.1.3
The best route to solve this type of problem is to check your Apache log files and see what issues were raised. An example of these logs follows:
[Wed Jun 03 06:07:47 2009] [alert] [client 127.0.0.1] C:/wamp/www/WebsiteA/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
[Wed Jun 03 06:08:16 2009] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/kohana, referer: http://localhost/WebsiteB/website/

Categories