Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Thursday, April 3, 2008

Enable mod_rewrite in Apache under Ubuntu

'mod_rewrite' is disabled in default apache2 installation. To enable this, I followed following procedure. Thanks to Lavlu for showing me this.
At first, load mod_rewrite using Apache's mod enable command
# a2enmod rewrite


Then enable mod_rewrite from Apache2's configuration file. In default installation, there should be a 000-dafult file under /etc/apache2/sites-enabled directory. You should modify that. Just make the value 'All' (it should be 'None' by default) to AllowOverride key for '/' and '/var/www/' directory. So, the line will look like -
AllowOverride All



Now force reload Apache configuration
# sudo /etc/init.d/apache2 force-reload

Tuesday, March 18, 2008

ssh login without re-entering password

At my work, i have to enter our hosting server. Sometimes, several times a day. And obviously I have to enter password to get through.

I knew the solution before. We used to do this in our distributed systems lab at college. Because, sometimes it becomes necessary to enter a remote machine without password by the automated scripts.

And today I had to rediscover this again ;)

Enter the remote machine and check there exists .ssh folder under `~` (home) folder. if it doesn't exist, create one.
mkdir ~/.ssh

then 'exit' to come back to your own console.
2. create your own key. For simplicity, just press enter at all prompts
ssh-keygen -t dsa

3. Copy your ssh key to remote host
cat ~/.ssh/id_dsa.pub | ssh <remote_host_address> "cat - >> ~/.ssh/authorized_keys"

VoilĂ ! You're done. Now try to ssh again to the remote host. You'll get the remote shell without any password :)