LAMPPD-Linux-Apache-MySQL-PHP-phpMyAdmin-Drupal-Installation-Tutorial

Submitted by admin on Fri, 12/03/2010 - 05:08

This is to help people setup and install a LAMPPD (Linux-Apache-MySQL-PHP-phpMyAdmin-Drupal) server in Ubuntu or other Linux distro, including Apache 2, PHP 5 (optionally PHP 4 in Ubuntu 10.10 and lower), and MySQL 4.1 or 5.0.

  1. sudo apt-get install lampserver^
    OR
    sudo apt-get install php5 mysql-server apache2
    OR
    sudo tasksel install lamp-server
  2. sudo apt-get install phpmyadmin
  3. echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
  4. Copy the default website as a starting point. sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite
  5. sudo gedit /etc/apache2/sites-available/mysite
  6. Change DocumentRoot from /var/www to new location /home/user/public_html/
  7. Change the Directory directive, replace <Directory /var/www/>  to <Directory /home/user/public_html/>
  8. Now, we must deactivate the old site, and activate our new one. Ubuntu provides two small utilities that take care of this a2ensite (apache2enable site) and a2dissite (apache2disable site).
    then run: sudo a2dissite default && sudo a2ensite mysite
    then restart apache: sudo /etc/init.d/apache2 restart
  9. If you have not created /home/user/public_html/, you will receive an warning message
    To test the new site, create a file in /home/user/public_html/
    echo '<b>Hello! It is working!</b>' > /home/user/public_html/index.html
    Finally, browse to http://localhost/
  10. gksudo "gedit /etc/mysql/my.cnf"
    and change the line
    bind-address           = localhost
  11. set mysql root password: mysql -u root -p (if you had set root password at the time of phpmyadmin installation then write that or if no any password then just hit Enter)
  12. mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');
  13. [Create a mysql database] mysql> CREATE DATABASE database1;
  14. [Create a mysql user] mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
  15. [For creating a new user with fewer privileges (should work for most web applications) which can only use the database named "database1", at mysql prompt type:]
    mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON database1.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword';
  16. If you get a 404 error upon visiting http://localhost/phpmyadmin  You will need to configure apache2.conf to work with Phpmyadmin.
    sudo gedit /etc/apache2/apache2.conf
    Include the following line at the bottom of the file, save and quit.
    Include /etc/phpmyadmin/apache.conf
  17. (a) i done this
    sudo mkdir /usr/lib/php5/ext
    /usr/lib/php5/20090626
    -Copy the extension file to the new directory
    $ sudo cp /usr/lib/php5/20090626/mysql.so /usr/lib/php5/ext/mysql.so
    $ sudo cp /usr/lib/php5/20090626/mysqli.so /usr/lib/php5/ext/mysqli.so

    Run, Stop, Test, And Restart Apache
    $ sudo /usr/sbin/apache2ctl start
    $ sudo /usr/sbin/apache2ctl stop
    $ sudo /usr/sbin/apache2ctl configtest
    $ sudo /usr/sbin/apache2ctl restart

    OR

    10) Edit PHP Configuration to Work With MYSQL (Ubuntu Dapper)

    In Dapper Drake, "extension=mysql.so" and "extension=mysqli.so" are enabled in the php.ini file out-of-the-box. However, sometimes php is not looking for those files in the right directory. You have then to move your files or modify the php.ini configuration.

    * First solution

    locate the directory where the extension files are placed
     locate mysql.so
    (change mysql.so in mysqli.so if you want to install the mysqli functions)
    -then modify the php.ini file to indicate the right place for the extension directory
    $ gksudo "gedit /etc/php4/apache2/php.ini"

    or if you are using php5

    $ gksudo "gedit /etc/php5/apache2/php.ini"
    Look for the 'extension_dir' property, and set it to the directory where you found the mysql(i).so file
        * extension_dir= "/usr/lib/php5/20051025/"
    Restart apache, and test if your mysql(i) functions are working.

    * Second solution

    -locate the directory where the extension files are placed

     locate mysql.so
    (change mysql.so in mysqli.so if you want to install the mysqli functions)
    Let's say that you found the file in '/usr/lib/php5/20051025/'
    -then check in the php.ini file for the extension directory

    $ gksudo "gedit /etc/php4/apache2/php.ini"
    or if you are using php5

    $ gksudo "gedit /etc/php5/apache2/php.ini"
    Look for the 'extension_dir' property. It should be by default '/usr/lib/php5/ext'. If it's not, change it for this value.

    -Now create the default directory for extensions
    $ sudo mkdir /usr/lib/php5/ext

    -Copy the extension file to the new directory
    $ sudo cp /usr/lib/php5/20051025/mysql.so /usr/lib/php5/ext/mysql.so

    Change the first path to the one you found with the locate function, and change mysql.so into mysqli.so if you want to use mysqli functions.
    -Restart apache (see below), and test if your mysql(i) functions are working.

    Run, Stop, Test, And Restart Apache

    Use the following command to run Apache
    $ sudo /usr/sbin/apache2ctl start

    To stop it, use
    $ sudo /usr/sbin/apache2ctl stop

    To test configuration changes, use
    $ sudo /usr/sbin/apache2ctl configtest

    Finally, to restart it, run
    $ sudo /usr/sbin/apache2ctl restart
     

