banner



How To Install Joomla On Ubuntu Server

This how to shorty explains how to set-upwardly a Joomla! hosting on a shared hosting server you own to have basic security. This instructions utilize for Debian/Ubuntu based systems, only can exist generalized to any Linux based organisation like Fedora.

In this how to we utilize the following software versions

  • Joomla ane.v
  • Apache ii.2
  • MySQL 5.1
  • Ubuntu 8.04 Hardy Heron server edition

The instructions may apply for other versions too.

1. Prerequisitements

What y'all demand to have in gild to utilise this how to

  • Basic UNIX file permissions knowledge
  • Basic UNIX shell knowledge
  • You lot have a Linux server (Ubuntu / Debian) for which you accept root user access and y'all plan to employ this server to host one or several Joomla! sites
  • Apache and MySQL instaleld on your server

User setup

2. Gear up-up an UNIX user on a dedicated server for Joomla! hosting. The user can SSH in the box and write to his domicile folder, /tmp and /var/world wide web site folder.

We create a user chosen "user" in this instructions. Replace it with the username you desire. Nosotros also utilise the instance site name (world wide web).yoursite.com.

Create new UNIX user and /abode/user folder.

sudo adduser user # Asks for the password and created /dwelling house/user

Create respective /var/www/user folder.

sudo mkdir /var/www/user sudo chmod -R user:user /var/www/user # Just user has writing access to this folder

3. Setup MySQL user account

Install MySQL as per Debian/Ubuntu instructions.

Login as MySQL admin user (may vary depending how your MySQL is configured). Note that outset you will be asked for sudo countersign, then for MySQL administrative user password.

sudo mysql -u admin -p

Then create a new database with the same name as new equally the UNIX user. Make sure that nosotros use UTF-8 grapheme encoding so we avoid irritating encoding problems in the future.

CREATE DATABASE user DEFAULT Graphic symbol SET utf8 DEFAULT COLLATE utf8_general_ci;

Create a MySQL user with the same name as the UNIX user. Use  a random password and give it all rights for the database. Note that this countersign should differ from the UNIX username countersign as this must be stored equally plain-text in Joomla PHP files. Also MySQL differs users whether they came from localhost or other IP address. Hither nosotros use localhost so that the database is connectable just from the same server every bit  Apache is running.

GRANT ALL ON user.* TO 'user'@'localhost' identified past 'zxc123zxc';        

Enter the folder which will contain web site PHP files.

sudo -i -u user # pose yourself as UNIX user who runs the site
cd /var/world wide web/user
wget http://joomlacode.org/gf/download/frsrelease/12350/51111/Joomla_1.five.18-Stable-Full_Package.zip

Unzip information technology.

unzip Joomla_1.five.18-Stable-Full_Package.cipher

Go out posing yourself equally user UNIX user.

leave

5. Set file permission

In social club to secure your server

  • Configuration files and upload directory must be writable past Apache user (www-data for Ubuntu/Debian, httpd for Fedora/Red Hat)
  • Other .php files should exist read-only

Note that during Joomla's browser based installation Apache'due south www-data must accept write access to folder in order to create configuration.php file. We will after remove this access right.

We will set Joomla! files under UNIX grouping group world wide web-data so that Apache tin can read them. Certain files are fix to be writable. This must be done equally root user.

sudo chown -R user:www-data /var/world wide web/user # Make user group to www-data
sudo chmod g+wrx /var/www/user # Read only access to world wide web-information user. Write access for installation, will be later removed.

At present ls -50 command in /var/www/user should requite y'all something similar this for fil masks:

drwxr-xr-10 eleven user world wide web-data    4096 2022-05-28 10:22 plugins -rwxr--r--  1 user world wide web-information     304 2022-05-28 10:21 robots.txt drwxr-xr-10  half-dozen user world wide web-data    4096 2022-05-28 10:22 templates

six. Creating Apache configuration

This allows serving Joomla! by Apache and starting the browser based configuration.

First create Apache configuration file nether /etc/apache2/sites-enabled as root user. Nosotros assumenano terminal base of operations text editor is installed on the server.

sudo nano /etc/apache2/sites-enabled/yoursite.conf

Below is a sample configuration file. Yous may need to lucifer your server public IP in <virtualhost, and so that Apache knows for which IP accost sites are served. We employ virtual hosting: every site on the server is identified past incoming HTTP asking.

<VirtualHost *>

          ServerName yoursite.com    ServerAlias www.yoursite.com    ServerAdmin info@yourcompany.com     LogFormat       combined    TransferLog     /var/log/apache2/yoursite.log     # Make sure this virtual host if capable of executing PHP5    Options +ExecCGI    AddType awarding/10-httpd-php .php .php5     # Point to www folder where Joomla! is extracted    DocumentRoot /var/www/yoursite     # Do not give illusion of safety    # as PHP safe_mode really is a crap    # and simply causes problems    php_admin_flag safe_mode off     #    # This entry volition redirect traffic www.yoursite.com -> yoursite.com    # Assume mod_rewrite is installed and enabled on Apache    # 301 is HTTP Permanent Redirect code    RewriteEngine On    RewriteCond %{HTTP_HOST} ^www\.yoursite\.com [NC]    RewriteRule (.*) http://yoursite.com$1 [L,R=301]  </VirtualHost>

