First of all, am absolutely new in Phalcon, so I'm gonna tell the long story, if you want to go directly to the question, scroll down until you find ¡¡¡QUESTION!!!
I must say, It's been a headache to be able to install correctly phalcon in my linux distro. I'm using elementary OS Luna (based on Ubuntu 12.04), and well, I even had to do a fresh OS install to get rid of two differents php installations and some mysql issues when installing xampp.
Now, on fresh install, I installed separatedly apache + mysql + php + phpmyadmin (NO XAMPP) and everything seems to be working like a charm. Then I installed phalcon, and eventhough I had some difficulties, I could make it work, since I saw the phalcon extension in php.info() and the phalcon commands in terminal.
Now, when creating the demo http://docs.phalconphp.com/en/latest/reference/tutorial.html I did
$ cd /var/www/ $ phalcon project test
and I get the correct output
Phalcon DevTools (1.3.0) Success: Controller "index" was successfully created. Success: Project 'test' was successfully created.
But when going into http://localhost/test I saw this:
Mod-Rewrite is not enabled Please enable rewrite module on your web server to continue
So I googled, and found that I needed to edit "/etc/apache2/sites-available/default", I did and in the section "<Directory /var/www/>" I had to set "AllowOverride All", so that section was modified to be like this:
DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>
Then, I tried again http://localhost/test but this time I saw:
Volt directory can't be written.
So again, I googled and I found that was an issue with permissions of "cache" and "views" directories of the project. As I said, I'm quite newbie at phalcon, so I just found "views" folder, and I changed permissions to 777, It did nothing. So I decided to change permissions recursively to all project folder like this:
$cd /var/www/ $chmod -R 777 test
And after that, FINALLY I saw:
Congratulations! You're now flying with Phalcon. Great things are about to happen!
So NOW, I'm ready to really start reading documentation and programming with phalcon. Now after that long and boring story, it's time for the question.
I've read how to make an Alias for Apache www folder, to be able to work comfortably from a dir like "/home/my-name/web-docs/" where there are no issues for permissions and no deals with chmod every single change in a file. I did that adding this code to "/etc/apache2/sites-available/default":
Alias /web/ "/home/julian/web-docs/" <Directory "/home/julian/web-docs/"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>
And now, I'm able to go to http://localhost/web/ and see the index.html I have in "/home/julian/web-docs/index.html", quite easy, but when making an example phalcon project in that dir, not everything works that smooth. I did:
$cd /home/julian/web-docs $phalcon project blog Phalcon DevTools (1.3.0) Success: Controller "index" was successfully created. Success: Project 'test' was successfully created.
But when going to http://localhost/web/blog I got the surprising message:
Not Found The requested URL /home/julian/web-docs/blog/public/ was not found on this server. Apache/2.2.22 (Ubuntu) Server at localhost Port 80
I've checked, and the dir described exists, and permisions shouldn't be a problem there, am I right? I've googled and I haven't find a solution this time. Any help is appreciated. And again, sorry for all the long details.