Drupal Tutorial

Disabled Front Page:-
body.page-node-1 header#main-content-header{display: none;}

body.page-node-1 header#main-content-header{display: none;} //-----> Change your Article page node number insted of 1 

Importing a SQL db into mysql using the terminal :-

root@chinna:~# mysql -u username -p password databasename < filename.sql

Ex: 
root@chinna:~# mysql -u root -p techlearn < /home/chinna/Desktop/techlearnin.sql
Password : *******

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Exporting a SQL db into mysql using the terminal :-

root@chinna:~# mysqldump -u root -p databasename > databasename.sql
Enter password: *******

Ex: 
root@chinna:~# mysqldump -u root -p techlearn > techlearn.sql
Password : *******

 

Unblocking an account :-
Say you accidentally "block" your admin account and cannot log in. From within a MySQL client you can run this command to unblock it.

mysql > update users set status = 1 where uid = 1;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Reset user/root password :-

Find a way to reset my root level password in Drupal 7 with only access to phpMyAdmin and ftp.
mysql--> database--> users --> edit users --> add below password hash code in pass insted of old code field. 

password hash code :  $S$C6x2r.aW5Nkg7st6/u.IKWjTerHXscjPtu4spwhCVZlP89UKcbb/

New pwd : NEW_TEMP_PASSWORD
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Import large .sql files to phpmyadmin in LAMP :-

root@chinna:~# nano /etc/php5/apache2 /php.ini
Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

Change to:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 300
max_input_time = 540
memory_limit = 1000M
Save the changes.
root@chinna:~# /etc/init.d/apache2 restart 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

PHP block code  :-

<div id="Techlearn.in">
<div class="logo">
     <div class="img-browser"><img src="/sites/all/themes/dhani/photos/socialmedia/selenium.png"></div>
    <p class="website"><a href="http://www.techlearn.in/drupal-tutorial" target="_blank">Visit "Drupal Tutorial" Website</a></p>    
 </div>
</div>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

How to connect cPanel-SSH Access  :-

root@debian:/home/chinna# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):

root@debian:/home/chinna# cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDP3xeohPxX0BkV8Dt0CMF2oLC7DFCi3mA+tcNqZK0pjp4JO+vKXMiYsKwEmccDEoxs1cUBQf4GX9T5OzQVcHgpy7NZ/kPtcwzn//WdUECvlY5KQG30Iq3EdEn91d90kcRdU+h4sewkb5y20Z7i7YE5xi5qrJGDiPyMZMo0HJfe6N1SsAd5qj3Xis1qxnruUpXEtgfF8NbSw8Z7xEW5 root@debian

root@debian:/home/chinna# cat ~/.ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAz98XqIT8V9AZFfA7dAjBdqCwuwxQot5lLWHHB8L3CZN7XM5P
xMr0lwHXsV7TGL17a734NSTZ12UqbaT7Vjb8v9ZwtumTuDwub0/Z4cKQD0dIgFza
.
qZs3Ix4dpjsWZw5JQD4V5Ip1LHvZov87CAhtmN8jhTsUEWiJznkfKczpgkixmzRy
5syVzV03oeUiCxA5gySakm+dvp2RSGjWd59rOmqMzO8CDIYPJCx6Ew==
-----END RSA PRIVATE KEY-----

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
=================================================================== 

enabling clean urls in drupal 7:-

root@chinna:/home/chinna# nano /etc/apache2/sites-enabled/000-default.conf 

 <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/>
                RewriteEngine on
                RewriteBase /
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

Ctrl+x
Yes and Enter

root@chinna:/home/chinna# service apache2 restart

 

root@chinna:/home/chinna#  /etc/init.d/apache2 restart

also in the terminal.
Next i went back to localhost from my browser and then enabled clean urls

from administer > site configuration > clean urls

                                 OR

You have to modify the virtualhost in httpd.conf
change this line AllowOverride None to AllowOverride All

root@debian:/home/chinna# nano /etc/apache2/sites-available/default

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride All       
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Then restarted apache by:

root@chinna:/home/chinna#  /etc/init.d/apache2 restart

also in the terminal.
Next i went back to localhost from my browser and then enabled clean urls

from administer > site configuration > clean urls

Save configuration. And there! It works. No more strange looking characters in my address bar.

If you are using drupal 7,then there is no need to edit the .htaccess file because clean url is enabled by default.
So here's the trick,if the clean url test fails on drupal 7.You will have to edit the url.
Your url at the clean url page should be;
http://www.yoursite.com/?q=admin/config/search/clean-urls   {0r}  http://localhost/techlearn/?q=admin/config/search/clean-urls

So edit it and change it to;
http://www.yoursite.com/admin/config/search/clean-urls

Now you should see the enable clean url button.

                                  OR

root@chinna:/home/chinna# sudo a2enmod rewrite

Modify the Apache configuration file.

It is located at:

root@chinna:/home/chinna# /etc/apache2/apache2.conf

   And change the existing "AllowOverride None" to "AllowOverride All" as below:

   <Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
   </Directory>

And then Restart Apache

root@chinna:/home/chinna#  /etc/init.d/apache2 restart

also in the terminal.
Next i went back to localhost from my browser and then enabled clean urls

from administer > site configuration > clean urls

===================================================================

 

 

 
 

Tags: 

Comments