Drupal Installation :

  1. ubuntu@ubuntu-desktop:~$ mkdir drupal
  2. ubuntu@ubuntu-desktop:~$ cd drupal/
  3. ubuntu@ubuntu-desktop:~/drupal$ wget http://ftp.drupal.org/files/projects/drupal-6.19.tar.gz
  4. ubuntu@ubuntu-desktop:~/drupal$ tar -zxvf drupal*
  5. ubuntu@ubuntu-desktop:~/drupal$ mv drupal-6.19 /home/user/public_html/
  6. ubuntu@ubuntu-desktop:~/drupal$ cd /home/user/public_html/drupal-6.19/
  7. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ sudo cp sites/default/default.settings.php /home/user/public_html/drupal-6.19/sites/default/settings.php
  8. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ sudo /etc/init.d/apache2 restart
  9. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ sudo chmod o+w sites/default/settings.php
  10. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ sudo chmod o+w sites/default
  11. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ sudo mkdir sites/default/files
  12. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ sudo chmod o+w sites/default/files
  13. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ mysql -u root -p
  14. Enter Password: ****
  15. mysql> CREATE DATABASE drupal;
  16. mysql> CREATE USER 'drupal'@localhost IDENTIFIED BY 'password';
  17. mysql> GRANT ALL ON *.* TO 'drupal'@'localhost';
  18. mysql> exit
  19. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ sudo service mysql restart
  20. go to browser type this URL: http://localhost/drupal-6.19/
  21. Install Drupal in English
  22. type database name, username, Password click Continue
  23. ubuntu@ubuntu-desktop:~/public_html/drupal-6.19$ sudo chmod o-w sites/default/settings.php
  24. Site name: , Site e-mail address: , Username: , Password: , Enable Clean URL then Click on Continue.
  25. Bingo Your Site Finally ready!

63 comments

This site is really a

Submitted by kristin18 (not verified) on Wed, 08/31/2011 - 17:12.

This site is really a stroll-via for all of the data you needed about this and didn’t know who to ask. Glimpse here, and also you’ll undoubtedly discover it.

Youre so cool! I dont suppose

Submitted by billiedkv (not verified) on Wed, 08/31/2011 - 15:45.

Youre so cool! I dont suppose Ive read anything like this before. So good to search out any individual with some original thoughts on this subject. realy thank you for starting this up. this website is one thing that is needed on the net, somebody with just a little originality. useful job for bringing one thing new to the internet!

There are actually a whole

Submitted by billiedkv (not verified) on Wed, 08/31/2011 - 13:21.

There are actually a whole lot of details like that to take into consideration. That may be a great level to convey up. I offer the ideas above as general inspiration however clearly there are questions like the one you convey up where crucial factor will be working in sincere good faith. I don?t know if greatest practices have emerged around issues like that, but I am positive that your job is clearly recognized as a fair game. Both boys and girls really feel the impact of only a second’s pleasure, for the rest of their lives.

After study just a few of the

Submitted by kristin18 (not verified) on Wed, 08/31/2011 - 08:08.

After study just a few of the blog posts in your website now, and I actually like your way of blogging. I bookmarked it to my bookmark website listing and will probably be checking again soon. Pls try my website as nicely and let me know what you think.

WONDERFUL Post.thanks for

Submitted by pambowmus (not verified) on Thu, 06/30/2011 - 09:24.

WONDERFUL Post.thanks for share..more wait .. …

I’d need to examine with you

Submitted by frankli1q (not verified) on Tue, 05/31/2011 - 09:56.

I’d need to examine with you here. Which is not one thing I usually do! I take pleasure in studying a publish that may make individuals think. Also, thanks for allowing me to comment!

I am typically to blogging

Submitted by frankli1q (not verified) on Wed, 05/04/2011 - 16:24.

I am typically to blogging and i actually recognize your content. The article has really peaks my interest. I am going to bookmark your web site and hold checking for brand new information.

very nice submit, i certainly

Submitted by louisroqz (not verified) on Tue, 05/03/2011 - 02:16.

very nice submit, i certainly love this website, keep on it

Good post. I learn something

Submitted by frankli1q (not verified) on Mon, 05/02/2011 - 03:56.

Good post. I learn something tougher on completely different blogs everyday. It's going to all the time be stimulating to learn content material from other writers and follow slightly something from their store. I’d favor to make use of some with the content material on my blog whether or not you don’t mind. Natually I’ll give you a hyperlink on your internet blog. Thanks for sharing.

Oh my goodness! an incredible

Submitted by oscargltk on Mon, 04/04/2011 - 07:09.

Oh my goodness! an incredible article dude. Thank you However I'm experiencing subject with ur rss . Don’t know why Unable to subscribe to it. Is there anybody getting equivalent rss drawback? Anyone who is aware of kindly respond.

you've got an incredible

Submitted by marianntg on Wed, 02/09/2011 - 21:20.

you've got an incredible weblog right here! would you like to make some invite posts on my weblog?

Oh my goodness! an amazing

Submitted by marianntg on Wed, 02/09/2011 - 19:59.

Oh my goodness! an amazing article dude. Thanks Nevertheless I'm experiencing issue with ur rss . Don’t know why Unable to subscribe to it. Is there anybody getting an identical rss downside? Anyone who knows kindly respond.

This actually answered my

Submitted by jessegeq0 on Mon, 02/07/2011 - 02:14.

This actually answered my downside, thank you!

Drupal theme by Kiwi Themes.