This notes is for someone who wants to create the second or third website after successfully installing the first drupal webstie on his linux server. Here, the step-by-step process:
I. Prepare the DNS Server for the second website.
- Go a head login to domain controller
- Create new DNS server by specifying the new domain name and the ip address of the linux server.
*For this case, let’s assume that we want to create the new website, named “www.newsite.com”
II. Configure Multiple Sites in Apache
1. Prepare new directory
- Go a head login to the linux server.
- Create a new directory in /var/www/ directory.
*I sugest to name it after the new site name, which is “www.newsite.com”
- Create index.html file inside the “www.newsite.com”, and maybe you can say “Hello World” on the body tag
2. Setup the Apache Config file
- Go to /etc/apache2/sites-available
- Open the default file, and uncomment every single line by putting # in front of every single line of code
- Go back to the /etc/apache2/sites-available, you’ll see the first main website that you have successfully installed
- Copy the first main website, and paste to the new name, which is “www.newsite.com”
- Open the “www.newsite.com” file, setup the ServerName, ServerAlias, DocumentRoot, and the Directory path.
Also, uncomment some of the original line on code. (*Please see Figure 1 for the Code Details)
- Go to /etc/apache2/ and change the permission of sites-enabled file into 777
- Enable the “www.newsite.com” that is located in the sites-available by typing:
sudo ln -s /etc/apache2/sites-available/www.newsite.com /etc/apache2/sites-enabled/www.newsite.com
- Change the permission of sites-enabled back to 755
3. Restart apache by typing:
- sudo /etc/init.d/apache2 graceful , or by typing
- sudo /etc/init.d/apache2 restart
4. Check the new website by typing http://www.newsite.com on the browser
- if you can see the “Hello World”, it means you have succeed Configuring the Multiple Sites in Apache
III. Install the Drupal Site
- Go to /var/www/ and delete the “www.newsite.com” directory
- Download new version of drupal by typing:
sudo wget
http://ftp.drupal.org/files/projects/drupal-7.22.tar.gz
*Notes: you can check what is the newest version on the www.drupal.org
- Extract the drupal-7.22.tar.gz archive by typing:
sudo tar xvf drupal-7.22.tar.gz
- Rename the drupal-7.22 name into “www.newsite.com” by typing:
sudo mv drupal-7.22/ “www.newsite.com”
- Change the ownership of all “www.newsite.com” files to www-data.www-data by typing:
sudo chown -R www-data.www-data “www.newsite.com”
IV. Create Database and the Username in MySQL for the new drupal site
- Access the mysql by typing:
mysql -u root -p[the root password]
- Create the database name (e.g., newsite) by typing
create database newsite;
- Create the username and password (e.g., newsite) by typing:
CREATE USER ‘newsite’@'localhost’ IDENTIFIED BY ‘newsite’;
- Grant all privileges to newsite user for the database by typing:
grant all privileges on newsite.* to newsite@localhost;
V. Install the New Drupal Website
- Go to /var/www/www.newsite.com/sites/default
- Copy the default.settings.php and paste into settings.php name
- Type http://www.newsite.com into the browser url
- Follow the installation process








