Monday, 21 September 2020

Host Multiple Websites on a Single Server with Apache on Ubuntu

Below config is to host multiple website which runs on different port on same server:-


Step1: Make two directories one for each port

mkdir /var/www/html/172.16.1.12_8080

mkdir /var/www/html/172.16.1.12_8081


Step2: Create index file for site on port 8080

nano /var/www/html/172.16.1.12_8080/index.html

<html>

<title>172.16.1.12_8080</title>

<h1>Welcome to 172.16.1.12_8080 Website</h1>

<p>Website on port 8080</p>

</html>

CTRL X then press Y

press Enter


Step3: Create index file for site on port 8081

nano /var/www/html/172.16.1.12_8081/index.html

<html>

<title>8081</title>

<h1>Welcome to 172.16.1.12_8081 Website</h1>

<p>Website on port 8081</p>

</html>

CTRL X then press Y

press Enter


Step4: Assign priviledge to sites

chown -R www-data:www-data /var/www/html/172.16.1.12_8080

chown -R www-data:www-data /var/www/html/172.16.1.12_8081


Step5: Add 8080 site 

nano /etc/apache2/sites-available/172.16.1.12_8080.conf

<VirtualHost 172.16.1.12:8080>

ServerAdmin admin@localhost

ServerName  172.16.1.12

DocumentRoot /var/www/html/172.16.1.12_8080

DirectoryIndex index.html

ErrorLog ${APACHE_LOG_DIR}/8080_error.log

CustomLog ${APACHE_LOG_DIR}/8080_access.log combined

</VirtualHost>

CTRL X then press Y

press Enter


Step6: Add 8081 site

nano /etc/apache2/sites-available/172.16.1.12_8081.conf

<VirtualHost 172.16.1.12:8081>

ServerAdmin admin@localhost

ServerName  172.16.1.12

DocumentRoot /var/www/html/172.16.1.12_8081

DirectoryIndex index.html

ErrorLog ${APACHE_LOG_DIR}/8081_error.log

CustomLog ${APACHE_LOG_DIR}/8081_access.log combined

</VirtualHost>

CTRL X then press Y

press Enter


Step7: Enable sites

a2ensite 172.16.1.12_8080

a2ensite 172.16.1.12_8081


Step7: Restart Apache

systemctl restart apache2

Sunday, 20 September 2020

Stuck in Configuration Utility restarting - Big IP

1. Log in to BIG-IP .

2. Make a backup using below command :

 /config/httpd/conf.d/proxy_ajp.conf cp /config/httpd/conf.d/proxy_ajp.conf /config/httpd/conf.d/proxy_ajp.conf.bk

3.Edit /config/httpd/conf.d/proxy_ajp.conf 

Below is the command to make the changes. After the command press "i"  (insert) to enable the editing and once the changes are done, enter esc and type :wq!(write and quite).

vi /config/httpd/conf.d/proxy_ajp.conf

Locate the following two "#ProxyPass" lines and  the below command .

#ProxyPass /tomcat/ ajp://localhost:8009/

#ProxyPass /examples/ ajp://localhost:8009/jsp-examples/

ProxyTimeout 10            #<----- Add this line

4.Save and close the file.

5.Restart httpd and tomcat.

bigstart restart httpd tomcat


Wednesday, 16 September 2020

F5 default credentials and some interesting Facts.

 Below are the default credentials for F5. you can change the credentials during initial setup wizard.

Cli

Username: root

Password: default


GUI

Username:admin

Password:admin

Interesting Fact:-

  • Root and admin username cannot be deleted from F5.
  • BY default,  username admin doesnot have access to the CLI but we can assign either advance shell or TMOS access to the "admin" user.
System >> Users : User List>> click user admin>> choose tmsh from drop down of "Terminal Access">> click update
  • No GUI access can be given to user "root"




Global NTP servers

 NTP is a UDP based service which works on port number 123.It is recommended to use pool.ntp.org to find an NTP server.

All zones in All Pool Servers.

  • Africa — africa.pool.ntp.org 
  • Antarctica — antarctica.pool.ntp.org 
  • Asia — asia.pool.ntp.org 
  • Europe — europe.pool.ntp.org 
  • North America — north-america.pool.ntp.org 
  • Oceania — oceania.pool.ntp.org 
  • South America — south-america.pool.ntp.org


Below is the command to check the ntp status on respective platforms.

A. Windows 

w32tm /query /peers

B. Ubuntu

/etc/ntp.conf

Wednesday, 9 September 2020

DNS root server list - A-M

 Below is the list of root servers starting from a to m.



Wednesday, 5 August 2020

SNMPv3 config on Cisco routers/Switches

   
1) Create an access-list to allow SNMP source servers.

access-list 10 permit 10.10.10.10
access-list 10 permit 10.10.10.11
access-list 10 permit 10.10.10.12

All SNMP servers must be allowed in above ACLs.

2) Now, Create the new Group using below command.

snmp-server group GROUP1 v3 auth read access 10

3) Create new credentials using the group "GROUP1"

snmp-server user SNMP_USER v3 auth md5 PASSWORD-AUTH priv aes 128 PASSWORD2-PRIV

All bold text are variables.

Monday, 3 August 2020

Enable Password vs Enable Secret command on cisco routers/switches

We all know that enable password is used to change from user mode to priviledge mode.

Enable password command will configure the password in unencrypted form whereas Enable secret command encrypts the password using MD5 hashing algorithm.

Enable secret command is always recommended.

Secret password will take precedence over enable password command.