I run Cakephp 2.0 on Ubuntu 10.04, Mysql, Apache2, PHP5, hosted at linode.com. Just two days ago, when clicking on the link from my homepage www.cross-town-traffic-software.com to freecite, I get the mod_rewrite message from Cakephp. Sometimes I don't. I have check all of my logs and nothing comes up. I checked the sites-available and all of the .htaccess files and they are all inorder, how do I trouble shoot?
sudo a2enmod rewrite
sudo gedit /etc/apache2/sites-enabled/000-default
Check for these lines and change as I have done here :
DocumentRoot /var/www/
Options FollowSymLinks
AllowOverride all
Options FollowSymLinks
AllowOverride all
Order allow,deny
allow from all
Save the file & restart apache :
sudo /etc/init.d/apache2 restart
It's pretty simple! cake.generic.css contains the following:
/** Elements **/
#url-rewriting-warning {
display:none;
}
So when you remove that file #url-rewriting-warning will be displayed.
Cheers,
Fredrik
Related
I have a problem to get my asp.net site running on my Apache webserver on my Raspberry Pi. I was already looking on different online boards, but I did not find any good intstructions how to proceed.
What is already done:
Mono Complete and Mono Develop are installed (latest version 4)
XSP4 installed
Apache2 installed (default website is working)
Mod_mono (version4) installed and activated
I have generated a test website with the file "Test.aspx" and copied to the folder /var/www/Test/
Then I have created a new config-file "Test.conf" on /etc/apache2/sites-available and activated it.
The content is:
DocumentRoot /var/www/Test
<Directory /var/www/Test/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
SetHandler mono
DirectoryIndex Test.aspx Test.html
</Directory>
What do I miss. I hope that someone can give me some good instructions. Thank you!
I just download via svn controle version a CakePHP 2.5.2 app to a test server .
After database configuration, the app does not open the css files located at app/webroot dir (bootstrap, jquery, main.css).
Is the some aditional config parameter ?
I try changing the owner but did not work.
It looks like a mod_rewrite problem.
Make sure you have .htaccess in your DocumentRoot, and your Apache server is configured properly.
Everything is described in detail in the CookBook.
CakePHP 2.x URL Rewriting
Edit: As described in the comments, it was solved by the OP by replacing the Directory definition in the apache vhost configuration file (/etc/apache2/sites-available/default.conf) with the following:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
Order Allow,Deny
Allow from all
</Directory>
I've been running Vagrant successfully for about a week. Last night I ran vagrant reload and now I can no longer access my sites.
VirtualBox version 4.2.16
Vagrant version 1.2.7
My Vagrantfile and bootstrap.sh: https://github.com/kriskd/vagrant-settings
Running on Mac
My files live at /vagrant/Sites. At first my "welcome page" which lives at /vagrant/Sites rendered at
http://localhost:4567/
All my projects are folders under Sites. For example, /vagrant/Sites/test won't render index.html. I get the following
Forbidden
You don't have permission to access / on this server.
Apache/2.4.6 (Ubuntu) Server at localhost Port 4567
The vhost looks like:
<VirtualHost *:80>
DocumentRoot "/vagrant/Sites/test"
ServerName test
<Directory "/vagrant/Sites/test">
AllowOverride All
</Directory>
</VirtualHost>
The vhosts are owned by root. My project files are owned by vagrant and chmod'ed 0777.
After no success, I did a full vagrant destroy followed by vagrant up and then the localhost host welcome page stopped rendering as well with the forbidden error.
My hunch is that this is not a vagrant issue at all but solely an Apache configuration glitch. There are a few things I can think to check.
First, obviously, is to confirm that the user that apache is running under has read and execute permissions for the DocumentRoot folder.
Since you mentioned Apache 2.4, there have been changes in the configs from 2.2. Make sure your Allow from all statements now read Require all granted. (If you were still on 2.2, you'd want to make sure they said Allow from all instead of Deny from all.) In either case, you can set this in each <VirtualHost> individually, or set a default in your <Directory /> block of the main httpd.conf file.
Getting more obscure, you could check for selinux, although I'm pretty sure this isn't present in Ubuntu by default. (It is in CentOS, for example.)
This is solved and in the end came down to some very simple things.
Use "Require All granted" instead of "Allow from All"
Put each websites' content at the same level namely /vagrant/Sites/default, /vagrant/Sites/test, /vagrant/Sites/real-site
Add .conf extension to vhost names such as test.conf and real-site.conf
Add AllowOverride All to vhosts to respect sites' .htaccess file (I realize that was in my original post, it got lost as I tried to solve this)
All very basic things that eluded me for a better part of a week. I hope this can help someone else.
I had the same problem when changing the DocumentRoot.
Since you've changed your DocumentRoot to "/any/path/foo/bar", make sure you have the permissions set on "apache2.conf" for this path.
Search for:
<Directory /any/path/foo/bar>
in apache2.conf
And add a new block like this:
<Directory /any/path/foo/bar>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
And my guess is that everything is gonna be fine!
cd /etc/apache2/sites-available
for file in `ls *`; do sed 's/\(.*<\/Directory.*>\)/Require\ all\ granted\n\1/' $file > $file.new;mv $file.new $file ; done;
because it worked before, I would not waste time on fix file by file
I have installed bugzilla and testopia on ubuntu but i am not able to open bugzilla GUI.
After running ./checksetup.pl the message i get is
""Now that you have installed Bugzilla, you should visit the 'Parameters'page (linked in the footer of the Administrator account) to ensure it is set upas you wish - this includes setting the 'urlbase'option to the correct URL.""
When i try to open it from browser ,i get the coding page but not the GUI of bugzilla.
Please help.
Regards,
Ruchi
You have to fix your webserver settings,
If you use Apache2, add the following settings to the /etc/apache2/httpd.conf file, by default it is an empty file.
Alias /bugzilla/ /var/www/bugzilla/
<Directory /var/www/bugzilla>
AddHandler cgi-script .cgi .pl
Options +Indexes +ExecCGI +FollowSymLinks
DirectoryIndex index.cgi
AllowOverride Limit
</Directory>
Dont forget to save the configuration!
ctrl + o
Then exit:
ctrl + x
Finaly restart the Apache2 webserver
sudo /etc/init.d/apache2 restart
It should work now :)
I'm trying to convert http://localhost/website to http://website.loc, but I'm not able to do that. Here's what I could do:
I edited /etc/hosts (I'm on Ubuntu) by changing 127.0.0.1 localhost to 127.0.0.1 localhost website.loc and saved changes
I created a new file named website inside /etc/apache2/sites-available with this content:
<virtualhost website.loc>
ServerName website.loc
DocumentRoot /home/myuser/projects/website/
<directory /home/myuser/projects/website/>
AllowOverride all
Options Indexes FollowSymLinks MultiViews
Order allow,deny
allow from all
</directory>
</virtualhost>
And I created a softlink to sites-enabled to enable this. After that, I restarted Apache.
By the way, I am using the Yii framework with any request to / redirected to /index.php, so index.php is not needed in the query.
So, when I write website.loc/ into chrome, it moves me to http://website.loc/site/login (the login index page, that's almost expected even if I was logged in as localhost, because the site url "changed" to website.loc, so the cookies are not shared), but the content is:
Not Found
The requested URL /website/index.php was not found on this server.
Apache/2.2.16 (Ubuntu) Server at website.loc Port 80
Am I doing something wrong? Thanks in advance, mates
Edit: It was all about the .htaccess inside /home/myuser/projects/website. It's RewriteBase was pointing to /website. Changing this to / and it worked like charm. Thanks #Chux for reminding me to check the .htaccess!
First, http://website.loc/index.php, check if that work. If that work, means that you need to create an .htaccess in your website root folder to enable that route format