CakePHP webroot not accessible on new Apache setup - apache

I've just set up a new Ubuntu 10.4 slice on Slicehost, and have installed apache, mysql and php. I've uploaded my CakePHP app and everything is running fine, except for the webroot being inaccessible. I have tried adding AllowOverride to all in /etc/apache2/sites-available/default and followed the Cake instructions to httpd.conf by adding
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all</Directory>
However, this is still not redirecting properly. I've hacked the css script tags to point to /app/webroot/css but would really like to know how to solve this issue properly. Any help would be much appreciated, this is the first time for me to setup a new slice, so apologies for the noobish question

For me this sounds like mod_rewrite problem. Could you check if you enabled your mod_rewrite in apache configuration?

Related

Apache2 at VPS without domain

I want to use Apache2 at VPS to host my test websites.
Now I have a Joomla website and can reach it using 111.111.111.111/mydomain.com
But the troubles becomes when I trying to reach website's page like 111.111.111.111/mydomain.com/about.html
Not Found
The requested URL was not found on this server.
I think I need to configure apache right way but I don't know how.
Yes I know I can register some domain name but I prefer to use 111.111.111.111/mydomain.com address for now.
Thank you.
After many attemptions I had resolved it.
First of all you need to check the apache2.conf file. There must be active string AllowOverride All .
And next block
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Then you need activate rewrite module
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
And better restart your Virtual Machine.

How do I configure CakePHP to run on WAMP without using bin\cake server or :8765?

I'd like to run CakePHP on WAMP but without having to run bin\cake server or use the default port :8765 but I am struggling to figure out how.
I tried changing apache httpd.conf to
DocumentRoot "c:/wamp/www/dev/cakephp3/tradeshows/webroot"
Which is what I took away from http://book.cakephp.org/3.0/en/installation.html#production
But it doesn't work still.
http://localhost does show the CakePHP landing page, but when I try going to http://localhost/events I'm getting:
Not Found
The requested URL /events was not found on this server.
If I go to http://localhost:8765/events and do bin\cake server then it works perfectly.
How can I make it so that I don't have to run bin\cake server to work correctly? I'm just trying to make a simple database for me and my coworker to use on our computers to put in tradeshow information.
Following the tutorial here I was able to get it working, first time I tried I was editing the wrong config file:
Open C:\wamp\bin\apache\apache2.4.9\httpd.conf
Edit the part <Directory /> to read:
<Directory />
Options FollowSymLinks
AllowOverride All
# Order deny,allow
# Deny from all
</Directory>
Then also had to uncomment the line:
LoadModule rewrite_module modules/mod_rewrite.so
Which is different slightly than what's in the link but still did the job.

Laravel Not loading inner pages in Ubuntu -- Not found with 404

I have developed a laravel web application and running fine on live server, now I am trying to migrate that project to a local server,
I am using Ubuntu 14.04 with built-in php, apache, and MySQL.
When I pointed in a browser like a localhost/xxxxxxx/ (Login page) that worked finely, after entering values in the login form it showed the 404 Not Found error.
How can I solve this, anybody please help?
This issue due to htaccess.
run
sudo a2enmod rewrite
Also change this in apache2.conf file located at /etc/apache2
nano /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Finally Restart Apache
sudo service apache2 restart
Working great. !!!!!

Apache not rewriting, magento local copy

I have a working Magento shop online. I'm trying to make it run locally as a copy for testing purposes. Everything works, except the url rewriting. I've already added the AllowOverride All option to my httpd config file, as everyone here suggested.
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
I also have RewriteEngine on in my .htaccess file (same htaccess as the online website). Still I'm getting the index.php 404 error on every other page than the homepage. http://www.example.com/index.php/randompage however does work. What's also strange is that the same configuration works for developer, but not for me. So it must be something apache specific I guess.
I've tried a lot of given suggestions in similar topics but nothing worked :(
Running macosx 10.9.5
I'm out of ideas. Thanks in advance!
You must have mod_rewrite enabled for apache.
Run a2enmod rewrite and then /etc/init.d/apache2 restart
You can try setting the RewriteBase parameter which may fix the issue.
In the .htaccess file in your Magento root on your local machine, look for the following:
#RewriteBase /magento/
Change it to
RewriteBase /

EasyPHP modules folder conflicts with Drupal

I installed EasyPHP and set up a Drupal installation and a virtual host, so that I could see my site at sitename.local in my browser.
At first, it seemed like it was working, but it looked odd. The size of the text was different and certain page elements were displayed that were supposed to be hidden.
I found that the CSS was not loading from /modules/system. This was odd, because other CSS files would load fine. When I tried to access those CSS files directly, EasyPHP would throw "Object not found!"
So I tried navigating in my browser to sitename.local/modules. I would expect it to say "Access forbidden", but instead it showed the index of the EasyPHP modules folder.
I looked in httpd.conf and found this line, which seems to be the culprit:
Alias /modules "${path}/modules"
If I comment out that line, my site works normally, but I run into errors in EasyPHP because the module path is not found.
Is there way to rewrite this line so that it only redirects 127.0.0.1/modules and not sitename.local/modules?
Jus run into the same problem on EasyPHP 14.1VC11 and Drupal 7.26
Adding alias in virtualhost configuration worked for me:
<VirtualHost *:8080>
DocumentRoot path-to-site-folder
ServerName site-name
Alias /modules "path-to-site-folder/modules"
<Directory "path-to-site-folder">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
Allow from 127.0.0.1
Deny from all
Require all granted
</Directory>
The correct answer is actually the answer posted by #ahokkonen, but without the **.
So, adding Alias /modules "path-to-site-folder/modules" solves the issue (I just did this and it works.