7. Faking the DNS entry

If you have non yet reserved a domain proper name for your site, but still want to get the virtual host working, you tin add a DNS proper name entry into a hosts file on your local figurer. The post-obit assumes you lot are using Ubuntu desktop, only hosts file is available on Windows and OSX too.

sudo gedit /etc/hosts

And so add the lines like the example beneath. Practise non forget to remove this from hosts file when the actual DNS has been set up.

# Force this hostname to become to your server public IP address from your local computer
123.123.123 yoursite.com www.yoursite.com

viii. Outset Joomla! browser based installation

So enter the URL of your site to the browser:

http://yoursite.com

Joomla! installation page should appear.

  • Fill in MySQL database values equally created before.
  • If yous plan to apply SSH for file transfer exercise not enable FTP layer (unsecure).
  • Employ a random password as Joomla! ambassador user and store it somewhere in safe.
  • When Joomla! browser based installation goes to the bespeak it asks y'all to remove the installation directory follow the instructions below.

Secure the configuration

Now remove extra permissions from Apache'southward world wide web-data user so that in the example in that location is a PHP / Joomla security hole, your site files cannot get compromised.

Some folders must remain writable every bit Joomla! will upload or write files in them.

sudo chmod -R g-westward /var/www/user # Remote write permission sudo rm -rf /var/www/user/installation # Remove installation directory # Add write permission to folders which contain writable files sudo chmod -R g+x /var/www/user/logs sudo chmod -R g+x /var/world wide web/user/images sudo chmod -R g+ten /var/www/user/tmp sudo chmod -R k+x /var/www/user/images

9. Setting up htaccess files

Joomla! comes with a sample htaccess file which has some security measurements by having RewriteRules to prevent malformed URL access.

To install this file do the post-obit

sudo -i cd /var/www/user cp htaccess.txt .htaccess chmod user:world wide web-data .htaccess # Set file permission to be readable by Apache and writable past the UNIX user

Then we create a .htaccess file which nosotros volition place in all folders with Joomla! write access to prevent execution of PHP files in these folders. Showtime we create htaccess.limited file which we use as a template.

sudo -i cd /var/world wide web/user nano htaccess.limited # Open text editor

Use the following htaccess.limited content

# secure directory by disabling script execution AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi Options -ExecCGI -Indexes

And put the master template htaccess.express  to proper places

cp htaccess.express media/.htaccess chown -R user:www-information media/.htaccess   cp htaccess.express tmp/.htaccess chown -R user:www-data tmp/.htaccess   cp htaccess.express logs/.htaccess chown -R user:www-data logs/.htaccess  cp htaccess.limited images/.htaccess chown -R user:www-information images/.htaccess

10. Start using the site

Now get to your site with the browser again and Joomla! start page should come up up.

Login every bit administration account you gave in Joomla! browser based installation.

Type URLhttp://yoursite.com in your browser.

11. Setting outgoing e-mail

This is probably first thing you want to do as Joomla! administrator. You configure the SMTP server which will be used for outgoing e-mail. The server  is ordinarily provided by network operator who provides the net connection for your server.

Login as Joomla! ambassador user.

Get to Site  -> Global Configuration -> Server.

Cull SMTP post mode.

Enter SMTP details.

eleven. Examination outgoing email

Create a new user with an email address you control The user should receiveNew User Details e-mail bulletin from the site on the moment the user is created.

12. Maintaining file permission

If y'all change or create any files (eastward.grand. upload a new theme) to your server you demand to set file permissions for information technology.

  • UNIX  user: user (your site username)
  • UNIX group: www-data

To make it possible to set the group ownership with user user yous first need to add together information technology to www-data group.

sudo usermod -a -Thou www-data user # Add user to www-information group then that it can set group permissions

And then you tin fix the permissions for uploaded files (templates and libraries folders assumed)

sudo -i -u user # Login as your UNIX user chgrp -R www-data templates libraries # Prepare grouping ownership chmod -R 1000+rx libraries templates # Prepare read access for the group

This way secure file permissions are fixed after files have been inverse. Alternatively, if your secure SFTP program supports setting permissions during the file upload, you lot can utilize that option

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

Source: https://opensourcehacker.com/2010/05/31/how-to-install-joomla-on-your-ubuntulinux-server-with-basic-security/

Posted by: lukequeleandon1970.blogspot.com

0 Response to "How To Install Joomla On Ubuntu Server"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel