June 11, 2008 - 18:47 — webmaster
Most of the web based systems that we build at Zyxware uses Drupal as the content framework. The following are the steps involved in setting up Apache, PHP, MySQL and Drupal on a freshly installed Ubuntu 8.04 system. If you follow the instructions you should be able to set it up as is but if you face problems let us know and we will try to help you.
This is divided into subsections each dealing with a specific task.
1. Apache2 Server Setup
2. Installing MySQL and PHP5
3. Installing Drupal & Configuring Drupal
4. Clean URLs Configuration in Apache2 for Drupal
5. Other Tweaks
Apache2, MySQL, PHP Setup
1. Run the following command to install apache on your machine
sudo apt-get install apache2 libapache2-mod-php5
sudo apt-get install mysql-client mysql-server mysql-query-browser mysql-admin mysql-navigator php5-mysql php5-gd
sudo /etc/init.d/apache2 restart
2. Install PHPMyAdmin. After this, make changes in the confinguration file to support PHPMyAdmin. You can skip this step if you prefer to use MySQL GUI based administration.
sudo apt-get install phpmyadmin
sudo gedit /etc/apache2/httpd.conf
At the bottom add the following
# Enable PHPMyAdmin
Include /etc/phpmyadmin/apache.conf
sudo /etc/init.d/apache2 restart
3. Enable usedir module in apache2 to allow URLs of the following format http://localhost/~username. Also enable mod_rewrite to allow for Drupal Clean URLs
cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/userdir.load
sudo ln -s ../mods-available/userdir.conf
sudo ln -s ../mods-available/rewrite.load
sudo /etc/init.d/apache2 reload
4. Create folder /home/<username>/public_html -- > this is the folder which we are going to use as the document root for local development. So you will be accessing your local websites as http://localhost/~username/sitename
5. Edit /etc/apache2/mods-available/userdir.conf
and change the AllowOverride line to just read
AllowOverride All
Install Drupal
1. Download the latest drupal version from http://drupal.org and extract it to the folder of your choice under ~/public_html. Say ~/public_html/drupal
2. In the drupal folder change permissions of /default/settings.php to 766 to make it writable to by all users
3. Once the things has been completed access the directory through the browser. If you had named the drupal folder as drupal you can now access it as http://localhost/~username/drupal
4. Create a database named drupal_db (your choice) in MySQL through the MySQL Query Browser or throuh the mysql command line client for Drupal. Also create a user for drupal. You can do by running the following query
GRANT ALL PRIVILEGES ON drupal_db.* TO 'some_username'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
5. After a couple of simple questions to be answered Drupal should be up and running.
Configuring Drupal
Clean URLs converts the querystrings that come in a normal URL into an integral part of the URL. By enabling Clean URLs you would improve the readability of the URL and also increase your google page ranking. We had already enabled mod_rewrite above. So we just have to make sure that Clean Urls is enabled in Drupal administration
Other Tweaks
Install sendmail to be able to send out mails from drupal.
sudo apt-get install sendmail
Edit: We have updated the information about enabling userdir module and its configuration. Thanks Kirri
Comments
Step1:Apache - error with "server's fully qualified domain name"
Please add the following info to the instructions.
[Concerning STEP 1]
[Solution found at
http://mohamedaslam.com/how-to-fix-apache-could-not-reliably-determine-t... ]
__________________________________________________________________
PROBLEM:
In Step 1, While executing the line "sudo apt-get install apache2 libapache2-mod-php5",
Apache server gives the following error:
Could not reliably determine the server's fully qualified domain name,
using 127.0.1.1 for ServerName
The same error appears when you try restarting apache.
__________________________________________________________________
SOLUTION:
To fix this, you need to edit the httpd.conf file. Open the terminal and type,
sudo gedit /etc/apache2/httpd.conf
By default httpd.conf file will be blank. Now, simply add the following line to the file.
ServerName localhost
Save the file and exit from gEdit.
Finally restart the server.
sudo /etc/init.d/apache2 restart
This should solve the issue.
Thanks so much for this tuto,
Thanks so much for this tuto, i could have a lot of headaches trying to do it by myself, and must be a lot of complex to me, but you made it easy.
Linux
How to install and configure a web development using Apache PHP MySQL making use of LVS using any linux platform
um, this guide is messed
1) there is no sudo gedit /etc/apache2/httpd.conf file.
2) the first step is to install apache2 and the php module. then modify the apache config. then the last installs step is
sudo apt-get install apache2 libapache2-mod-php5 php5-mysql php5-gd
which redoes the apache2 install and makes no sense. Furthermore, when you install phpmyadmin, it installs mysql. My point is there is a lot of redundancy in this guide and it is not very clear.
why not rework the ordering of the steps in this guide. I suggest get all the software, then do all the configuration.
Ubuntu Configuration
Step by step its looking
FreeBSD
am wondering if this would work at all on f.ex FreeBSD, anyone who know?
http://heriman.wordpress.com/
http://heriman.wordpress.com/2008/08/05/enabling-apache-user-home-public...
This way is much easier. We don't need to change the contents of apache2.conf and httpd.conf. I tested it.
PHP pages wont open, they keep trying to download
When i try to open the /var/www/sites/default/settings/php firefox just stries to download it, instead of open it... I can't figure out why.
Step 9 of the Apache2 Server Setup
I checked the apache2.conf file and the lines of code in step 9 do not appear. To this point i have followed the instructions exactly, until step 11. I even tried to add the code manually but the gedit /etc/apache2/apache2.conf didn't work. Any ideads what i may be doing wrong? I tried skipping over and finishing the steps but didn't work and i ended up reinstalling ubuntu and starting over. Now i don't want to move on till i get each step. Thanks for any help you can give me.
Post new comment