.htaccess werkt niet.
Ik heb een webserver geinstalleerd met apache2 en php5. Nu wil ik zend framework gaan gebruiken maar mijn .htaccess bestanden werken op een of de andere manier niet.
Ben al 2 dagen bezig met het configureren van de server
Ik heb httpd.conf aangepast. Nu word mijn phpmyadmin wel onzichtbaar gemaakt in mn www root. dmv
<Directory /phpmyadmin>
Options FollowSymLinks
AllowOverride All
</Directory>
In mijn .htaccess staat "deny from all"
In mijn httpd.conf:
ServerRoot "/etc/apache2"
DocumentRoot "/var/www"
ServerName localhost
<Directory "/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /phpmyadmin>
Options FollowSymLinks
AllowOverride All
</Directory>
Gewijzigd op 01/01/1970 01:00:00 door Leendert
Ojah en mod_rewrite staat natuurlijk aan!
---
'Default' directory doe je zonder "/", dus:
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<Directory>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Kloppen je virtual hosts?
Syntax error on line 11 of /etc/apache2/httpd.conf:
<Directory> directive requires additional arguments
Blijkbaar mistie wat als ik die er in zet.
Wat bedoel je met Virtual hosts?
Ik heb kan server local aanroepen met het ip?
<Directory /> dus
Maar met quotes mag net zo goed, dus de post van Jason was iets overbodig.
Wat werkt er nou niet precies Leendert?
Je schrijft:
'In mijn .htaccess staat "deny from all"'
Wet bedoel je hiermee?
Ik wil urlrewriting gaat toepassen dmv .htaccess dit blijkt niet te werken dus probeer ik eerst de .htaccess aan de praat te krijgen.
Als je in directory een .htaccess zet met daarin "deny from all" kom je er niet in. En werkt het dus... Puur testcase.
Wat er niet werkt is dat de server geen .htaccess bestanden wil lezen of deze overslaat.
Denk dat het Php.ini en httpd.conf instellingen zijn. maar weet het niet zeker.
Je schrijft:
Als je in directory een .htaccess zet met daarin "deny from all" kom je er niet in. En werkt het dus... Puur testcase.
Dat betekend dus dat de .htaccess file werkt, en je configuratie goed is.
Zet eens in je .htaccess file:
Code (php)
1
2
3
4
5
6
7
2
3
4
5
6
7
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} -f [OR]
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule .* - [L]
RewriteRule ^/test/$ test.php [QSA,L]
RewriteCond %{SCRIPT_FILENAME} -f [OR]
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule .* - [L]
RewriteRule ^/test/$ test.php [QSA,L]
Maak vervolgens een bestand test.php aan, en ga naar www.jesite.nl/test/
En als ik "deny from all" er in zet, krijg ik gewoon toegang.
Maargoed dat url rewriting werkt dus!
Ik ga even verder proberen :)
Gtz Ldt
www.jesite.nl/projectx/test/
En zo werkt het niet? Als ik dezelfde .htaccess ook in deze map zet?
EDIT:
Gaan toch nog veel dingen mis... :(
En zo werkt het niet? Als ik dezelfde .htaccess ook in deze map zet?
EDIT:
Gaan toch nog veel dingen mis... :(
Gewijzigd op 01/01/1970 01:00:00 door Leendert
http://www.quesucede.com/blog/?p=10
In Apache2 zit een gelinkt configfile die de admin-file overschrijft.
Werkt standaard NIET met Zend Framework!
Weer wat geleerd iig :)
I’ve just updated my personal system from Ubuntu 7.04 to Ubuntu 7.10 and must admit that I’m impressed with the progress it has made in 6 months. The most noticeable (and practical) change in my opinion is the font support (very important when you have been programming 10 hours straight). Just beautiful. Anyway, this post is not about Ubuntu but rather about setting up the Zend Framework on Ubuntu.
First of all, you have to install the appropriate packages with Synaptic Package Manager. Let’s start with installing PHP5 (the Zend Framework only works with PHP 5.13 or PHP 5.14 and above) and all its dependent libraries. The next package to install is the PHP5-MySQL library which includes both the ‘pdo_mysql’ and the ‘mysqli’ modules. In my case, I’m interested in the PDO-module because the topic map store (used in QueSucede.com) is implemented on top of the PHP Data Objects (PDO) extension.
Right, that was the easy part. The tricky part is the Apache configuration which is not difficult but you can’t skip these few essential steps otherwise the Zend Framework will just not work. So, what is the Apache stuff all about? Well, in two words: URL rewriting. Those two words are enough to strike fear into the heart of any intrepid developer ;-)
Okay, just kidding. In Ubuntu, it is relatively simple to enable Apache URL rewriting. First of all, open a terminal and change directory to ‘/etc/apache2′. Within this directory you’ll see the two directories that we are interested in, namely ‘mods-enabled’ and ’sites-enabled’. The mods-enabled directory contains a bunch of symbolic links to (Apache) configuration files/directives that Apache uses to load modules when it (re)starts. So all we have to do is create the symbolic link to the appropriate directive (in our case ‘rewrite.load’ ) by executing the following line in the terminal window (from within the mods-enabled directory):
ln -s ../mods-available/rewrite.load rewrite.load
Once that is done, we change to the previously-mentioned ’sites-enabled’ directory and load the ‘000-default’ file (a symbolic link to /etc/apache2/sites-available/default) into a text-editor and change the following: ‘AllowOverride None’ to ‘AllowOverride All’ in both the <Directory /> and <Directory /var/www> sections. Once that is done, save the file and open up the ‘Services Admin’ window and restart Apache (Web server). That’s it. URL rewriting should be enabled in Apache.
In my next post we’ll install the Zend Framework and set-up a skeleton application which will demonstrate the basics of the framework.
Speak to you soon.
Oplossing gevonden op In Apache2 zit een gelinkt configfile die de admin-file overschrijft.
Werkt standaard NIET met Zend Framework!
Weer wat geleerd iig :)
I’ve just updated my personal system from Ubuntu 7.04 to Ubuntu 7.10 and must admit that I’m impressed with the progress it has made in 6 months. The most noticeable (and practical) change in my opinion is the font support (very important when you have been programming 10 hours straight). Just beautiful. Anyway, this post is not about Ubuntu but rather about setting up the Zend Framework on Ubuntu.
First of all, you have to install the appropriate packages with Synaptic Package Manager. Let’s start with installing PHP5 (the Zend Framework only works with PHP 5.13 or PHP 5.14 and above) and all its dependent libraries. The next package to install is the PHP5-MySQL library which includes both the ‘pdo_mysql’ and the ‘mysqli’ modules. In my case, I’m interested in the PDO-module because the topic map store (used in QueSucede.com) is implemented on top of the PHP Data Objects (PDO) extension.
Right, that was the easy part. The tricky part is the Apache configuration which is not difficult but you can’t skip these few essential steps otherwise the Zend Framework will just not work. So, what is the Apache stuff all about? Well, in two words: URL rewriting. Those two words are enough to strike fear into the heart of any intrepid developer ;-)
Okay, just kidding. In Ubuntu, it is relatively simple to enable Apache URL rewriting. First of all, open a terminal and change directory to ‘/etc/apache2′. Within this directory you’ll see the two directories that we are interested in, namely ‘mods-enabled’ and ’sites-enabled’. The mods-enabled directory contains a bunch of symbolic links to (Apache) configuration files/directives that Apache uses to load modules when it (re)starts. So all we have to do is create the symbolic link to the appropriate directive (in our case ‘rewrite.load’ ) by executing the following line in the terminal window (from within the mods-enabled directory):
ln -s ../mods-available/rewrite.load rewrite.load
Once that is done, we change to the previously-mentioned ’sites-enabled’ directory and load the ‘000-default’ file (a symbolic link to /etc/apache2/sites-available/default) into a text-editor and change the following: ‘AllowOverride None’ to ‘AllowOverride All’ in both the <Directory /> and <Directory /var/www> sections. Once that is done, save the file and open up the ‘Services Admin’ window and restart Apache (Web server). That’s it. URL rewriting should be enabled in Apache.
In my next post we’ll install the Zend Framework and set-up a skeleton application which will demonstrate the basics of the framework.
Speak to you soon.