so i’m running drupal 7.16 on my windows 7 laptop. well, it’s on a vm on the laptop. i’m running vwware player. it’s free. and works well. running ubuntu 12.06. i wrote a good doc on how to do this. i’m an IT pro, 15 years but i have been almost completely focused on MS solutions. so this doc is good for someone who knows MS but wants to move towards open source. the doc is in ms word. here is the stuff from the docs. if you want the doc itself, send me a message and I can get it to you.
Procedure – Installing Drupal 7.16 on Ubuntu Desktop 12.04 LTS on VMWare Player hosted on Windows 7 Home 64 bit
Author: PJ McGhee
IT Pros who have been traditionally Microsoft based but are moving towards open source/linux based applications
This document explains the steps to install Drupal 7.16 on a VMWare Player hosted Ubuntu Desktop12.04 to create a development environment on a Windows 7 64 bit laptop. There are ways to do a “one click” install for this purpose. This procedure is intended to describe how to install all the separate components manually, giving the user a better understanding of the underlying technologies that support Drupal.
This may be of particular value for those (like me) who have traditionally been Microsoft oriented who now embrace open source. The document assumes then, a high level of familiarity with install procedures and other broad IT concepts like virtualization, web services, databases and systems administration regardless of the platform that it is being implemented on.
The overall objective for the first section is to successfully install what is known as a LAMP server. This is just an acronym for Linux, Apache, MySQL and PHP. Together, these elements form a platform, both scalable and powerful (free too), that can be used to implement many different open source applications. They form the backbone of the Drupal server, providing OS (Linux), Web Services (Apache), Database (MySQL) and Programming Language (PHP). There are many smaller packages that need to be installed as prerequisites and they are all detailed in the procedures.
Since familiarity with Linux and its components is assumed to be limited, this document describes in a fair amount of detail, how to achieve a dev/test environment on a Linux Ubuntu Desktop install running on a VMWare Player hosted on a Windows 7 laptop. This is what I am running. Ubuntu Desktop provides a familiar interface with the desktop feel. VMWare Player allows Linux to be run in a way that doesn’t impact your laptop much while still allowing internet access.
Drupal.org is an awesome site. Do yourself a favor right away and register with the site. Take some time to check out the different areas that are available. Get to learn where the resources are located. This will help you as you start to develop sites with Drupal. There are several newsletters that you can join as well that will aid you in learning this great product.
Open source is awesome and the community behind it is superb. But open source requires more time and work to achieve a clean install. The readme files in the packages you will be installing are very important for the procedures; always make sure to reference them! If you encounter errors along the way, remember that Google is your friend. The first time that I went through this install I had to work my way through errors at almost every single turn, usually because a prerequisite was missing, which is my fault for not reading enough beforehand which is arguably difficult because there is simply so much information out there. But, I was able to work through every single issue by Googling the message and following the tips offered. It takes time but in the end it is worth it because you gain a better understanding of the underlying systems. That’s why I eschew the “one-click” packages available for Drupal. And why I am not running Drupal on Windows. There are no Install Shield wizards for these installs but there really isn’t anything too onerous either: it’s just a lot of steps. And this is a great way to start learning Linux.
Caveats and Disclaimers
I’m not a Linux guy. I have spent my 15 professional years in IT mostly designing/implementing/supporting systems based on Microsoft products. There are sure to be much better ways to do many (most) of the things in this procedure. I won’t be the one to argue that. Please email me any suggestions. I simply want to help people who have traditionally focused on Microsoft products move into open source. Especially Drupal, which is a great product. That being said, I make no guarantees about the procedures in this document or their impact on your systems.
Common Linux commands/tips – http://www.pixelbeat.org/cmdline.html
- Ctrl-Alt-T opens command prompt on Ubuntu
- Dir shows list of directories
- Ls shows list of files
- ls –l show files with perms, owner, etc
- cd .. moves up one dir level
- cd / takes you up to the top level
- chmod command to change permissions – see docs for syntax
- apache2 –v tells you the version of apache you have installed
- mysqladmin -u root -p version show version of MySQL installed
- Admin access to a Windows 7 64bit Host OS
- VMWare Player 4.0.4 Build 744019
- Linux – Ubuntu Desktop ver. 12.04 LTS 64 bit
- Apache 2.2.22 Web Server
- MYSQL 5.5.24
- PHP 5.3.10
- APR 1.4.6 APR-Util 1.5.1 – Apache components
- PCRE 8.31
- G++ via Build-essential
Estimated Time to Complete Procedure:
email@example.com – Feel free to email me if you have questions about this procedure.
Objective 1: Install LAMP server
Build the Ubuntu Server
- Install the free VMWare Player ver. 4.0.4.
- Start VMWare upon completion.
- Click File, New Virtual Machine.
- Browse to the Ubuntu .ISO file.
- Enter your name
- Give the new virtual server a name relevant to your purpose – Drupal-Dev in this case
- The install will prompt you for a user to be created. Make the user drupal-dev and the password password.
- VMWare tools for Ubuntu Linux will be installed automatically after the first reboot.
- Login to the new virtual Ubuntu Linux machine when prompted.
- Click the Cog icon in the top right corner of the desktop and choose “available updates”. There will be approximately 433 (274 MB at the time of writing) updates that will need to be downloaded and installed. Make sure to check for updates regularly as the components are installed. The VM must be able to browse the internet.
Enable the root account [i] – http://www.liberiangeek.net/2012/05/login-as-root-in-ubuntu-12-04-precise-pangolin/ – this is a good reference for this part
- 11. Hit Ctrl-Alt-T to open a terminal window. Remember this; it will be used a lot
- Type sudo passwd root and hit enter – set a password for the root account
- Type su root and supply the password for root – you are now using root privileges
- Type sh –c ‘echo “greeter-show-manual-login=true” >>/etc/lightdm/lightdm.conf’
- Reboot the server. You will now be able to choose the user name with which to login.
- Login as root with the password of password
Open the Firefox web browser from within Drupal-dev. Some of these packages will be downloaded and installed manually and some will be installed via apt-get (https://help.ubuntu.com/8.04/serverguide/apt-get.html) but it is a good idea to look at the web site of each individual component.
- Autotools for Ubuntu – http://www.sourceware.org/autobook/autobook/autobook.html
- Apache 2.2.22 – http://httpd.apache.org/docs/current/install.html – reference this link
- APR 1.4.6 – Apache component – http://apr.apache.org/download.cgi
- APR-Util 1.5.1 – Apache component – “
- PCRE 8.31 – ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.gz
- Build Essential – https://launchpad.net/ubuntu/+source/build-essential
- MySQL Server Installed via apt-get but reference https://help.ubuntu.com/12.04/serverguide/mysql.html
- PHP 5.4.8 – installed via apt-get reference http://php.net/downloads.php
- Drupal Core 7.16 – recommended release, not development – http://drupal.org/drupal-7.16
- Open http://drupal.org/documentation/install – This is an excellent resource for the overall procedure to install Drupal.
Install Autotools for Ubuntu – http://www.sourceware.org/autobook/autobook/autobook.html
- Go to http://pkgs.org/download/libtool and download the libtool (all you really need) package or, skip to step 5 to use apt-get to get the whole Autotools package.
- Double click the downloaded package.
- The UbuntuSoftwareCenter will open.
- Click install. This feels more like a Windows installer process which is why I included it.
- Or, you can use apt-get to download and install the package.
- Hit Ctrl-Alt-T to open a terminal session window
From the terminal session type apt-get install libtool automake autoconf and hit enter.
- Click Y to confirm the needed space.
- Yum and apt-get do the same things but you may end up liking Yum more than apt-get and it is good to know about some of the install options available.
- Hit Ctrl-Alt-T to open a terminal session window.
- Type apt-get install yum.
- Confirm the space needed for the install.
Install Build Essential
- This will give you G++ which will be needed, plus others. https://launchpad.net/ubuntu/+source/build-essential
- From the command prompt type apt-get install build-essential and hit enter.
- Confirm disk space.
- Click the Home Folder icon in the top left of the desktop and go to downloads.
- Double click (DC) the APR-1.4.6 folder. Right click the contents of Archive Manager and choose Extract.
- Extract files to the downloads folder. You’ll now have a folder called apr-1.4.6 along with the tar packages.
- Open a terminal window.
- Linux can be a little confusing in regards to directory structure. A simple way to ensure you are at the root level is to type simply type cd / and hit enter.
- Once you’re at the root level you need to get to the APR-1.4.6 directory.
- Type dir to ensure that you’re at the top. You’ll see directories like boot, bin, home, root, var.
- Type cd root and hit enter – your prompt should go from
root@ubuntu:/# to root@ubuntu:~#
- Type cd Downloads – this is case sensitive – hit enter.
- Type cd apr-1 and hit the tab key – this will complete the command – hit enter.
- Type ./configure and hit enter. Many scripted commands will now run. At the end you will see an error about libtoolsT cannot be removed. This can be ignored.
- Type make and hit enter – more scripted commands.
- Type make test and hit enter – this will take a couple of minutes.
- Type make install and hit enter – this will be fast.
- There will now be an APR-1.4.6 folder in the /usr/local/src directory.
- Extract the APR-Util folder to downloads.
- Go back to the terminal window and make your way to the APR-Util-1.5.1.
- Type ./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr/ and hit enter.
- The prefix part specifies where the apr-util files will go and also specifies where the apr files are located.
- Type make and hit enter.
- Type make install and hit enter.
Install PCRE 8.31
- Extract the files to the download directory.
- From the terminal session go to the PCRE-8.31 directory.
- Type ./configure and hit enter.
- Type make and hit enter.
- Type make install and hit enter.
- At the command line type apt-get install apache2 apache2-mpm-prefork and hit enter.
- Confirm that it is OK to use the additional space.
Install MySQL Server
- From the terminal session type apt-get install mysql-server and hit enter.
- Confirm Y to use the additional 97.1 MB of space.
- Enter a password for the root account (user name = root) when prompted. You’ll be prompted twice.
- Install mcrypt first.
- From a terminal session type apt-get install php5-mcrypt and hit enter.
- Choose Y to confirm the disk usage.
- Install Libxml2 dev files.
- Type apt-get install libxml2-dev and hit enter.
- Type apt-get install libapache2-mod-php5 and hit enter.
- Type Y to use the needed space.
- Type apt-get install php5-gd hit enter.
- Type Y to use the needed space.
- Type apt-get install php5-common php5-mysql and hit enter.
Test the installed components
- Open the Firefox browser and navigate to http://localhost.
- The default directory is in /var/www the page is index.html.
- If you see a plain page that says, “It works!…” the install is working.
- From a terminal session type netstat -tap | grep mysql hit enter and you should see:
- tcp 0 0 localhost:mysql *:* LISTEN931/mysqld
- This indicates the server is running.
- Open /var/www and create a new test php page called test.php using the test editor.
- Enter the following PHP code:
<?php phpinfo(); ?>
- Save the file.
- Browse to the url http://localhost/test.php.
- You should see a web page with quite a bit of PHP information.
- If you are asked to download the file PHP is not being parsed by Firefox.
- Reboot the server.
That concludes the installation of the LAMP server. Hopefully, it wasn’t too bad. Thanks for your patience and I hope that you might have learned a thing or two about the Linux world. I know that I did! Now it is time to move on to Object 2 – the install of Drupal Core itself
Objective 2: Install Drupal Core
Prepare the Drupal install files and create needed directories
- Extract the Drupal 7.16 to the download directory.
- Move the Drupal files via the next line’s command.
- Type mkdir /var/www/drupal and hit enter.
- Type mv drupal-7.16/* drupal-7.16/.htaccess /var/www/drupal and hit enter.
- Go to the extracted files and open the install.txt file for install procedures.
Create the MySQL Drupal DB
- Open the INSTALL.mysql.txt file in the ./Drupal-7.16 directory.
- Open a terminal session.
- Type mysqladmin –u root –p create drupal where root is the user name and drupal is the name of the database that we are creating for the install.
- You will be prompted for the password that you supplied for the root account during the mysql server install.
- Login to mysql and set access rights by typing mysql –u root –p and hitting enter.
- Supply the password again.
- Now type this query to provide rights:
- GRANT ALL PRIVILEGES ON drupal.* TO ‘root’@’localhost’ IDENTIFIED BY ‘password’;
- Be very careful with the syntax here. Notepad may add characters that will interfere with a copy and paste method. The single quotes can also be different from Windows to Ubuntu. The syntax here is correct; you need to make sure that it is being transferred properly.
- Note that password is the same as supplied before.
- Successful assignment of perms will show as:
- Query OK, zero rows affected.
- Type exit and hit enter to leave mysqladmin.
Run the Drupal installation script and prepare files
- From a terminal session type mkdir /var/www/drupal/sites/default/files and hit enter.
- Type cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php and hit enter.
- Type chmod 777 /var/www/drupal/sites/default/files and hit enter.
- Type root and hit enter.
- Open Firefox.
- Browse to http://localhost/drupal/install.php.
- Leave the radio button at “Standard” and Save and Continue.
- Leave at “English” and click Save and Continue.
- Verify Requirements will now appear.
- Correct any missing requirements and click Proceed
- You will now be at the Database configuration screen.
Supply the name of the database, user and password that you specified in step 3 of Create the MySQL Drupal DB. In this case, the db name is drupal, the user is root and the password is password.
- You should not need to change advanced options.
- Click Save and continue.
- The Install profile steps will be run.
- You will now be at Configure site and you’ll need to supply some SITE INFORMATION.
- localhost is fine for this dev environment.
- Any email address will be fine for now.
- Now for SITE MAINTENANCE ACCOUNT – This is important because this Drupal specific account will have rights to do everything in your Drupal install.
- User name is root, email address is firstname.lastname@example.org and the pass word will be password.
- Under SERVER SETTINGS choose the country settings and time zone appropriate for you.
- Leave UPDATE NOTIFICATIONS the way they are.
- Click Save and Continue.
- You should now be at Finished.
- One last step – VERY IMPORTANT!
- From the terminal session type:
- chmod 640 settings.php and hit enter.
- chmod 755 ../default and hit enter.
- Click the link to visit your site.
- CONGRADULATIONS! You have now implemented an excellent Drupal dev environment.
[i] Linux gurus will probably tell me that there is a better way to do this and I am sure that there is but I’m just an MCSE trying to make it in an open source world! Please send me your recommendations.