Recently, I started using Linux OS(UBUNTU 9.x) for development. I just want to share the knowledge what I have learned from the web. Today I need to enable the mod_rewrite module in the apache, since my project is implemented with smart urls using htaccess.
In this post, I am going to give instructions, how to edit apache settings and php.ini file in the ubuntu 9.4.
Enable Mod_rewrite in the apache in the ubuntu
----------------------------------------------------------
1)copy a file named 'rewrite.load', from the folder /etc/apache2/mods-available into /etc/apache2/mods-enabled
(There is a terminal command which can be used to move/copy the file 'rewrite.load' from the mods-available folder to mods-enabled folder. Type the following command in terminal: sudo a2enmod rewrite )
2)open the terminal and restart the apache using the command
sudo /etc/init.d/apache2 restart
Now you can check the loaded modules in apache, by echoing phpinfo() method in a php file. The rewrite module will be listed in the apache loaded modules.
Then Edit the file /etc/apache2/sites-available/000-default as admin. To edit this file as super admin type the following command in terminal:
sudo gedit /etc/apache2/sites-available/000-default
Replace the 'AllowOverride None' with 'AllowOverride all' in 2 places. inside < directory > tag and < directory > tag.
Now open the terminal and restart the apache using the command
sudo /etc/init.d/apache2 restart
Apache rewrite is done now. ;)
Edit php.ini file in the ubuntu
---------------------------------
1)To edit the php.ini file as super admin type the following command in terminal
sudo gedit /etc/php5/apache2/php.ini
Edit and save.
2)then open the terminal and restart the apache using the command sudo /etc/init.d/apache2 restart
No comments:
Post a Comment