Introduction
Drupal is an open source content management platform powering millions of websites and applications. In this article, I will show you how to install Drupal 7.8 on Windows 7 with Apache HTTP Server 2.2.21, PHP 5.3.8 and MySQL 5.5.1.
Before Installation
Before you start the installation process, you must have the following installer or package downloaded,
1. Drupal 7.8 (http://www.drupal.org)
2. Apache HTTP Server 2.2.21 (http://httpd.apache.org/)
3. PHP 5.3.8 (http://windows.php.net)
4. MySQL 5.5.1 (http://www.mysql.com/)
1. Drupal 7.8 (http://www.drupal.org)
2. Apache HTTP Server 2.2.21 (http://httpd.apache.org/)
3. PHP 5.3.8 (http://windows.php.net)
4. MySQL 5.5.1 (http://www.mysql.com/)
Install Apache HTTP Server
1. Run httpd-2.2.21-win32-x86-no_ssl.msi to start the Apache HTTP Server installation.
2. Enter Network Domain, Server Name, and Adminstrator's Email Address
Because Apache is used in my laptop as development environment, so I put my laptop name “laptop” in both Network Domain and Server Name textbox and entered a fictional email “webmaster@laptop” in Administrator’s Email Address textbox.
3. Follow the wizard to complete configuration steps and clicked Install button to start the installation, you will probably see following error messages in command windows.
http:exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.1.105 for ServerName
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
The ServerName “laptop” can’t be recognized error is because I haven’t map “laptop” to my laptop IP yet. The port 80 is forbidden error is because access permission reason. I will use a different port 8888 instead 80 later.
4. Follow the rest of installation wizard steps to complete the installation.
5. Use Windows “Search programs and files” box to find the Notepad.
Right click on Notepad and select “Run as administrator” to open the Notepad.
The reason to do this is because Windows 7 has a more restrict security feature - UAC, in order to change a system file, we needs administrator right. Another way to allow change a system file is turning off UAC.
6. Open httpd.conf file in C:\Program Files\Apache Software Foundation\Apache2.2\conf.
7. Find the line
2. Enter Network Domain, Server Name, and Adminstrator's Email Address
Because Apache is used in my laptop as development environment, so I put my laptop name “laptop” in both Network Domain and Server Name textbox and entered a fictional email “webmaster@laptop” in Administrator’s Email Address textbox.
3. Follow the wizard to complete configuration steps and clicked Install button to start the installation, you will probably see following error messages in command windows.
http:exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.1.105 for ServerName
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
The ServerName “laptop” can’t be recognized error is because I haven’t map “laptop” to my laptop IP yet. The port 80 is forbidden error is because access permission reason. I will use a different port 8888 instead 80 later.
4. Follow the rest of installation wizard steps to complete the installation.
5. Use Windows “Search programs and files” box to find the Notepad.
Right click on Notepad and select “Run as administrator” to open the Notepad.
The reason to do this is because Windows 7 has a more restrict security feature - UAC, in order to change a system file, we needs administrator right. Another way to allow change a system file is turning off UAC.
6. Open httpd.conf file in C:\Program Files\Apache Software Foundation\Apache2.2\conf.
7. Find the line
Collapse | Copy Code
Listen 80
And change it to Collapse | Copy Code
Listen 8888
8. Save and close httpd.conf file.9. Open hosts file in C:\Windows\System32\drivers\etc.
10. Add a line in it
Collapse | Copy Code
127.0.0.1 laptop11. Open a browse and enter http://laptop:8888. You suppose to see this
Install PHP
1. Run php-5.3.8-Win32-VC9-x86.msi to start the installation.
2. Select Apache 2.2.x Module
3. Follow the rest of installation wizard steps to complete installation.
2. Select Apache 2.2.x Module
3. Follow the rest of installation wizard steps to complete installation.
Install MySQL
1. Run mysql-installer-5.5.15.0.msi to start the MySQL installation.
2. Follow the wizard to complete MySQL installation.
2. Follow the wizard to complete MySQL installation.
Install Drupal
1. Create a server folder: C:\server.
2. Create a www folder in C:\server.
3. Create a Demo folder in C:\server\www.
4. Extract drupal-7.8.zip into the Demo folder.
5. Open httpd.conf in C:\Program Files\Apache Software Foundation\Apache2.2\conf
6. Find the line
2. Create a www folder in C:\server.
3. Create a Demo folder in C:\server\www.
4. Extract drupal-7.8.zip into the Demo folder.
5. Open httpd.conf in C:\Program Files\Apache Software Foundation\Apache2.2\conf
6. Find the line
Collapse | Copy Code
#LoadModule rewrite_module modules/mod_rewrite.soChange it to
Collapse | Copy Code
LoadModule rewrite_module modules/mod_rewrite.so7. Add following if not in httpd.conf (PHP windows installer will add PHP5 section, but I found it’s not always success)
Collapse | Copy Code
#PHP5 LoadModule php5_module "C:\Program Files\PHP\php5apache2_2.dll" PHPIniDir "C:\Program Files\PHP"8. Find the line
Collapse | Copy Code
AddType application/x-gzip .gz .tgzAdd following
Collapse | Copy Code
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps9. Find the line
Collapse | Copy Code
DirectoryIndex index.htmlChange it to
Collapse | Copy Code
DirectoryIndex index.html index.php10. Find the line
Collapse | Copy Code
#Include conf/extra/httpd-vhosts.confChange it to
Collapse | Copy Code
Include conf/extra/httpd-vhosts.conf11. Save and close httpd.conf.
12. Open http-vhosts.conf in C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra
13. Find the line
Collapse | Copy Code
NameVirtualHost *:80
Change it to Collapse | Copy Code
NameVirtualHost *:8888
14. Find the section Collapse | Copy Code
<VirtualHost *:80> … </VirtualHost>There are two matched sections.
Change the first section to
Collapse | Copy Code
<VirtualHost *:8888> ServerAdmin webmaster@laptop DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs" ServerName laptop ServerAlias laptop ErrorLog "logs/laptop-error.log" CustomLog "logs/laptop-access.log" common </VirtualHost>Change the second section to
Collapse | Copy Code
<VirtualHost *:8888> ServerAdmin webmaster@demo.com DocumentRoot "C:/Server/www/Demo " ServerName demo.com ServerAlias www.demo.com ErrorLog "logs/demo-error.log" CustomLog "logs/demo-access.log" common <directory "C:/Server/www/Demo"> AllowOverride All Options Indexes FollowSymLinks Order allow,deny Allow from all </directory> </VirtualHost>15. Save and close httpd-vhosts.conf.
16. Restart Apache HTTP Server.
17. Open hosts in C:\Windows\System32\drivers\etc.
18. Add line
Collapse | Copy Code
127.0.0.1 www.demo.com19. Save and close hosts file.
20. Open MySQL Workbench 5.2 CE from Program menu MySQL group.
21. Click Local instance MySQL55 to open the database.
22. Click Add schema to add a new schema Demo
23. Run script in Query window to create demoadmin acount
Collapse | Copy Code
CREATE USER 'demoadmin'@'localhost' IDENTIFIED BY 'demoadmin123';24. Run script in Query window to grant permission to demoadmin account
Collapse | Copy Code
GRANT ALL ON demo.* TO 'demoadmin'@'localhost';25. Open http://www.demo.com:8888 in browser. You should see drupal installation page.
26. Follow the wizard to complete installation. Your Drupal site is ready.
Summary
Installing Drupal on Windows 7 is not a simple work for a beginner. You need to use trial and error to figure out how to install and configure each component. I was stuck on PHP configuration for one week. Hope this article could save a little bit your time.
No comments:
Post a Comment