centos server configuration

Upload: raul-thomas

Post on 05-Jul-2018

243 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/16/2019 Centos Server Configuration

    1/70

    CentOS 7 Installation Steps with Screenshots

    "#$%&' ()**+$,%- ./0 1#2#/0#3 ,%0 4/%#0% &5#1/%,$6 '-0%#* $/*#3 /0 !"#$%& () ')*# )7 %.# #"*+",$-."/ ,$ "#$%&' 8 /0 ()*5/1#3 9,%. "#$%&' :;< /1# 2,0%#3 =#2)9 >

    "#$%&' 8 +0#0 01& /0 ,%0 3#7/+2% 7,2# 0-0%#*;

    %2"#3456( ,0 %.# 3#7/+2% ?@A;

    ,$,%3 ./0 =##$ 1#52/(#3 =- /7/$"89 ;

    B#9 4,$+C 5".#": ;)?#-@ !A#$,?#"./ D /$3 %.# ,$(2+0,)$ )7 %.# &5#$ EF9/1#G))20 /$3 H@ 61/5.,(0 31,I#10 )+% )7 %.# =)C;

    "./$6# ,$ %.# $+*=#1,$6 '(.#*#D &77,(,/2 1#2#/0# ,0 !"#$A/ ()=6

  • 8/16/2019 Centos Server Configuration

    2/70

    &$"2D; ".))0# -)+1 1#05#(%,I# 4/$6+/6# /$3 (2,(X )$ !A#$?#-" D ,$ *- (/0# , ./I# (.))0# L$62,0. D /00.)9$ =#2)9

    &$"2D B "./$6# %.# H#/$,::,$?A# 4"/$?#,$?A# D =- 3#7/+2% ,$0%/22#1 9,22 3) /+%)*/%,( 5/1%,%,)$,$6 7)1 -)+1./13 3,0X; G) (1#/%# -)+1 )9$ (+0%)*,Z# 5/1%,%,)$ %/=2# (2,(X )$ Y H#/$,::,$?A# 4"/$?#,$?A# Y;

  • 8/16/2019 Centos Server Configuration

    3/70

    [0 -)+ (/$ 0## =#2)9 , ./I# /1)+$3 HO \U ./13 31,I# 7)1 &' ,$0%/22/%,)$; (.))0# Y H *?:: IA#+?J-."2,.$?$?A#?#JY %.#$ (2,(X4A#"

  • 8/16/2019 Centos Server Configuration

    4/70

    &$"2DK"1#/%# %.# 5/1%,%,)$ %/=2# D S$ *- (/0# , /* 5+%%,$6 #I#1-%.,$6 +$3#1 4EF /$3 (1#/%#3 LEAA$ M L/$3 /*,2 5/1,%,)$ /0 0.)9$ =#2)9 >

    "2,(X )$ @)$#

  • 8/16/2019 Centos Server Configuration

    5/70

    "2,(X )$ [((#5% "./$6#0

    '%#5>: '#% @/%# ] G,*# 9,%. -)+1 1#05#(%,I# ^)$#

  • 8/16/2019 Centos Server Configuration

    6/70

  • 8/16/2019 Centos Server Configuration

    7/70

    '%#5>a B)9 "2,(X )$ U#6,$ S$0%/22/%,)$ ;

  • 8/16/2019 Centos Server Configuration

    8/70

    '%#5>MO '#% 1))% 5/009)13

    '%#5>MM "1#/%# / W0#1

  • 8/16/2019 Centos Server Configuration

    9/70

    '%#5>MQ S$0%/22/%,)$ ,0 ,$ V1)61#00 /0 0.)9$ =#2)9

  • 8/16/2019 Centos Server Configuration

    10/70

    &$(# %.# ,$0%/22/%,)$ ,0 ()*52#%#3D -)+ 9,22 =# 1#b+,1#3 %) 1#=))% %.# */(.,$# /0 0.)9$ =#2)9 >

    http://www.linuxtechi.com/wp-content/uploads/2014/08/during-installation-1.jpg

  • 8/16/2019 Centos Server Configuration

    11/70

    '%#5>MH c.#$ 9# 7,10% 2)6,$ %) "#$%&' D [((#5% %.# LW4[ /61##*#$%

    U#2)9 '(1##$ 9,22 /55#/1 /7%#1 2)6,$ ;

  • 8/16/2019 Centos Server Configuration

    12/70

    Another Example

  • 8/16/2019 Centos Server Configuration

    13/70

    Installation of “CentOS 7.0″ withScreenshotsThis tutorial will guide you on how to perform a minimal installation of latest version of CentOS7.0 , using the binary DVD ISO image, an installation that is best suitable for developing a futurecustomizable server platform, with no Graphical User Interface, where you can install only thesoftware that you need.

    Installation of CentOS 7

    If you want to find out more about what’s new in this release of CentOS 7.0 holds and downloadlinks, I suggest reading the previous article on release announcements:

    M; "#$%&' 8;O T#/%+1#0 /$3 @)9$2)/3 S'& S*/6#0

    !"#$%&"'"()*

    M; "#$%&' 8;O @E@ S'&

    !"#$%& ()* +#,$-..-$/0# 1203",,

    1. After downloading the last version of CentOS using above links or using official CentOSdownload page. Burn it to a DVD or create a bootable USB stick using LiveUSB Creator calledUnetbootin .

    2. After you have created the installer bootable media, place your DVD/USB into your systemappropriate drive, start the computer, select your bootable unit and the first CentOS 7 promptshould appear. At the prompt choose Install CentOS 7 and press [ Enter ] key.

    http://www.tecmint.com/download-centos-7/http://www.tecmint.com/download-centos-7/https://www.centos.org/download/https://www.centos.org/download/https://www.centos.org/download/https://www.centos.org/download/http://www.tecmint.com/install-linux-from-usb-device/http://www.tecmint.com/install-linux-from-usb-device/http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation.jpeghttp://www.tecmint.com/install-linux-from-usb-device/https://www.centos.org/download/https://www.centos.org/download/https://www.centos.org/download/http://www.tecmint.com/download-centos-7/

  • 8/16/2019 Centos Server Configuration

    14/70

    CentOS 7 Boot Menu

    3. The system will start loading media installer and a Welcome screen should appear. Select yourInstallation Process Language , that will assist you through the entire installation procedure and

    click on Continue .

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-01.png

  • 8/16/2019 Centos Server Configuration

    15/70

    CentOS Installer Loading

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-02.png

  • 8/16/2019 Centos Server Configuration

    16/70

    Select Installation Process Language

    4. The next step, present screen prompt is Installation Summary . It contains a lot of options tofully customize your system. First thing you may want to setup is your time settings. Click on

    Date & Time and select your server physical location from the provided map and hit on upperDone button to apply configuration.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-03.png

  • 8/16/2019 Centos Server Configuration

    17/70

    Select Date & Time and Location

    5. The next step is to choose your Language Support and Keyboard settings. Choose yourmain and extra language for your system and when you’re finished hit on Done button.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-04.png

  • 8/16/2019 Centos Server Configuration

    18/70

    Select Language and Keyboard

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-05.png

  • 8/16/2019 Centos Server Configuration

    19/70

    Select English Language

    6. The same way choose your Keyboard Layout by hitting the plus button and test yourkeyboard configuration using the right input filed. After you finish setting up your keyboard,

    again hit on upper Done button to apply changes and go back to main screen on InstallationSummary.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-06.png

  • 8/16/2019 Centos Server Configuration

    20/70

    Choose Keyboard Layout

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-07.png

  • 8/16/2019 Centos Server Configuration

    21/70

    Choose English Keyboard

    7. On the next step you can customize your installation by using other Installation Sources thanyour local DVD/USB media, such as a network locations using HTTP , HTTPS , FTP or NFS

    protocols and even add some additional repositories, but use this methods only if you know whatyou’re doing . So leave the default Auto-detected installation media and hit on Done tocontinue.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-08.png

  • 8/16/2019 Centos Server Configuration

    22/70

    Choose Installation Sources

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-09.png

  • 8/16/2019 Centos Server Configuration

    23/70

    Auto Detect Installation Type

    8. On the next step you can choose your system installation software. On this step CentOS offersa lot of Server and Desktop platform environments that you choose from, but, if you want a high

    degree of customization, especially if you are going to use CentOS 7 to run as a server platform,then I suggest you select Minimal Install with Compatibility Libraries as Add-ons , which willinstall a minimal basic system software and later you can add other packages as your needsrequire using yum groupinstall command.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-10.png

  • 8/16/2019 Centos Server Configuration

    24/70

    Software Selection

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-11.png

  • 8/16/2019 Centos Server Configuration

    25/70

    Select CentOS 7 Minimal Install

    9. Now it’s time to partition your hard -drive. Click on Installation Destination menu, selectyour disk and choose I will configure partitioning .

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-12.png

  • 8/16/2019 Centos Server Configuration

    26/70

    Choose Installation Destination

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-13.png

  • 8/16/2019 Centos Server Configuration

    27/70

    Installation Device Selection

    10. On the next screen, choose LVM (Logical Volume Manager) as partition layout and, then,click on Click here to create them automatically , option which will create three system

    partition using XFS filesystem, automatically redistributing your hard-disk space and gatheringall LVS into one big Volume Group named centos .

    M; LEAA$ – B)$ 4EFQ; LN.AA$O – 4EFH; &*,2 – 4EF

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-14.png

  • 8/16/2019 Centos Server Configuration

    28/70

    Select LVM Partition Type

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-15.png

  • 8/16/2019 Centos Server Configuration

    29/70

    Create Partitions

    11. If you are not pleased with the default partition layout done automatically by the installer youcan completely add, modify or resize your partition scheme and when you finish hit on Done

    button and Accept Changes on the Summary of Changes prompt.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-16.png

  • 8/16/2019 Centos Server Configuration

    30/70

    Summary of Partition Changes

    NOTE : For those users, who have hard-disks more than 2TB in size, the installer automaticallywill convert partition table to GPT, but if you wish to use GPT table on smaller disks than 2TB,

    then you should use the argument inst.gpt to the installer boot command line in order to changethe default behaviour.

    12. The next step is to set your system hostname and enable networking. Click on Network &Hostname label and type your system FQDN (Fully Qualified Domain Name) on Hostnamefiled, then enable your Network interface, switching the top Ethernet button to ON .

    If you have a functional DHCP server on you network then it will automatically configure allyour network setting for enabled NIC, which should appear under your active interface.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-17.png

  • 8/16/2019 Centos Server Configuration

    31/70

    Set System Hostname

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-18.png

  • 8/16/2019 Centos Server Configuration

    32/70

    Enable Ethernet Interface

    13. If your system will be destined as a server it’s better to set static network configuration onEthernet NIC by clicking on Configure button and add all your static interface settings like in

    the screenshot below, and when you’re finished hit on Save button, disable and enable Ethernetcard by switching the button to OFF and ON , and, then hit on Done to apply setting and go backto main menu.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-19.png

  • 8/16/2019 Centos Server Configuration

    33/70

    Enter Network Settings

    14. Now it’s time to start installation process by pressing on Begin Installation button and set upa strong password for root account.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-20.png

  • 8/16/2019 Centos Server Configuration

    34/70

    Click on Begin Installation

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-21.png

  • 8/16/2019 Centos Server Configuration

    35/70

    Select Root Password

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-22.png

  • 8/16/2019 Centos Server Configuration

    36/70

    Enter Root Password

    15. After you finish setting up a strong password for root account move to User Creation andcreate your first system user. You can designate this user to become a System Admin with root

    privileges using sudo command by checking the box Make this user administrator , then clickon Done to go back on main menu and wait for the installation process to finish.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-23.png

  • 8/16/2019 Centos Server Configuration

    37/70

    CentOS 7 Installation Process

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-24.png

  • 8/16/2019 Centos Server Configuration

    38/70

    User Creation and Set Password

    16. After the installation process finishes, the installer will show a successfully message onscreen, demanding to reboot your system in order to use it.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-25.png

  • 8/16/2019 Centos Server Configuration

    39/70

    CentOS 7 Installation Complete

    Congratulation! You have now installed last version of CentOS on your bare new machine.Remove any installation media and reboot your computer so you can login to your new minimal

    CentOS 7 environment and perform other system tasks, such as update you system and installother useful software needed to run day to day tasks.

    http://www.tecmint.com/wp-content/uploads/2014/07/CentOS-7-Installation-26.png

  • 8/16/2019 Centos Server Configuration

    40/70

    4?/,E:" 1?."*,::D'9,%(. +0#1 %) 1))% Pd 0+ 1))%R 5+% 5/009)13

    K)9 %) '%)5 /$3 @,0/=2# T,1#9/223 )$ "#$%&' 8

    S% ,0P?JP:7 1#()**#$3#3 %./% -)+ ./I# /$)%.#1 7,1#9/22 51)%#(%,$6 -)+1 $#%9)1X )1 0#1I#1 =#7)1#D )1

    ,**#3,/%#2- /7%#1D 3,0/=2,$6 7,1#9/223;

    V1#eT2,6.% ".#(X

    G.#0# ,$0%1+(%,)$0 /1# ,$%#$3#3 05#(,7,(/22- 7)1 0%)55,$6 /$3 3,0/=2,$6 7,1#9/223 "#$%&' 8; I’ll be working from a Liquid Web Self Managed CentOS 7 server, and I’ll be logged in as root.

    @,0/=2# T,1#9/223

    To disable firewalld, run the following command as root:

    !"!#$%' )*!+,'$ -*.$/+'')

    '%)5 T,1#9/223

    To stop firewalld, run the following command as root:

    !"!#$%' !#01 -*.$/+'')

    ".#(X %.# '%/%+0 )7 T,1#9/223

    To check the status of firewalld, run the following command as root:

    !"!#$%' !#+#2! -*.$/+'')

    Wait, you actually wanted to Start and Enable Firewalld on CentOS 7? Then hit our tutorial on:How to Start and Enable Firewalld on CentOS 7 !

    http://www.liquidweb.com/kb/how-to-stop-and-disable-firewalld-on-centos-7/http://www.liquidweb.com/kb/how-to-stop-and-disable-firewalld-on-centos-7/http://www.liquidweb.com/kb/how-to-start-and-enable-firewalld-on-centos-7/http://www.liquidweb.com/kb/how-to-start-and-enable-firewalld-on-centos-7/http://www.liquidweb.com/kb/how-to-start-and-enable-firewalld-on-centos-7/http://www.liquidweb.com/kb/how-to-stop-and-disable-firewalld-on-centos-7/

  • 8/16/2019 Centos Server Configuration

    41/70

  • 8/16/2019 Centos Server Configuration

    42/70

    Now Restart network service by typing below command.!"!#$%' .$!#+.# 3$#/0.4 Now your server will get IP Address from DHCP .

    , 6)5)%1 12(3%4$&5)%2(

    Step 4 » For manual IP address,1. Choose “ Manual ” in IPv4 CONFIGURATION. 2. Add IP Address with Subnet , Gateway and DNS server ( Refer below image ).3. Choose Automatic Connect check box.4. Press OK and quit Network manager.

    http://www.krizna.com/wp-content/uploads/2014/08/Setup-network-on-centos-7-3.pnghttp://www.krizna.com/wp-content/uploads/2014/08/Setup-network-on-centos-7-2.png

  • 8/16/2019 Centos Server Configuration

    43/70

    Now Restart network service by typing below command.!"!#$%' .$!#+.# 3$#/0.4 That’s it, Interface will have static IP.

    !0!&.*1#!$31?!@ABCDEFE#G$.3$#HIIBDJIBIF303$KELJIMBEF"$!NDOPQLRNSMJEQLRBRSF30NDOTNUNBF"$!NDOTQRMBIVIULF"$!NDOTQKELJIMBEF"$!NDOTQLRNSMJEQLRBRSF30URWEF$31?!@AMMNKFA-@+--X)>,@YP>PPZT>[P[A>$Z+P)$)))&$-IUHIIBF30\]RKKJF??^?V^X[^R@^HY^KTDEEJKU_F"$!DEEJJIMBE_F"$!NDOTQDEEJKU_F"$!NDOTQDEEJJIMBE_F"$!

    , -./0 12(3%4$&5)%2(

    Step 2 » For DHCPFind the below lines in config File.HIIBDJIBIF303$IUHIIBF30 and replace withHIIBDJIBIF)G&1IUHIIBF"$! Now Restart network service by typing below command.!"!#$%' .$!#+.# 3$#/0.4 Now your server will get IP Address from DHCP

    , 6)5)%1 12(3%4$&5)%2(

    Step 3 » For Static IP.Find the below lines in config File.HIIBDJIBIF303$IUHIIBF30 and replace withHIIBDJIBIF!#+#*&IUHIIBF"$! And add the below lines at the end of the file.NDRKKJF@AX`XA`?`ZX

    UEBWR_aFXYY`XYY`XYY`?bRBE]RCF@AX`XA`?`@KU_@F@AX`XA`?`YFile will look like below after changes.BCDEFE#G$.3$#HIIBDJIBIF!#+#*&KELJIMBEF"$!NDOPQLRNSMJEQLRBRSF30NDOTNUNBF"$!NDOTQRMBIVIULF"$!NDOTQKELJIMBEF"$!NDOTQLRNSMJEQLRBRSF30URWEF$31?!@AMMNKF-?&Y,ZA)>X[[+>PZ&,>,AP,>T@c,,XYX)@X[

  • 8/16/2019 Centos Server Configuration

    44/70

    IUHIIBF"$!\]RKKJF??^?V^X[^R@^HY^VVNDOTQDEEJKU_F"$!NDOTQDEEJJIMBE_F"$!NDRKKJF@[X`@Tc`@`@?UEBWR_aFXYY`XYY`XYY`?bRBE]RCF@[X`@Tc`@`@KU_@F@[X`@Tc`@`Y

    Now Restart network service by typing below command.

    !"!#$%' .$!#+.# 3$#/0.4 Now Interface will have static IP.Additionally you can use /etc/sysconfig/network file for hostname and DNS .\I_BURWEF!$.;$.`4.*73+`&0%KU_@F@[X`@Tc`@`YKU_XFc`c`c`c_ERJV\F4.*73+`&0%

    Have a nice day

  • 8/16/2019 Centos Server Configuration

    45/70

    &&Q &".R". ,#9 !:?"#$ &"$-2

    Configure SSH Server to login to a server from remote computer. SSH uses 22/TCP port.OpenSSH is already installed by default even if you installed CentOS with "Minimal Install", soit's not necessarry to install new packages. You can login with Password Authentication bydefault, but change some settings for security like follows.

    [root@client ~]# -y install openssh (Already installed)

    [root@dlp ~]# vi or nano /etc/ssh/sshd_config# line 48: uncomment and change ( prohibit root login remotely )

    PermitRootLogin no# line 77: uncomment

    PermitEmptyPasswords noPasswordAuthentication yes

    [root@dlp ~]# systemctl restart sshd

    Configure SSH Client : CentOS

    Configure SSH Client on CentOS.Install SSH Client.

    [root@client ~]# -y install openssh-clients

    Connect to SSH server with a common user.

    # ssh [username@(hostname or IP address)]

    [root@client ~]# ssh [email protected]

    Configure SSH Client : Windows

    Configure SSH Client on Windows.Get a software which you can login with SSH from Windows clients. This example shows to usePutty . Install and start it and input your server's IP address and Click 'Open' button like follows.

    http://www.server-world.info/en/command/html/vi.htmlhttp://www.server-world.info/en/command/html/vi.htmlhttp://www.server-world.info/en/command/html/vi.htmlhttp://www.server-world.info/en/command/html/systemctl.htmlhttp://www.server-world.info/en/command/html/systemctl.htmlhttp://www.chiark.greenend.org.uk/~sgtatham/putty/http://www.chiark.greenend.org.uk/~sgtatham/putty/http://www.chiark.greenend.org.uk/~sgtatham/putty/http://www.server-world.info/en/command/html/systemctl.htmlhttp://www.server-world.info/en/command/html/vi.html

  • 8/16/2019 Centos Server Configuration

    46/70

  • 8/16/2019 Centos Server Configuration

    47/70

    S@2A.$?#J T.A@7

    yum add proxy on CentOS:

    P$$2U2.A@7V G##1^*''$+,,?-6"&782"+?$8669%&:@(%-&.$&%#(.6"&

  • 8/16/2019 Centos Server Configuration

    48/70

    How to Install LAMP on CentOS 74[FV 9.,(. )1,6,$/22- 0%/$30 7)1 4,$+CD [5/(.#D F-'f4 /$3 VKV ./0 $)9 1#(#$%2- (./$6#3 9,%. %.# 1,0#)7 F/1,/@U D / 31)5e,$ 1#52/(#*#$% 7)1 )1,6,$/2 F-'f4; 4)$6 0%)1- 0.)1%D F/1,/@U ,0 / 7)1X )7 F-'f4 /$33#I#2)5#3 =- F-'f4 3#I#2)5#10 ,%0#27; S% ./0 /2*)0% /22 7#/%+1#0 )7 9./% F-'f4 ./0 /$3 7#/%+1#0 2,=1/1-=,$/1- #b+,I/2#$(- /$3 #C/(% */%(.,$6 9,%. F-'f4 [VS0 /$3 ()**/$30; S% *#/$0 ,7 /$ /55 ,0 /=2# %)

    1+$ 9,%. F-'f4 /$3 ,% /20) ,0 /=2# %) )$ F/1,/@U 9,%.)+% /$- 62,%(.; S 9,22 $)% #C52/,$ 9./% ,0 [5/(.#/$3 VKV as I’ve explained before and I believe you already knew what it is.

    =04 #"";?

    M; [ 0#1I#1 1+$$,$6 "#$%&' 8; S 1#()**#$3 -)+ %) +0# "#$%&' 8 C_:g:N *,$,*/2 ,7 /I/,2/=2#;Q; [ X$)92#36# )$ .)9 %) +0# V+%%- )1 G#1*,$/2 %) /((#00 / 0#1I#1 I,/ ''K ; H; S =#2,#I# -)+ X$#9 e !" $%!&" '!(" )* e *)0% ()**)$ W$,C ()**/$30 +0#3 %) */$/6# /$

    +$*/$/6#3 0#1I#1 ; N; [ 05/1# %,*# )7 -)+1 2,7# /$3 / (+5 )7 ()77##;

    +#,$-.. @5-3A" B"C &"2D"2

    Being the most popular web server, Apache is commonly included in most of recent LinuxDistro so installation will be very easy.

    Before you proceed to the next steps, it is better to explain that all commands in this tutorial arewritten without the “sudo” prefix. In this tutorial I use root but you may also login as separateuser with root privilege. However if you disabled root login and you logged in using anotherusername with root privilege, you can add the “ sudo ” prefix all by your self. Alternatively youcan simply type su , hit Enter and type in your password twice to switch as root.

    Step 1 – Login to your server via Putty or Terminal.

    Step 2 – Now issue command below to install Apache 2.4 on your CentOS 7 server:

    "2% *3!#+'' G##1) >"

    As you can see the command is still the same.

    And when the process finished, you’ll see something like this:

    http://en.wikipedia.org/wiki/Mariadbhttp://en.wikipedia.org/wiki/Mariadbhttp://en.wikipedia.org/wiki/Mariadbhttp://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/using-putty-to-ssh-to-your-server-from-windows/46/http://www.servermom.org/using-putty-to-ssh-to-your-server-from-windows/46/http://www.servermom.org/using-putty-to-ssh-to-your-server-from-windows/46/http://www.servermom.org/top-most-used-common-ssh-commands/56/http://www.servermom.org/top-most-used-common-ssh-commands/56/http://www.servermom.org/top-most-used-common-ssh-commands/56/http://www.servermom.org/top-most-used-common-ssh-commands/56/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-2/http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-1/http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/http://www.servermom.org/top-most-used-common-ssh-commands/56/http://www.servermom.org/top-most-used-common-ssh-commands/56/http://www.servermom.org/top-most-used-common-ssh-commands/56/http://www.servermom.org/using-putty-to-ssh-to-your-server-from-windows/46/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://en.wikipedia.org/wiki/Mariadb

  • 8/16/2019 Centos Server Configuration

    49/70

    Step 3 – Now you have Apache 2.4 installed which you can then start the service by typingcommand below:

    !"!#$%' !#+.# G##1)`!$.;*&$

    or,..

    !$.;*&$ G##1) !#+.#

    Available commands:

    !"!#$%' !#+#2!d!#+.#d!#01d.$!#+.#d.$'0+) G##1)`!$.;*&$

    : IJe 0') &0%%+3) ^

    !$.;*&$ G##1) !#+#2!d!#+.#d!#01d.$!#+.#d.$'0+)

    Step 4 – You can verify that Apache is really running by opening your favorite web browser andaccess your vps via its IP address:

    G##1^

  • 8/16/2019 Centos Server Configuration

    50/70

  • 8/16/2019 Centos Server Configuration

    51/70

    +#,$-.. 1E1F

    Step 5 – Now, it is time to install PHP5. Default command is:

    "2% *3!#+'' 1G1 >"

    That’ really is a simple command but since we will install MySQL then we’ll need PHP MySQLmodules plus any other PHP5 modules you website / app may need it. You can view all availablemodules using this command:

    "2% !$+.&G 1G1>

    Confused? You can read my previous article or you can simply use command below thatincludes common PHP5 modules most websites can run with it.

    "2% *3!#+'' 1G1 1G1>&0%%03 1G1>&'* 1G1>)$;$' 1G1>=) 1G1>*%+1 1G1>*3#' 1G1>

    %"!g' 1G1>1.0&$!! 1G1>f%' 1G1>f%'.1& 1G1>7#! >"

    And once done, you’ll see something like this:

    http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-5/http://www.servermom.org/how-to-build-working-centos-server-with-apache-and-php/428/

  • 8/16/2019 Centos Server Configuration

    52/70

    You can test which version of PHP is installed by typing php -v command.

    In my example it is PHP v5.4.16 .

    +#,$-.. :-2/-GH :>&IJ &"2D"2

    Step 6 – Installing MariaDB mysql server on CentOS 7 is pretty easy and once again we’ll makeus of yum package manager:

    "2% *3!#+'' %+.*+),>!$.;$. %+.*+), >"

    and once done you’ll see something like this:

    http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-6/http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-5-php-version/http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-5-1/

  • 8/16/2019 Centos Server Configuration

    53/70

  • 8/16/2019 Centos Server Configuration

    54/70

    :-2/-GH +#/$/-. !0#K/L42-$/0#

    Step 8 – So its service is now running but there is one thing you should do immediately:configuring MariaDB setup for the very first time like setting up your mysql root password. Issuethis command:

    %"!g'Q!$&2.$Q*3!#+''+#*03

    Then you’ll see a series of question, just answer it accordingly. The main important part is todefine your root password while everything else is just up to you or you can simply hit the“ENTER” key through each prompt to accept the default values.

    http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-8-mysql-setup/

  • 8/16/2019 Centos Server Configuration

    55/70

    If you need to automatically run MariaDB everytime your server boot, simply issue thiscommand:

    !"!#$%' $3+,'$ %+.*+),`!$.;*&$

    You may also need to test your newly installed MariaDB by logging in as root:

    %"!g' >2 .00# >1

    As you can see from the screenshot above, it is Maria DB v5.5.37 .

    Step 9 – Also test if Apache and PHP is running well and able to process any *.php files. Createa php info page using this command followed by restarting apache

    $&G0 hij1G1 1G1*3-0klm jnh n

  • 8/16/2019 Centos Server Configuration

    56/70

    +#,$-../#L 1A5:>@;

  • 8/16/2019 Centos Server Configuration

    57/70

    then enable the repository and delete the .rpm file as it is not needed again.

    .1% >*;G .1%-0.=$>.$'$+!$>o

    .% .1%-0.=$>.$'$+!$>o

    Method #2: EPEL

    Download the .rpm file:

    /=$# G##1^"

    https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3Fhttps://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3Fhttp://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-10-rpmforge-enable/http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-10-rpmforge/https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F

  • 8/16/2019 Centos Server Configuration

    58/70

    screenshot:

    Step 12 – That’s it. Now you also have phpMyAdmin (PMA) installed but you should be better ifyou change its default configuration before using it. First, you’ll need to backup default PMA’sconfig file:

    &1

  • 8/16/2019 Centos Server Configuration

    59/70

    Also you’ll need to edit few lines next:

    Before:

    After:

    Shortly it should look like this:

    iK*.$."

    http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-13-3/http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-13-2/http://www.servermom.org/install-lamp-centos-7/1741/lamp-centos-7-13-4/

  • 8/16/2019 Centos Server Configuration

    60/70

    J$g2*.$ +'' =.+3#$)

    i

  • 8/16/2019 Centos Server Configuration

    61/70

    That’s all. Now you can host your websites or blogs in that server, even WordPress.

    Do not forget to follow me on twitter to get faster update or download my official Android app . Enjoy..

    2P2W7X98?# IA#+?J-.,$?A# *A.Y?#J 8"$PA9/

    How To Install and Secure phpMyAdminwith Apache on a CentOS 7 ServerIntroduction

    Relational database management systems like MySQL and MariaDB are needed for a significant portion of web sites and applications. However, not all users feel comfortable administering theirdata from the command line.

    To solve this problem, a project called phpMyAdmin was created in order to offer an alternativein the form of a web-based management interface. In this guide, we will demonstrate how toinstall and secure a phpMyAdmin configuration on a CentOS 7 server. We will build this setupon top of the Apache web server, the most popular web server in the world.

    http://twitter.com/servermomdotcomhttp://twitter.com/servermomdotcomhttp://twitter.com/servermomdotcomhttp://www.servermom.org/servermom-app/1498/http://www.servermom.org/servermom-app/1498/http://www.servermom.org/servermom-app/1498/http://www.servermom.org/install-lamp-centos-7/1741/phpmyadmin-login-page/http://www.servermom.org/servermom-app/1498/http://twitter.com/servermomdotcom

  • 8/16/2019 Centos Server Configuration

    62/70

    Prerequisites

    Before we begin, there are a few requirements that need to be settled.

    To ensure that you have a solid base to build this system upon, you should run through our initialserver setup guide for CentOS 7 . Among other things, this will walk you through setting up anon-root user with !2)0 access for administrative commands.

    The second prerequisite that must be fulfilled in order to start on this guide is to install a LAMP(Linux, Apache, MariaDB, and PHP) stack on your CentOS 7 server. This is the platform that wewill use to serve our phpMyAdmin interface (MariaDB is also the database managementsoftware that we are wishing to manage). If you do not yet have a LAMP installation on yourserver, follow our tutorial on installing LAMP on CentOS 7 .

    When your server is in a properly functioning state after following these guides, you cancontinue on with the rest of this page.

    Step One — Install phpMyAdmin

    With our LAMP platform already in place, we can begin right away with installing the phpMyAdmin software. Unfortunately, phpMyAdmin is not available in CentOS 7's defaultrepository.

    To get the packages we need, we'll have to add an additional repo to our system. The EPEL repo(E xtra Packages for E nterprise L inux) contains many additional packages, including the

    phpMyAdmin package we are looking for.

    The EPEL repository can be made available to your server by installing a special package called$1$'>.$'$+!$ . This will reconfigure your repository list and give you access to the EPEL

    packages.

    To install, just type:

    !2)0 "2% *3!#+'' $1$'>.$'$+!$

    Now that the EPEL repo is configured, you can install the phpMyAdmin package using the "2% packaging system by typing:

    !2)0 "2% *3!#+'' 1G1%"+)%*3

    The installation will now complete. The installation included an Apache configuration file thathas already been put into place. We will need to modify this a bit to get it to work correctly forour installation.

    Open the file in your text editor now so that we can make a few changes:

    !2)0 3+30

  • 8/16/2019 Centos Server Configuration

    63/70

    Currently, this setup is configured to deny access to any connection not being made from theserver itself. Since we are working on our server remotely, we need to modify some lines tospecify the IP address of your home connection.

    Change any lines that read J$g2*.$ *1 @XA`?`?`@ or R''0/ -.0% @XA`?`?`@ to refer to yourhome connection's IP address. If you need help finding the IP address of your home connection,check out the next section. There should be four locations in the file that must be changed:

    ` ` `J$g2*.$ *1 "02.Q/0.4!#+#*03QNDQ+)).$!!` ` `R''0/ -.0% "02.Q/0.4!#+#*03QNDQ+)).$!!` ` `J$g2*.$ *1 "02.Q/0.4!#+#*03QNDQ+)).$!!` ` `R''0/ -.0% "02.Q/0.4!#+#*03QNDQ+)).$!!` ` `

    When you are finished, restart the Apache web server to implement your modifications bytyping:

    !2)0 !"!#$%' .$!#+.# G##1)`!$.;*&$

    With that, our phpMyAdmin installation is now operational. To access the interface, go to yourserver's domain name or public IP address followed by

    To sign in, use a username/password pair of a valid MariaDB user. The .00# user and theMariaDB administrative password is a good choice to get started. You will then be able to accessthe administrative interface:

  • 8/16/2019 Centos Server Configuration

    64/70

    Find Your IP Address

    You will need to know the IP address of the computer you are using to access your databases inorder to complete the step above. This is a security precaution so that unauthorized people cannotconnect to your server.

    Note: This is not the IP address of your VPS, it is the IP address of your home or workcomputer.

    You can find out how the greater web sees your IP address by visiting one of these sites in yourweb browser:

    What's My IP Address? What's My IP? My IP Address

    Compare a few different sites and make sure they all give you the same value. Use this value inthe configuration file above.

    Step Two — Secure your phpMyAdmin Instance

    The phpMyAdmin instance installed on our server should be completely usable at this point.However, by installing a web interface, we have exposed our MySQL system to the outsideworld.

    Even with the included authentication screen, this is quite a problem. Because of phpMyAdmin's popularity combined with the large amount of data it provides access to, installations like theseare common targets for attackers.

    We will implement two simple strategies to lessen the chances of our installation being targetedand compromised. We will change the location of the interface from

  • 8/16/2019 Centos Server Configuration

    65/70

    Changing the Application's Access Location

    In order for our Apache web server to work with phpMyAdmin, our phpMyAdmin Apacheconfiguration file uses an alias to point to the directory location of the files.

    To change the URL where our phpMyAdmin interface can be accessed, we simply need torename the alias. Open the phpMyAdmin Apache configuration file now:

    !2)0 3+30

    We want to disable these specific aliases since they are heavily targeted by bots and malicioususers. Instead, we should decide on our own alias. It should be easy to remember, but not easy toguess. It shouldn't indicate the purpose of the URL location. In our case, we'll go with

    Now, if you go to the previous location of your phpMyAdmin installation, you will get a 404error:

    G##1^

  • 8/16/2019 Centos Server Configuration

    66/70

    Setting up a Web Server Authentication Gate

    The next feature we wanted for our installation was an authentication prompt that a user would be required to pass before ever seeing the phpMyAdmin login screen.

    Fortunately, most web servers, including Apache, provide this capability natively. We will justneed to modify our Apache configuration file to use an authorization file.

    Open the phpMyAdmin Apache configuration file in your text editor again:

    !2)0 3+30 ` ` `iK*.$."

    This will allow us to specify additional configuration details in a file called `G#+&&$!! locatedwithin the phpMyAdmin directory itself. We will use this file to set up our passwordauthentication.

    Save and close the file when you are finished.

    Restart the web service to implement this change:

    !2)0 !"!#$%' .$!#+.# G##1)`!$.;*&$

    Create an .htaccess File

  • 8/16/2019 Centos Server Configuration

    67/70

    Now that we have the override directive in our configuration, Apache will look for a file called`G#+&&$!! within the

    Within this file, we need to enter the following information:

    R2#GB"1$ H+!*&R2#GU+%$ hR)%*3 S0=*3hR2#GM!$.L*'$ &

  • 8/16/2019 Centos Server Configuration

    68/70

  • 8/16/2019 Centos Server Configuration

    69/70

  • 8/16/2019 Centos Server Configuration

    70/70

    [22)9 71)* /22ih@,1#(%)1-j

    i@,1#(%)1- h+01h0./1#h5.5F-[3*,$h0#%+5h71/*#0hj&13#1 @#$-D[22)9d @#$- 71)* [22d [22)9 71)* B)$#

    [22)9 71)* /22ih@,1#(%)1-j

    d G.,0 ()$7,6+1/%,)$ 51#I#$%0 *)3g0#(+1,%- /% 5.5F-[3*,$ 3,1#(%)1,#0 71)*d 7,2%#1,$6 'f4 #%(; G.,0 */- =1#/X -)+1 *)3g0#(+1,%- ,*52#*#$%/%,)$;ddiS7F)3+2# *)3g0#(+1,%-;(jd i@,1#(%)1- h+01h0./1#h5.5F-[3*,$hjd '#(J+2#S$.#1,%/$(# &77d ih@,1#(%)1-jdihS7F)3+2#j

    B)9 ,$0%/22 c)13V1#00 …………………

    K/55- '#1I#1 ")$7,6+1/%,)$

    L$61; F3; B/Z,* W33,$

    $/Z,*;(0#;X+#%m6*/,2;()*