I just got the Rob Allen's Album Rest tutorial working on my windows machine with sql server.
I can see all the albums show up on my screen. But when i click on the edit,delete,add links i get a "Not Found" error and it says
The requested URL /zf2-tutorial/public/album/edit/1 was not found on this server.
Am i doing something wrong here. My first guess is that i have not set vhosts, so it can be the problem. But this works just fine on my mac without any issues.
Also, as a little background. There is an IIS server running on port 80 and Zend server running on port 81.
Would this be an issue again ?
Fixed it, all i had to do was change AllowOverride None to AllowOverride All for .htaccess in my httpd.conf
http://framework.zend.com/manual/2.0/en/user-guide/overview.html
Related
I have set up an elastic beanstalk and deployed my application to it, the application has a .htaccess file in it. .htaccess works perfectly on my localhost but when checking it on the live server it gives back a 404 error.
For Example
I have a login file named login_1.php, on my .htaccess I've set the file to be called login.
When clicking the login link on my localhost it sends me to the login_1.php file with the URL name of login, but when clicking on the login link on the live server it takes me to a 404 error.
I've followed all instructions on the internet regarding this issue but nothing seems to solve the problem. I've changed AllowOverride None to AllowOverride All on my httpd.conf file. I do not have apache on my ec2 Linux 2 AMI instance so I can't restart apache.
Any help would be much appreciated to fix this.
Thanks,
Arnav
Figured out the answer, went into my elastic beanstalk application and changed the application type to APACHE instead of NGINX. This start httpd sever and allowed me to activate the .htaccess file in my application.
Trying to set up a laravel 5.1 project on EC2 (aws). I've so far installed a LAMP stack (php 5.6) and composer. It all seems to be working fine. Was even able to run migrations for the laravel app, But whenever I try to go to any route except '/' I get a
Not Found
The requested URL /public/pricing was not found on this server.
Apache/2.4.7 (Ubuntu) Server at compute.amazonaws.com Port 80
error.
Not sure whats going on. It works perfectly fine on my localhost using mamp.
Three things to consider;
1) you should set the document root to public not the Laravel directory. In simpler words, users should be be able to access the Laravel directory.
2) check out your Apache find files or .htaccess to allow for override
AllowOverride All
3) Make sure mode_rewrite is enabled
sudo a2enmod rewrite
So it sounds/looks like you are missing the htaccess file:
http://laravel.com/docs/5.1#configuration
If you navigate to /public/index.php?pricing, the webpage will most likely show up even now.
You will need to configure the .htaccess file to pass requests to index.php to handle the routing.
I enabled mod rewrite
Set up htaccess
AllowOverride All
It didn't change anything. I then killed the connection to the server and rebooted and everything was working. Not exactly sure why this worked but fortunately it did.
I am trying to create a new domain which runs on SilverStripe 3.0. I am unable to figure out the issue. If I upload a custom php page then it runs fine, but my website is not working. It shows blank page but shows the favico.
If I try to open up www.mydomain.com/admin/, I get the error
Page Not Found
The requested URL /admin/pages was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This is not a Silverstripe error page. Here is my php info Info
Please let me know if I am missing something or there is any way to figure out the issue.
Try www.yourdomain.com/index.php/admin
If that works then it is because your rewrites are not working. This can be because .htaccess isn't configured properly, or because .htaccess is not used at all (in which case you need to edit your server config).
Last I used Plesk it always used apache. If that is different now and you're using nginx as more than a forward proxy, then you will need to set up the redirects for your site manually.
It does sound like your .htaccess is not being respected. Does Plesk allow overrides for .htaccess in the local directory?
At an apache level we would have something like this stanza to ensure the the .htaccess of the project was respected;
AllowOverride All
If your .htaccess is being processed, make sure that your host has mod_rewrite enabled as that is required to access to pretty URLS.
Earlier today I tried installing the MyImouto image board software on my Apache server. I already have the full MediaWiki engine installed on port 80 (localhost/wiki/) and the MyImouto board installed in a virtual host on port 3000, running completely separate from the main web server.
After fiddling around a little, I made a mistake with a php-based upload on the main server and had to reinstall apache and php both, which I did, and upgraded to the latest versions (Apache 2.2.22 and PHP 5.4.0). I managed to get my setup up and running successfully, both with the port 3000 virtual host and without. And MediaWiki functions fine, except for one thing.
NOW when I type in http://localhost/wiki/index.php as I have always done in the past, something is redirecting it to http://localhost:3000/wiki/index.php/Main_Page and shifting it to the other virtual host, where there is no wiki at all. However http://localhost/wiki/index.php/Main_Page does work perfectly.
There's an .htaccess file in localhost:3000 which I renamed to something else, but that doesn't seem to do the trick. I also tried clearing the browser cache as well as running a session_destroy via php. It didn't fix it.
I even turned off the second virtual host in Apache's httpd.conf, but it still redirects me which tells me that it is something in the main webserver. I did not touch the MediaWiki configuration or code during this entire time.
I also attempted accessing http://localhost/phpMyAdmin and THAT redirected me to http://localhost:3000/phpMyAdmin/, as well as http://localhost/AdminTools which does the same type of thing. Httpd.conf now no longer has any references at all to the virtual host *:3000.
However, my main index (http://localhost/index.php) has the following header redirect, which successfully lets it work even when http://localhost is typed into the address bar.
header("Location: index.php?content=main");
I tried disabling expires_module and headers_module in Apache, thinking there might be some weird caching issue due to that now-renamed .htaccess file. That did not help either. In addition, I checked my hosts file and there is nothing odd in there, nor am I proxying through anything (this -is- localhost after all).
Would appreciate any help in figuring out what's causing this and how to fix it.
Windows XP SP3
Enabled Modules in Apache:
actions, alias, asis, auth_basic, authn_default, authn_file, authz_default, authz_groupfile, authz_host, authz_user, cgi, dir, env, expires, headers, include, isapi, log, mime, negotiation, rewrite, setenvif, php5
Enabled extensions in PHP:
curl, fileinfo, gd2, mbstring, exif, mysql, mysqli, openssl, pdo_mysql, sockets
I managed to figure it out. After fiddling a little bit with .htaccess and Rewrite Rules (none of which did anything), I took a look inside my httpd.conf file again and found that I had typo'd my port-80 Virtual Host:
<VirtualHost *:80>
ServerAdmin -myemail-#gmail.com
ServerName -blahblah-.no-ip.org:3000
DocumentRoot "C:/wwwroot/tfg"
<Directory "C:/wwwroot/tfg">
OptionsIndexes FollowSymLinks
AllowOverride All
Allow from all
Deny from 186
Deny from 187
</Directory>
</VirtualHost>
When in fact it should have been ServerName -blahblah-.no-ip.org:80.
Simple typos: always the ones that slip by the easiest.
I have downloaded a php web application from the web (OntoWiki).
After the installation I've tried it and it works fine on my Ubuntu 10.10, but when I try to install it on CentOS Linux, the only page that works is the home page (index.php).
If i try to change the page, the browser sends me a 404 error page (page not found).
Instead if i try to change the URL with the "index.php" as prefix it works fine.
Example:
localhost/app/index.php/directory -> works
localhost/app/directory -> doesn't work (404 error)
Why does this happen? On the PC where the program works i have the URL like: host/application but everything works fine.
Is there an Apache Configuration problem?
Thanks in advance
Check you have mod_rewrite enabled on your CentOS server.
Active the Apache rewrite module:
a2enmod rewrite
Restart Apache.
In an application like OntoWiki, all requests are directed through index.php. An .htaccess file accompanies the project including RewriteRule's to map a path like /directory to /index.php/directory.
Apache's mod_rewrite module must be installed and enabled for the host in order for the RewriteRules to be applied. It sounds like you have it disabled on your CentOS box and enabled locally.