Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Cakephp On Ubuntu, using your own public_html folder
paolocastro
post Feb 13 2008, 04:50 AM
Post #1


Newbie
*

Group: Members
Posts: 3
Joined: 7-February 08
Member No.: 57,521



Hi, there are many tutorials about this, but i would like to type the steps i followed in order to get cakephp working on my user public_html folder.
as many of you probably know, if you have apache's userdir module loaded, you can put your web pages on /home/user/public_html , and access them with the url: http://localhost/~user/ . I really prefer this, so all my web pages are on my personal home, but how to configure cakephp to work with these paths, i got a hard time with this, but finally got it!. here's how:

in case you don't have apache2's userdir module:
CODE
sudo ln -s /etc/apache2/mods-available/userdir.load /etc/apache2/mods-enabled/userdir.load
sudo ln -s /etc/apache2/mods-available/userdir.conf /etc/apache2/mods-enabled/userdir.conf


you need the rewrite module also... (this could be done with the same method used for userdir)
CODE
sudo a2enmod rewrite


Now lets edit some apache files...
CODE
sudo vim /etc/apache2/sites-enable/000-default

inside the first two <directory></directory> tags, change the AllowOverride lines:
CODE
<Directory />
                Options FollowSymLinks
                AllowOverride All      // change here
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All         // change here
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

do the same on /etc/apache2/mods-enabled/userdir.conf
CODE
<Directory /home/*/public_html>
                AllowOverride All        // change here
                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        </Directory>


Now you need to restart you apache2 server...
CODE
sudo /etc/init.d/apache2 restart


i'll assume you've already downloaded cakephp latest release or that you know where you can find it

unpack the downloaded file in /home/user/public_html/
rename the extracted folder (thats the name of your application)
CODE
cd /home/user/public_html/application_name

edit the .htaccess file so it look like these:
CODE
<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
   RewriteBase  /~user/application_name/
</IfModule>


now point your browser to http://localhost/~user/application_name and you show see cakephp's default page
good luck!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. HTML tags and examples(37)
  2. Saint_michael Html Tips & Tricks Issue #1(1)
  3. Saint-michaels Html Tips And Tricks Issue # 2(2)
  4. Saint Michael Xhtml Tips And Tricks #1(3)
  5. Saint-michael Html Tips And Tricks Issue #3(0)
  6. Saint-michaels Html Tips And Tricks #4(12)
  7. Basic Html (for Us Kids)(23)
  8. Building An Unordered List Of Anchors(4)
  9. Multiple Classes In Html(8)
  10. How To Create Html Page Anchors(5)
  11. Dynamic Signatures - The Real Way To Go(8)
  12. Integrating Html And Css Part 1(5)
  13. Fast Template Design In Joomla Cms(2)
  14. Document Type Declarations(0)
  15. Simple Scripts In Html And Javascript(7)
  1. How To Make A Simple File Based Shoutbox Using Php And Html(8)
  2. Do You Want To Use Php Code In Your Html Pages?(9)
  3. Spice Up Your Forms(11)
  4. Html Legend(9)
  5. Create A Simple Html Editor With Php And Javascript(3)
  6. Creating Navigation For Html Websites(12)
  7. Want-to-start Html Tutorials(2)
  8. Html Bdo...(13)
  9. Html Span(7)
  10. [php] Clean Code Functions(5)
  11. How To: Html Tables.(8)
  12. Tutorial : Hide Folder Without Any Softwares(10)
  13. Add Flashing Inbox To Invisionfree Forum(0)


 



- Lo-Fi Version Time is now: 20th July 2008 - 05:55 PM