Installing Drupal on 5.0-Nano
Installing Drupal on 5.0-Nano |
Introduction
This step-by-step guide shows how to install Drupal on Uniform Server 5.0-Nano and how to resolve common issues such as PHP mail and cron.
Provisional release, may be wait for D7.
Preparation - 1
Install Uniform server
Download Drupal
Copy files to Uniform Server
|
Preparation - 2
Create Drupal database
Creating the Drupal database is straight forward, note tables are automatically inserted during installation
|
Note:
- You can start phpMyAdmin from Apanel, start Apanel by typing http://localhost/apanel/ into your browser address bar.
- From Apanel click on the phpMyAdmin link. (left menu under tools)
Optionally configure PHP email
After you complete the final step in Install and set-up Drupal see below you will receive the following warning message:
warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in Z:\www\drupal\includes\mail.inc on line 193. Unable to send e-mail. Please contact the site admin, if the problem persists.
If you are only exploring and testing Drupal's functionality you can safely ignore this (Its only a warning and not an error). However if you would like to send emails via your ISP you have three options.
A) Edit php.ini
Open php.ini located in folder UniServer\usr\local\php
Locate this section:
[mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = me@localhost.com
Replace: SMTP = localhost with your ISP's SMTP server; for details check out this page PHP mail function
Replace: sendmail_from = me@localhost.com with your real email address issued to you by your ISP.
Note: The above changes also need to be made to files:
- php.ini_delvelopment_nano
- php.ini_production_nano
These files are selectable from UniTray and overwrite php.ini this allows switching between production and development for testing.
B) Install Fake Sendmail for Windows
If your ISP requires authentication install Fake Sendmail for Windows
C) Install a mailserver
One final option if you want to run your own mail server and your ISP does not block the mail ports check out this page Installing hMailServer
Install and set-up Drupal
The Drupal set-up is straight forward I have shown what needs to be entered in the action column.
For a test server enter whats highlighted in bold, alternatively enter your own specific data.
Drupal Step | Action |
---|---|
| |
Type the following into browser address bar http://localhost/drupal/
This opens Drupal's installation page (http://localhost/drupal/install.php?profile=default) | |
1. Choose language | Click Install Drupal in English |
2. Verify requirements | Automatically Confirmed OK |
3. Set up database |
Note: Use Advanced Options if you moved servers (new MySQL port)
|
4. Install site | Automatically Confirmed |
5. Configure site |
|
I mentioned in Preparation-2 you will receive a mail warning this can safely be ignored. If you implemented either of the above solutions a warning will not be issued.
To view your new site click "your newsite" link (or type http://localhost/drupal/).
When you log into admin (click administer link) at the top of the admin page you will see
"Cron has not run. Please visit the status report for more information."
- Click the status report link:
- Navigate to "Cron maintenance tasks" to the right click "run cron manually"
- After a short time you will receive a message "Cron ran successfully."
Cron
Cron is unavailable on Windows it is a Unix process that periodically runs certain scripts. Although Drupal allows you to manually run cron.php this can can be inconvenient. The following section shows how to enable UniServer5.0-Nano's portable cron.
Enable portable Cron
Edit file: UniServer\unicon\main\run_cron.php
Uncomment this line as shown:
$dummy = file("http://localhost/drupal/cron.php");
Change the timer to suit application
sleep(15); // Set required delay (seconds)
Run portable Cron
Manually run cron from UniTray
- Start: Left click tray icon > Advanced > click Start Portable Cron
- Stop: Left click tray icon > Advanced > click Stop Portable Cron
Automatically start and stop with servers
Edit file: UniServer\unicon\tray_menu\UniTray1.ini
Locate these lines under [Menu.Left] Menu section (for convenience lines have been split):
Type: item; Caption: "Start UniServer (Apache MySQL)"; Action: shellexecute; FileName: "%PHP%\php.exe"; Parameters: " -n %ServerConMain%\start_servers.php 7";ShowCmd: hidden; Glyph: 9 Type: item; Caption: "Stop UniServer (Apache MySQL)"; Action: shellexecute; FileName: "%PHP%\php.exe"; Parameters: " -n %ServerConMain%\stop_servers.php 7";ShowCmd: hidden; Glyph: 11
- Replace start_servers.php 7 with start_servers.php 23
- Replace stop_servers.php 7 with start_servers.php 23
Note: Values are binary coded
Note: Binary 1+2+4+16 = 23 1 - Run Apache server 2 - Run MySQL server 4 - Start Index page 16 - Run cron
Related links:
Portability
If you want a portable version of Drupal copy the folder UniServer and all its content to your USB memory stick that’s it. Don’t expect fantastic speeds however it is usable.
Summary
I have shown how easy it is to install Drupal on Uniform Server 5.0-Nano.
Cron a Unix process is required to periodically update Drupal's status, Uniform Server 5.0-Nano uses Portable Cron which is built into yhe server.