CentOS 7 how to install LAMP

With my new server I wanted to install LAMP stack so I can test WEB applications locally. Just to note that in CentOS 7 it is not exactly classic LAMP (Linux Apache MySQL PHP), but new LAMP ( Linux Apache MariaDB PHP).

As in most package oriented OS Installation of LAMP on CentOS 7 is generally simple and consist of running following commands:

0. Update you system and add EPEL repo

sudo yum update
sudo yum localinstall --nogpgcheck http://download.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

1. Install packages

sudo yum install httpd mariadb-server mariadb php php-mysql php-gd php-pear php-xml php-bcmath php-mbstring php-mcrypt php-php-gettext

If you need additional php modules just add them.

2. Enable services

sudo systemctl enable httpd.service
sudo systemctl enable mariadb.service

3. Start services

sudo systemctl start httpd.service
sudo systemctl start mariadb.service

4. Secure MariaDB installation

sudo /usr/bin/mysql_secure_installation

5. Open firewall ports

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

5. Test components

To test PHP and apache installation create new php script

vi /var/www/html/phptest.php

Put following code inside:
< ?php
phpinfo();
?>

And visit your ip addres/phptest.php with a browser.

6. Install phpMyAdmin

sudo yum install phpMyAdmin

7. Configure phpMyAdmin to allow connections

vi /etc/httpd/conf.d/phpMyAdmin.conf

Comment out curent

<directory /usr/share/phpMyAdmin></directory>
 

And add

<directory /usr/share/phpMyAdmin>
        AllowOverride none
        Options none
        Require all granted
</directory>
 

Restart Apache
sudo systemctl restart httpd.service

and visit
your ip addres/phpMyAdmin

You should be able to login with you root account

Posted in Linux Tagged with: , , , , ,

CentOS 7 how to change hostname

After I’ve created my home server I’ve tried to change it’s host name by going to /etc/sysconfig/network. For my surprise it was empty. Then I’ve recalled that in version 7 CentOS started using systemd. Hence the location changed.
New place to edit is /etc/hostname

The inconvenience of editing file directly is that system reboot is required to apply the change.

Alternative method is to use Network Manager tool by invoking nmtui.

Network Manager TUI

Change hostname via Network Manager TUI

and then execute:
systemctl restart systemd-hostnamed

You can type hostname to validate the change.

Posted in Linux Tagged with: ,

How to create bootable USB key for CentOS 7 installation

CentOS 7 is out and I wanted to test it on real hardware. Unfortunately most of current methods to transfer bootable ISO to USB key in MS windows environment do not work (see quote below) or boots, but does not recognize installation media in case of Fedora LiveUSB Creator (suggested in RHEL 7 Installation guide).

CentOS 7 installer image has a special partitioning which, as of July 2014, most Windows tools do NOT transfer correctly leading to undefined behavior when booting from the USB key. Applications known (so far) to NOT work are unetbootin and “universal usb installler”.

After applying method of trial and errors I’ve discovered that best tool to transfer ISO to USB key is Win32DiskImager.
Put the path to downloaded ISO image in image file(1), choose USB key drive letter (2) and press write(3).
win32diskimager
Now you are ready to boot and install from your USB key.

Posted in Uncategorized

CentOS – how to disable IPv6 without restart

In case you need to disable IPv6 and cannot afford to restart here are the commands to quickly do it for CentOS:

echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf

sysctl -p

Posted in Linux Tagged with: ,

UBCD version 5.3.0 is released

Today (May 21 2014) UBCD version 5.3.0 is released and available for download.

Here are the changes:

  • Updated ASTRA to V6.14.
  • Updated Intel Processor Identification Utility to V4.90.
  • Updated Memtest86 to V4.3.7.
  • Updated Super Grub2 Disk to V2.00s2.

Details could be found on changelog.
Download page for UBCD

Posted in Information Tagged with:

New download mirror for UBCD

From today we are mirroring UBCD iso download.

For those who are not familiar UBCD stands for Ultimate Boot CD and it is collection of Open Source and freeware tools that could be used to troubleshoot or fix issues with your PC.

I will not list all the tools(you can check that yourself on UBCD site) but the number is impressive.

Posted in Announcement Tagged with: ,

vzdump rpm

In some of my projects I use OpenVZ to create containers.

One of the tools I use to create backup of running container is vzdump from proxmox.com.
Unfortunately rpm provided is older version and latest provided only as debian package.

As source is available I was able to create RPM package and created misc repo.
Here is how to use it

/etc/yum.repos.d/misc.repo
[Misc]
name=Misc Packages for Enterprise Linux 6 - $basearch
baseurl=http://mirror.sysadminguide.net/misc
enabled=1
gpgcheck=0

Current version is:
vzdump-1.2-15.noarch.rpm

Posted in Linux Tagged with: , ,

Oracle VirtualBox shared clipboard

Oracle VM VirtualBox is a virtualization software package. It is really useful to run several OS simultaneously. And great educational tool.

One useful feature not enabled by default is possibility to copy/paste between host and guest (also called shared clipboard).

To benefit from that feature first you need to have guest additions installed.

Once you install them go to Virtual Machine settings:

  1. Click on Machine(1) then Settings(2). Result will be similar to below, but focused on Basic.
    vbox-settings
  2. Choose Advanced Tab(1). There you will see Shared Clipboard setting(2). By default it is set to Disabled.
    vbox-shared clipboard

You have option to allow Bidirectional; From Host to Guest or Guest to Host.

My preferred is Bidirectional. In this way data could be transferred in both directions.

That is all…

Enjoy

Posted in Information Tagged with: ,

C (programming language) cheatsheet added

Recently I’ve decided that even some people think that C programming language is old and obsolete it still worth be be learned.
While learning I’ve frequently consulted information about different commands.

As consequence I’ve created small C cheat sheet that I share with you.
Let me know if something important is missing let me know via comments or contact form.

Posted in Information Tagged with: , ,

Password strenght – Comic

password_strength_comics_en

Source: xkcd

Posted in comic Tagged with: ,