How to install OpenPanel and Drupal on Ubuntu 10.04 64 Bit Server With Recommended Drupal Permissions (Step 3 of 3)



By now, you should have a complete install of OpenPanel with a user, domain, website, FTP account, and E-mail address. Before we begin to install Drupal, there are a few packages we must install prior:
sudo apt-get install php5-mysql php5-gd
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
This section about changing permissions is optional, however I recommend it because It makes the permissions more secure for an Apache Virtual Host environment with multiple users. If you look at the permissions in the home directory, you will notice that OpenPanel sets the default owner and group to the user you created.
root@web1:/home# ls -al
total 20
drwxr-xr-x 5 root root 4096 2011-10-01 09:23 .
drwxr-xr-x 22 root root 4096 2011-10-01 06:54 ..
drwxr-xr-x 3 user user 4096 2011-09-30 21:56 user
drwxr-xr-x 2 openpanel-admin openpanel-admin 4096 2011-09-30 21:52 openpanel-admin
drwx--x--x 3 test test 4096 2011-10-01 09:30 test
This means that if you need to give the user "www-data" write permission, then you must give the other group write permission. This, to me, is considered insecure. To fix this, run the following commands:
sudo chown -R test:www-data /home/test
sudo chmod -R g+s /home/test
sudo echo 137 027 > /etc/pure-ftpd/conf/Umask
sudo /etc/init.d/pure-ftpd restart
The first command sets the owner:group to test:www-data for /home/test and all files/folders below it.
The second command ensures that all files/folders uploaded through FTP/SSH will retain the owner:group.
The third command sets the default Umask for Pure-FTPd.
The fourth command restarts the Pure-FTPd server.
Here is a before and after of uploading the drupal install files to the web root with the permission changes:
See the difference?
Use your favorite FTP client to upload the Drupal 7 install files to your web root. I recommend FileZilla. You can get it from here:
Windows: http://www.filehippo.com/download_filezilla/
Ubuntu: sudo apt-get install filezilla
You can get the Drupal 7 install files from here (I am using Drupal 7.8):
http://drupal.org/project/drupal
NOTE: Extract the Drupal install files before you upload them. Make sure you use the correct username format when uploading through FTP (test@testsite.com). You can use your servers IP address or domain name to upload.
Now you can go to your website and begin to setup Drupal. You must access your website by domain name, not by IP address. I am not using the DNS server through OpenPanel. I registered my domain name through a third party, and they provide a DNS management interface. So DNS for my site is already pointed to my server's public IP. If you are on the same LAN as your OpenPanel server, you can add your domain name and IP address to your local hosts file.
So open your web browser and go to your URL: http://testsite.com
You will see the Drupal Install script. Choose Standard and click "Save and Continue":
Choose English and click "Save and Continue":
You will notice a couple of errors:
To resolve the errors, we must perform the following steps:
The following paths assume a root directory of the web root (which would be the public_html folder).
Create a directory named "files" under /sites/default/
Theses are the permissions on the "files" folder.
We want to change them so the "www-data" group has write permission. Right click on the folder "files" and choose "File Permissions...". Then check the Write box for Group permissions.
Make a copy of /sites/default/default.settings.php in the same folder and name it "settings.php". Then give the Group permissions write access.
After making those changes, you should be able to continue the Drupal install script. Fill out the database information with the database and username we created in step 2. Click "Save and Continue":
All the changes have been made to /sites/default/settings.php so you can revert the Group write permissions made in the previous step:
Congratulations, you have now installed Drupal 7 on Ubuntu using OpenPanel. Enjoy!
If you have any questions or comments about this step, please feel free to leave a comment below.
Post new comment