============================
This is an example of how to use Drupalpro, to manually setup a Drupal7 website called foobar.dev. This does not make use of the addon drush scripts to automate the process, but demonstrates how to manually add a website.
- Create website root folder
- Download and extract Drupal files in this folder
- Setup nginx vhost config
- Enable vhost
- Setup hosts file (so URL resolves)
- Create a DB & USER
- Run Drupal setup
- Create website root folder
Example
mkdir ~/websites/foobar.dev
chown :www-data ~/websites/foobar.dev
-
Download Drupal7, open with Archive Manager (file-roller) and extract to
~/websites/foobar.dev
-
Copy the nginx vhost config template to a new file that will be used to customize for the new website,
Example
sudo cp /etc/nginx/sites-available/TEMPLATE_drupalpro.conf /etc/nginx/sites-available/foobar.dev.conf
- Open the new file and follow the instructions to customizefor the new website
Example
sudo sed -i 's|##==SERVER_TLD==|foobar.dev|g' /etc/nginx/sites-available/foobar.dev.conf
sudo sed -i 's|##==PATH_TO_SITE==|/home/drupalpro/websites/foobar.dev|g' /etc/nginx/sites-available/foobar.dev.conf
sudo sed -i 's|##==D7_ONLY==||g' /etc/nginx/sites-available/foobar.dev.conf
-OR-
Example GUI
Open file as user root in Geany
sudo -i geany /etc/nginx/sites-available/foobar.dev.conf &
CTRL-H to "Find & Replace" the URL variable
CTRL-H to "Find & Replace" the website path variable
CTRL-H to "Find & Replace" to set the Drupal7-Only variable to NULL (in other words, replace with nothing)
=SAVE FILE=
- Create symlink in sites-enabled folder
Example
sudo ln -s /etc/nginx/sites-available/foobar.dev.conf /etc/nginx/sites-enabled/
- Setup /etc/hosts file to resolve to localhost for new hostname
Example
echo '127.0.0.1 foobar.dev #drupalpro' | sudo tee -a /etc/hosts
-OR-
Example GUI
sudo -i geany /etc/hosts &
ADD a line to resolve to localhost: 127.0.0.1 foobar.dev
=SAVE FILE=
- Create DB user & database for new website
Example
mysql -h localhost -u root -p
create database foobar_dev;
create user foobar_dev;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `foobar_dev`.* TO 'foobar_dev'@'localhost' IDENTIFIED BY 'foobar_dev';
FLUSH PRIVILEGES;
exit
-OR-
Example phpMyAdmin
Navigate to: (http://phpmyadmin) login user: root | pwd: dp14
a. Click "home icon" (to navigate to home screen) b. Click "Users" (on menu bar) c. Click "Add User" (Under user list) d. Fill out form fields: username: foobar_dev, localhost, password: foobar_dev e. Enable checkbox: [x] "Create database with same name and grant all privileges" f. Scroll to bottom and select "go" to create a new user and database: foobar_dev
- Restart
Example
Reboot
-OR-
Example
sudo service mysql restart
sudo service nginx restart
sudo service php5-fpm stop # don't use restart due to bug in php5-fpm restart: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1242376
sleep 3 && sudo service php5-fpm start
-
Run Drupal setup
Example