Thursday, August 29, 2013

Issue encounter and simple note on CakePHP 2.3.9 & WAMP 2.4 exploration

How to disable debug mode on cakephp? (Please refer to the selected red rectangle)

Steps to resolve
1. Open core.php located at "[WAMP_INSTALL_PATH]\app\config".
2. Edit debug value to "0" and deploy to the server
    Configure::write('debug', 0);
3. Deploy to the server, the debug mode will be disabled.

How to resolve "Forbidden You don't have permission to access / on this server." error message when access the new installed WAMP server version 2.4?

Install a new WAMP server and when access the web server using the assigned IP address through browser, "Forbidden You don't have permission to access / on this server." error message is displayed.

When using localhost/ in the local machine to access the WAMP server, the default WAMP page is displayed.

Steps to resolve
1. Edit https.conf which located at "[WAMP_INSTALL_PATH]\bin\apache\Apache2.4.4\conf", edit the configuration as shown below
<Directory "[WAMP_INSTALL_PATH]/www">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order Deny,Allow
    Allow from all

2. Make sure port 80 in Window 2008 firewall  is opened.
- Launch "Windows Firewall with Advanced Security" screen
- Right click "Inbound Rules" and select "New Rule..." menu
- Select "Port - Rule that controls connections for a TCP or UDP port", click "Next" button
- Select "TCP" type and enter "80" for "Specific local ports", click "Next" button
- Select "Allow the connection" and click"Next" button
- Check "Domain", "Private" and "Public" checkbox and click on "Next" button
- Enter "Name" and "Description" value and click on "Finish" button.

3. Restart WAMP server, WAMP index page will be displayed.

How to redirect all the visitor's request to a particular subdirectory?

When came to a requirement to redirect all visitor request to a particular subdirectory, for example /myapp/ in your PHP web application, normally I will use Apache rewrite feature to redirect all the request.

Steps to resolve
1. Edit httpd.conf and uncomment "LoadModule rewrite_module modules/"
2. I have enable the virtual host configuration, add in the rewrite engine as described below

<VirtualHost *:80>
 ServerName [SERVER_NAME]
 DocumentRoot "C:/wamp/www"
        ErrorLog "c:/wamp/logs/apache_error.log"
        CustomLog "c:/wamp/logs/access.log" common
 RewriteEngine on
 RewriteRule ^/$ /[MY_APP_DEFAULT_FOLDER]/ [R]
3. Rewrite your Apache web server.

No comments: