Kamis, 28 April 2016

Setup FTP Server On CentOS, RHEL, Scientific Linux 6.5/6.4/6.3

vsftpd (Very Secure File Transport Protocol Daemon) is a secure, fast FTP server for Unix/Linux systems. In this how-to article, let us see how to setup a basic FTP server using vsftpd on CentOS 6.5. This procedure will also work on all RHEL CentOS, Scientific Linux 6.x versions.

 My testbox server hostname and IP Address are server.unixmen.local and 192.168.1.101/24 respectively. Change the values as per your scenario.
Install vsftpd
All commands should be run with ‘root’ user. Run the following command in terminal to install vsftpd package:
# yum install vsftpd ftp -y
Configure vsftpd
Edit vsftpd configuration file /etc/vsftpd/vsftpd.conf,
# vi /etc/vsftpd/vsftpd.conf
Find the following lines and make the changes as shown below:
 [...]
## Set to "NO" ##
anonymous_enable=NO
## Uncomment ##
ascii_upload_enable=YES
ascii_download_enable=YES
## Uncomment - Enter your Welcome message - This is optional ##
ftpd_banner=Welcome to UNIXMEN FTP service.
## Add at the end of this  file ##
use_localtime=YES
Start the vsftpd service and make it to start automatically on every reboot:
# service vsftpd start
# chkconfig vsftpd on
Create FTP users
By default, root user is not allowed to login to ftp server for security purpose. So let us create a testing user called “sk” with password “centos”:
# useradd sk
# passwd sk
Connecting to FTP server
Now let us try to connect to FTP server itself with user “sk”:
# ftp 192.168.1.101
Connected to 192.168.1.101 (192.168.1.101).
220 Welcome to UNIXMEN FTP service.
Name (192.168.1.101:root): sk
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/sk
Login failed.
ftp> 
Probably you will get an error like “500 OOPS: cannot change directory”.
This is because your SELinux restricts the user to log in to ftp server. So let us update the SELinux boolean values for FTP service:
# setsebool -P ftp_home_dir on
Now try again to login to FTP server:
# ftp 192.168.1.101
Connected to 192.168.1.101 (192.168.1.101).
220 Welcome to UNIXMEN FTP service.
Name (192.168.1.101:root): sk
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 
Now you will be able to login to FTP server without any problems.
Client side configuration
Let me try to log in to the FTP server from my Ubuntu client system.
$ ftp 192.168.1.101
ftp: connect: No route to host
ftp>
You might see the above error like “ftp:connect:No route to host”. To resolve this error, allow the default ftp port “21” through your firewall or router. In the server side, do the following.
Edit file /etc/sysconfig/iptables,
# vi /etc/sysconfig/iptables
Add the following lines.
[...]
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
[...]
Save and exit the file. Restart iptables now:
# service iptables restart
Now try again from the client system to login to FTP server:
$ ftp 192.168.1.101
Connected to 192.168.1.101.
220 Welcome to UNIXMEN FTP service.
Name (192.168.1.101:sk): sk
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 
Boom!! It’s working now.
Working from command-line mode might be little bit annoying to newbies. So let us install a graphical FTP client called Filezilla to get things done quite easier:
$ sudo apt-get install filezilla
For RHEL based systems, you can install filezilla using following command:
# yum install filezilla
Open Filezilla client from your client system “Dash” or “Menu”. Enter the FTP server hostname or IP Address, username, password and port number. Click “Quickconnect” to login.


(Source : unixmen.com)

Rabu, 27 April 2016

Install Joomla 3 on CentOS 6.5 Minimal x86_64

CentOS 6.5 Minimal x86_64

Complete your base operating system installation or you can follow my guide found at the URL below. When following my guide, hold off on executing yum updates until after configuring EPEL and REMI repositories.


https://github.com/rharmonson/richtech/wiki/CentOS-6.5-Minimal-x86_64-Base-Installation-Guide
 
 
 
 

EPEL Repository

Add the Extra Packages for Enterprise Linux repository. This is required to meet REMI repository requirements. See my guide here:
https://github.com/rharmonson/richtech/wiki/EPEL-Repository-on-CentOS-6.5 



REMI Repository

Add Remi Collet's repository to meet Joomla's PHP requirements. Guide here:
https://github.com/rharmonson/richtech/wiki/REMI-Repository-on-CentOS-6.5
 
 

Install Prerequisites

 

yum install open-vm-tools system-config-firewall-tui system-config-network-tui httpd mysql-server php php-mysql wget unzip
 
 
 
Results:
Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: httpd x86_64 2.2.15-30.el6.centos updates 821 k mysql-server x86_64 5.1.73-3.el6_5 updates 8.6 M open-vm-tools x86_64 9.4.0-8.el6 epel 401 k php x86_64 5.3.3-27.el6_5 updates 1.1 M php-mysql x86_64 5.3.3-27.el6_5 updates 81 k system-config-firewall-tui noarch 1.2.27-5.el6 base 37 k unzip x86_64 6.0-1.el6 base 149 k wget x86_64 1.12-1.11.el6_5 updates 483 k Installing for dependencies: apr x86_64 1.3.9-5.el6_2 base 123 k apr-util x86_64 1.3.9-3.el6_0.1 base 87 k apr-util-ldap x86_64 1.3.9-3.el6_0.1 base 15 k dbus x86_64 1:1.2.24-7.el6_3 base 207 k httpd-tools x86_64 2.2.15-30.el6.centos updates 73 k libdnet x86_64 1.12-6.el6 epel 28 k libicu x86_64 4.2.1-9.1.el6_2 base 4.9 M mailcap noarch 2.1.31-2.el6 base 27 k mysql x86_64 5.1.73-3.el6_5 updates 894 k perl x86_64 4:5.10.1-136.el6 base 10 M perl-DBD-MySQL x86_64 4.013-3.el6 base 134 k perl-DBI x86_64 1.609-4.el6 base 705 k perl-Module-Pluggable x86_64 1:3.90-136.el6 base 40 k perl-Pod-Escapes x86_64 1:1.04-136.el6 base 32 k perl-Pod-Simple x86_64 1:3.13-136.el6 base 212 k perl-libs x86_64 4:5.10.1-136.el6 base 578 k perl-version x86_64 3:0.77-136.el6 base 51 k php-cli x86_64 5.3.3-27.el6_5 updates 2.2 M php-common x86_64 5.3.3-27.el6_5 updates 525 k php-pdo x86_64 5.3.3-27.el6_5 updates 75 k Transaction Summary ================================================================================ Install 28 Package(s) Total download size: 33 M Installed size: 104 M

Upgrade PHP

Joomla's PHP requirements are not met if only using CentOS and EPEL repos, thus upgrade from REMI. As a side effect, MySQL is updated as well. Note you can update using remi-php55 or remi-php56.
# yum --disablerepo="*" --enablerepo="remi" upgrade Results:
================================================================================ Package Arch Version Repository Size ================================================================================ Updating: mysql x86_64 5.5.37-1.el6.remi remi 5.8 M mysql-libs x86_64 5.5.37-1.el6.remi remi 776 k mysql-server x86_64 5.5.37-1.el6.remi remi 10 M php x86_64 5.4.28-1.el6.remi remi 2.7 M php-cli x86_64 5.4.28-1.el6.remi remi 2.6 M php-common x86_64 5.4.28-1.el6.remi remi 930 k php-mysql x86_64 5.4.28-1.el6.remi remi 136 k php-pdo x86_64 5.4.28-1.el6.remi remi 120 k Installing for dependencies: compat-mysql51 x86_64 5.1.54-1.el6.remi remi 1.4 M Transaction Summary ================================================================================ Install 1 Package(s) Upgrade 8 Package(s) Total download size: 24 M

MySQL Configuration

Start mysqld
# service mysqld start Configure MySQL
Respond with yes for each option. Don't forget the root password!
# /usr/bin/mysql_secure_installation Enable mysqld to start on boot.
# chkconfig mysqld on

PHP Configuration

Update php.ini to meet Joomla's requirements. Values may vary, but use the one below or research each to determine what will work best for you.
# vi /etc/php.ini Below are the values I use, however, your mileage may vary. The post_max_size and upload_max_filesize are initially set to values too low to permit installing third party addons much less permit users to upload files. The upload_tmp_dir must be owned by the web service, i.e. apache.
output_buffering = Off upload_tmp_dir = /var/www/html/temp post_max_size = 30M upload_max_filesize = 30M

Apache2 (httpd) Configuration

Minor changes to Apache2 to reduce the ease of fingerprinting. Not a requirement, but advisable.
# vi /etc/httpd/conf/httpd.conf Update the following:
ServerSignature Off ServerTokens Prod Lastly, enable apache2 to start on boot, test httpd.conf, then start httpd.
# chkconfig httpd on # service httpd configtest # service httpd start

Firewall

Execute the iptables text user interface to permit http or web access to Joomla.
# system-config-firewall-tui

Test

Open a browser, enter the URL to your Joomla host which should look something like http:///, and if all is working, apache2's default web page will be displayed.
It works! This is the default web page for this server. The web server software is running but no content has been added, yet.

Joomla Installation

At the time of the installation, Joomla 3.3.0 was the most current version. Update the URL below to reflect the version you want to install.
# wget http://joomlacode.org/gf/download/frsrelease/19393/158832/Joomla_3.3.0-Stable-Full_Package.zip # unzip Joomla_3.3.0-Stable-Full_Package.zip -d /var/www/html/ # chown -R apache.apache /var/www/html # cp /var/www/html/htaccess.txt /var/www/html/.htaccess Browse to https:///joomla/ to continue with Joomla CMS configuration.



(sources : github.com)