Topics
Drupal install
How to install Drupal development environment.
So, up to now, there is a drupal core exported via NFS to the development server. Now we set up a new development project, adding specific modules and themes to the /sites directory. The /sites/all will contain all the standard modules, like CCK, Views, Mollom, Pathauto, which are used in every project. The project stuff (/sites/project-1.com, /sites/nw-cee.com and /sites/wepoca.net) will be set up and exported to the development server separately. The /sites directory will look like this:
defaults
all
- modules
- themes
- default.setting.php
project-1.com
- modules
- themes
- files
- setting.php
nw-cee.com
- modules
- themes
- files
- setting.php
wepoca.net
- modules
- themes
- files
- setting.php
So let's assume, we have a project directory in our host, and each Drupal project is listed there:
project-1.com
nw-cee.com
wepoca.net
Each project contains the content for the /site directory. For example, the nw-cee.com looks like this here:
v1
- modules
- themes
- files
- setting.php
v2
- modules
- themes
- files
- setting.php
In order to export the project specific stuff to the development server, type:
sudo nano /etc/exports
And add one line to the end:
/home/www/projects/nw-cee.com/v1 192.168.2.1/24(rw,no_root_squash,async,no_subtree_check)
Save and exit, than restart the NFS server
/etc/init.d/nfs-kernel-server restart
Check the result with exportfs.
Then we have to mount this on the development server.
cd /var/www
sudo mkdir nw-cee.com
sudo mount host.local:/home/www/projects/nw-cee.com/v1 /var/www/nw-cee.com
To make it permanent, update the /etc/fstab file, and add one line to the end:
host.local:/home/www/projects/nw-cee.com/v1 /var/www/nw-cee.com nfs defaults 0 0
We just need now a link in the development server, in order to bind the nw-cee.com directory into the drupal sites:
ln -s /var/www/nw-cee.com /var/www/drupal6/sites/nw-cee.local
Now we configure a virtual host for Apache.
(http://www.debuntu.org/2006/02/22/7-virtual-hosting-using-apache-2)
sudo nano /etc/apache2/sites-available/nw-cee.com.conf
Add this to the file. Replace nw-cee.local according to your project name.
<VirtualHost nw-cee.local>
DocumentRoot /var/www/drupal6
ServerName nw-cee.local
ServerAdmin webmaster@localhost
<Directory "/var/www/d6">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
Enable this new host, and restart Apache
sudo ln -s /etc/apache2/sites-available/nw-cee.com.conf /etc/apache2/sites-enabled/nw-cee.com.conf
sudo /etc/init.d/apache2 reload
As a last step, we just have to set up a database in MySQL, and run the Drupal install script.
mysql -u root -p
and enter the root password for MySQL. Recall, it has been set up during the install phase.
Once you have the "mysql>" promt, type:
create database nwcee;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON *.* TO 'YOUR-DRUPAL-USER'@'localhost' IDENTIFIED BY 'YOUR-PWD';
FLUSH PRIVILEGES;
exit
So you have now a database called 'nwcee' and a database user called 'YOUR-DRUPAL-USER' with privileges necessary for Drupal. This user will have the same access rights to all databases you create here.
And it's convenient to have an DBA user, creating and deleting databases, and for database maintenance tasks via phpMyAdmin. If you want to use the root here, it's also possible, but not recommended.
mysql -u root -p
In the "mysql>" promt, type:
GRANT ALL PRIVILEGES ON *.* TO 'YOUR-DB-ADMIN'@'localhost' IDENTIFIED BY 'YOUR-PWD' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
And now you can open your browser, type nw-cee.local and start the Drupal install procedure.
- Printer-friendly version
- Add new comment
- 295 reads