�V�
Search: �
  • Home
  • Help
  • Search
  • Login
  • Register
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 07, 2010, 05:50:28 PM

Login with username, password and session length
collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online
  • Dot Guests: 9
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* News from Joomla
  • post Joomla 1.6 Beta 8 Now Available
  • The Joomla Project is proud to announce the immedi...
  • post Joomla 1.6 Beta 7 Now Available
  • The Joomla Project is proud to announce the immedi...
  • post Joomla 1.6 Beta 6 Now Available
  • The Joomla Project is proud to announce the immedi...

Welcome to Locutus web services forum!

Locutus Web Services�>�General Category�>�Linux�>�Setting up Apache, PHP and MySQL for Ubuntu
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Setting up Apache, PHP and MySQL for Ubuntu  (Read 2177 times)
locutus
Administrator
Hero Member
*****
Offline Offline

Posts: 95


The sky ain't the limit


WWW
Setting up Apache, PHP and MySQL for Ubuntu
« on: August 14, 2008, 03:34:18 PM »

The purpose of this little howto is to set up a LAMP box with (K,X)ubuntu desktop already installed focused on Joomla!
(Linux + Apache + MySQL + PHP/Perl together commonly known as LAMP Server)
This is wat
    * Apache 2 - Linux Web server
    * MySQL 5 - MySQL Database Server
    * PHP5 - PHP Scripting Language
    * phpMyAdmin - Web-based database admin software.

Please note, you need atleast 256 MB of RAM otherwise you will run into "cannot connect to mysql.sock" errors

First make sure you have a static ip address. Check your network settings of your desktop in Gnome/KDE/XFCE.

Before proceeding to install, update the necessary packages with this command.

Code:
sudo apt-get update

Let's start and copy the following text in your console:

Code:
sudo apt-get install apache2 php5 libapache2-mod-php5 php5-mcrypt

To avoid apache massages for having trouble to resolve your servername add or change this line in:

Code:
sudo nano /etc/apache2/apache2.conf

into (where "ip.address" is your static ip set above)

Code:
ServerName ip.address

Restart apache.

Code:
sudo /etc/init.d/apache2 restart

To check whether php is installed and running properly, just create a test.php in your /var/www folder with phpinfo() function exactly as shown below.

Code:
nano /var/www/test.php
Code:
<?php phpinfo(); ?>

Point your browser to http://ip.address/test.php and this should show all your php configuration and default settings. If your browser wants to download the php file instead of showing it, just reboot.

It's recommended to create a separate home partion (It makes a clean upgrade sooo easy) Here is a nice tutorial how to do that: http://www.psychocats.net/ubuntu/separatehome

In /home I made a webserver directory with permissions.

Code:
sudo mkdir /home/www
Code:
sudo chmod 777 /home/www

Create the site in apache.
Code:
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mylittlewebserver


Open the new apache config file and change it into this.
Code:
sudo nano /etc/apache2/sites-available/mylittlewebserver

Code:
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost

DocumentRoot /home/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /home/www/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /home/www/access.log combined
ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

Now disable the old and activate the new site.

Code:
sudo a2dissite default

Code:
sudo a2ensite mylittlewebserver

Restart apache.

Code:
sudo /etc/init.d/apache2 restart

Again point your browser to http://ip.address/ you should see some files in your browser.

Installing mysql database server is always necessary if you are running a Joomla! site. Remember running mysql server to a fair extend requires atleast 256mb of RAM in your server.

Code:
sudo apt-get install mysql-server mysql-client php5-mysql

PhpMyAdmin is a nice web based database management and administration software and easy to install and configure under apache. Managing databases with tables couldnt be much simpler by using phpmyadmin.

Code:
sudo apt-get install phpmyadmin

Restart your server:
Code:
sudo /etc/init.d/apache2 restart

And at last install mod_rewrite for those nifty SEO URL's of Joomla 1.5.x

Code:
sudo a2enmod rewrite

Have fun!

Please note, it's not recommended to make your webserver worldwide visible. Don't forget configuring a safe webserver is a profession on it's own.
Logged

Conquer the skies with the Gelderse Soaring Club
locutus
Administrator
Hero Member
*****
Offline Offline

Posts: 95


The sky ain't the limit


WWW
Re: Setting up Apache, PHP and MySQL for Ubuntu
« Reply #1 on: November 12, 2008, 04:37:05 AM »

There is a known bug in (K)Ubuntu 8.10 setting a static ip address. I recommend to replace the default network manager with WICD. More about WICD is over here: http://wicd.sourceforge.net/
Logged

Conquer the skies with the Gelderse Soaring Club
locutus
Administrator
Hero Member
*****
Offline Offline

Posts: 95


The sky ain't the limit


WWW
Re: Setting up Apache, PHP and MySQL for Ubuntu
« Reply #2 on: November 04, 2009, 03:41:01 AM »

To tune for example your file uploads; php.ini is here:
Code:
sudo nano /etc/php5/apache2/php.ini
Logged

Conquer the skies with the Gelderse Soaring Club
locutus
Administrator
Hero Member
*****
Offline Offline

Posts: 95


The sky ain't the limit


WWW
Re: Setting up Apache, PHP and MySQL for Ubuntu
« Reply #3 on: November 08, 2009, 05:45:28 PM »

There is a known bug in Karmic Koala; there is no gzip support in the apache module. To fix this, enable or add this line in your sources list:

Code:
deb http://LANDCODE.archive.ubuntu.com/ubuntu/ karmic-proposed restricted main
multiverse universe

Where LANDCODE is of course your county code; for me it's "nl"
Logged

Conquer the skies with the Gelderse Soaring Club
Pages: [1] Go Up Print
« previous next »
Jump to:  


* Recent Topics
topic My distro stopper: Lubuntu!
[Linux]
locutus
August 31, 2010, 04:12:41 AM

* News from SMF
  • post Twitter background contest!
  • Hello Community,

    The SimpleMachines Te...
  • post A reminder to update your email and passwords
  • Hello community,

        The Simple Machin...
  • post SMF 2.0 Release Candidate 3 is out!
  • Hello all,

    We are pleased to announce ...

* Top Poster
locutus locutus
95 Posts
baijianpeng baijianpeng
26 Posts
aim1986
10 Posts
GJSchaller GJSchaller
6 Posts
Neeraj123
5 Posts

Powered by SMF 1.1.11 | SMF © 2006-2008, Simple Machines LLC
SimplePortal 2.3.1 © 2008-2009, SimplePortal

Scribbles2 design by Bloc | XHTML | CSS
Page created in 1.634 seconds with 25 queries.
Loading...