Configuration
Configuration
log files:
* It contatains messages regarding system including the kernal, services &
applications running on it.
* It is very useful to when trying to troubleshoot problem in the system.
* Only root users can read these log messages.
* The messages will be generated only when rsyslog service is running.
-----------------------------------------------------------------------------------
-----------------
Apache Web server :
* Open source web server.
* It is mostly used web server in the internet.
* httpd is the deamon that speaks the http or https protocols.
* It is a text based protocol for sending and receiving the objects over a network
connection.
* The http protocol is sent over the wired network in clear text using default port
number 80/tcp.
* To protect the website we can use https web server for data encryption.
4) # cd /root/Downloads
5) # unzip <content>
8) # curl localhost
9) # curl 192.168.1.101
4) # vim /usr/share/nginx/html/index.html
***********************************************************************************
****
3) # useradd user1
4) # mkdir /var/www/testing1.com/public_html
# cd /var/www/testing1.com/public_html
# vim index.html
5) # mkdir /etc/nginx/sites-available
# cd /etc/nginx/sites-available
# touch testing1.com.conf
server {
listen 192.168.1.101:80
server_name testing1.com www.testing1.com
root /var/www/testing1.com/public_html
index index.html
}
# chmod 755 testing1.com.conf
# chgrp user1 testing1.com.conf
# cd /var/www/testing1.com/public_html
# chmod 755 index.html
# chgrp user1 index.html
6) # vim /etc/nginx/nginx.conf
uncomment ----> #user nginx
uncomment ----> #include /etc/nginx/conf.d/*.conf
add text (in http) ----> include /etc/nginx/sites-available/*.conf
7) # vim /etc/hosts
192.168.1.101 testing1.com www.testing1.com
8) # nginx -t
# systemctl restart nginx
***********************************************************************************
**************
5) # vim /etc/yum.repos.d/MariaDB.10x.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# mysql -u root -p
## create database wordpressdb;
## grant all privileges on wordpressdb.* to
wordpressuser@localhost identified by '123';
## flush privileges;
6) # cd /var/www/html
# wget http://wordpress.org/latest.tar.gz
# tar -xvf latest.tar.gz
# chown -R apache:apache wordpress/
7) # vim /etc/httpd/conf.d/<filename>.conf
-----> Go to last line and type
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/wordpress
ServerName hvthang.xyz
ServerAlias www.hvthang.xyz
ErrorLog /var/log/httpd/hvthang.xyz-error.log
CustomLog /var/log/httpd/hvthang,xyz-acces.log common
</VirtualHost>
# httpd -t
# systemctl restart httpd
***************************************************************************
How to install SSL cetificate
5) # cp ca.crt /etc/pki/tls/certs
# cp ca.key /etc/pki/tls/private
# cp ca.csr /etc/pki/tls/private
6) # vim /etc/httpd/conf.d/ssl.conf
Edits line---->
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
# httpd -t
7) # vim /etc/httpd/conf.d/<filename>.conf
<Virtualhost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
servername www.server.demo.com
Documentroot /web
</virtualhost>
# httpd -t
*******************************************************************************
* Host Multiple Websites With SSL Encryption in RHEL
--------------------------------------------------------------------
FTP :
* File transfer protocol.
* FTP stands for File Transfer Protocol used to transfer fles from one host to
another host over a TCP-based network
Package ------> samba* for samba server and samba-client* for samba client
Deamons ------> smb and nmb for RHEL - 7 where as smb is for Samba server deamon
and nmb is for
Netbios service deamon
Steps:
1) # yum install dhcp*
-----------------------------------------------------------------------------------
-----------------